فهرست منبع

Fixes for PR 679

Rod Hynes 1 سال پیش
والد
کامیت
a250068b84
3فایلهای تغییر یافته به همراه17 افزوده شده و 4 حذف شده
  1. 9 1
      psiphon/common/quic/obfuscator_test.go
  2. 7 2
      psiphon/common/quic/quic_disabled.go
  3. 1 1
      psiphon/dialParameters.go

+ 9 - 1
psiphon/common/quic/obfuscator_test.go

@@ -26,6 +26,7 @@ import (
 	"context"
 	"encoding/hex"
 	"net"
+	"strings"
 	"testing"
 	"time"
 
@@ -119,7 +120,7 @@ func runNonceTransformer(t *testing.T, quicVersion string) {
 
 		// Dial with nonce transformer
 
-		_, _ = Dial(
+		_, err = Dial(
 			ctx,
 			packetConn,
 			serverAddress,
@@ -139,6 +140,13 @@ func runNonceTransformer(t *testing.T, quicVersion string) {
 			common.WrapClientSessionCache(tls.NewLRUClientSessionCache(0), "test"),
 		)
 
+		// A timeout (deadline exceeded) is expected since the stub server
+		// just reads the prefix and doesn't perform a QUIC handshake. Any
+		// other dial error is a failure.
+		if err == nil || !strings.HasSuffix(err.Error(), "context deadline exceeded") {
+			return errors.Trace(err)
+		}
+
 		return nil
 	})
 

+ 7 - 2
psiphon/common/quic/quic_disabled.go

@@ -62,7 +62,10 @@ func Dial(
 	_ string,
 	_ *prng.Seed,
 	_ *transforms.ObfuscatorSeedTransformerParameters,
-	_ bool) (net.Conn, error) {
+	_ bool,
+	_ bool,
+	_ bool,
+	_ *common.TLSClientSessionCacheWrapper) (net.Conn, error) {
 
 	return nil, errors.TraceNew("operation is not enabled")
 }
@@ -87,7 +90,9 @@ func NewQUICTransporter(
 	_ string,
 	_ string,
 	_ *prng.Seed,
-	_ bool) (*QUICTransporter, error) {
+	_ bool,
+	_ bool,
+	_ *common.TLSClientSessionCacheWrapper) (*QUICTransporter, error) {
 
 	return nil, errors.TraceNew("operation is not enabled")
 }

+ 1 - 1
psiphon/dialParameters.go

@@ -170,7 +170,7 @@ type DialParameters struct {
 
 	quicTLSClientSessionCache *common.TLSClientSessionCacheWrapper  `json:"-"`
 	tlsClientSessionCache     *common.UtlsClientSessionCacheWrapper `json:"-"`
-	
+
 	inproxyDialInitialized         bool                         `json:"-"`
 	inproxyBrokerClient            *inproxy.BrokerClient        `json:"-"`
 	inproxyBrokerDialParameters    *InproxyBrokerDialParameters `json:"-"`