feat(snowflake): upgrade to v2 (+ small tweaks) (#667)

This diff contains the following changes and enhancements:

1. upgrade snowflake to v2

2. observe that we were not changing defaults from outside of snowflake.go, so remove code allowing to do that;

3. bump the timeout to 600 seconds (it seems 300 was not always enough based on my testing);

4. add useful knob to disable `torsf` progress (it's really annoying on console, we should do something about this);

5. ptx.go: avoid printing an error when the connection has just been closed;

6. snowflake: test AMP cache, see that it's not working currently, so leave it disabled.

Related issues: https://github.com/ooni/probe/issues/1845, https://github.com/ooni/probe/issues/1894, and https://github.com/ooni/probe/issues/1917.
This commit is contained in:
Simone Basso 2022-01-19 17:23:27 +01:00 committed by GitHub
commit cfb054efd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 49 additions and 81 deletions

View file

@ -39,6 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import (
"context"
"errors"
"fmt"
"net"
"strings"
@ -184,7 +185,9 @@ func (lst *Listener) acceptLoop(ctx context.Context, ln ptxSocksListener) {
if err, ok := err.(net.Error); ok && err.Temporary() {
continue
}
lst.logger().Warnf("ptx: socks accept error: %s", err)
if !errors.Is(err, net.ErrClosed) {
lst.logger().Warnf("ptx: socks accept error: %s", err)
}
return
}
go lst.handleSocksConn(ctx, conn)