diff --git a/go.mod b/go.mod index 74dd50cb04..6455ca99cf 100644 --- a/go.mod +++ b/go.mod @@ -51,8 +51,8 @@ require ( github.com/pion/webrtc/v3 v3.2.23 github.com/prometheus/client_golang v1.18.0 github.com/prometheus/client_model v0.6.0 - github.com/quic-go/quic-go v0.42.0 - github.com/quic-go/webtransport-go v0.6.0 + github.com/quic-go/quic-go v0.43.1 + github.com/quic-go/webtransport-go v0.8.0 github.com/raulk/go-watchdog v1.3.0 github.com/stretchr/testify v1.8.4 go.uber.org/fx v1.20.1 diff --git a/go.sum b/go.sum index 155ca30f77..33dd1e3250 100644 --- a/go.sum +++ b/go.sum @@ -357,10 +357,10 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/quic-go v0.42.0 h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM= -github.com/quic-go/quic-go v0.42.0/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M= -github.com/quic-go/webtransport-go v0.6.0 h1:CvNsKqc4W2HljHJnoT+rMmbRJybShZ0YPFDD3NxaZLY= -github.com/quic-go/webtransport-go v0.6.0/go.mod h1:9KjU4AEBqEQidGHNDkZrb8CAa1abRaosM2yGOyiikEc= +github.com/quic-go/quic-go v0.43.1 h1:fLiMNfQVe9q2JvSsiXo4fXOEguXHGGl9+6gLp4RPeZQ= +github.com/quic-go/quic-go v0.43.1/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M= +github.com/quic-go/webtransport-go v0.8.0 h1:HxSrwun11U+LlmwpgM1kEqIqH90IT4N8auv/cD7QFJg= +github.com/quic-go/webtransport-go v0.8.0/go.mod h1:N99tjprW432Ut5ONql/aUhSLT0YVSlwHohQsuac9WaM= github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= diff --git a/p2p/transport/webtransport/transport.go b/p2p/transport/webtransport/transport.go index 26c8743439..97172703f7 100644 --- a/p2p/transport/webtransport/transport.go +++ b/p2p/transport/webtransport/transport.go @@ -79,7 +79,7 @@ type transport struct { noise *noise.Transport connMx sync.Mutex - conns map[uint64]*conn // using quic-go's ConnectionTracingKey as map key + conns map[quic.ConnectionTracingID]*conn // using quic-go's ConnectionTracingKey as map key } var _ tpt.Transport = &transport{} @@ -105,7 +105,7 @@ func New(key ic.PrivKey, psk pnet.PSK, connManager *quicreuse.ConnManager, gater gater: gater, clock: clock.New(), connManager: connManager, - conns: map[uint64]*conn{}, + conns: map[quic.ConnectionTracingID]*conn{}, } for _, opt := range opts { if err := opt(t); err != nil { @@ -203,12 +203,10 @@ func (t *transport) dial(ctx context.Context, addr ma.Multiaddr, url, sni string return nil, err } dialer := webtransport.Dialer{ - RoundTripper: &http3.RoundTripper{ - Dial: func(ctx context.Context, addr string, tlsCfg *tls.Config, cfg *quic.Config) (quic.EarlyConnection, error) { - return conn.(quic.EarlyConnection), nil - }, - QuicConfig: t.connManager.ClientConfig().Clone(), + DialAddr: func(ctx context.Context, addr string, tlsCfg *tls.Config, cfg *quic.Config) (quic.EarlyConnection, error) { + return conn.(quic.EarlyConnection), nil }, + QUICConfig: t.connManager.ClientConfig().Clone(), } rsp, sess, err := dialer.Dial(ctx, url, nil) if err != nil { @@ -349,7 +347,7 @@ func (t *transport) allowWindowIncrease(conn quic.Connection, size uint64) bool t.connMx.Lock() defer t.connMx.Unlock() - c, ok := t.conns[conn.Context().Value(quic.ConnectionTracingKey).(uint64)] + c, ok := t.conns[conn.Context().Value(quic.ConnectionTracingKey).(quic.ConnectionTracingID)] if !ok { return false } @@ -358,13 +356,13 @@ func (t *transport) allowWindowIncrease(conn quic.Connection, size uint64) bool func (t *transport) addConn(sess *webtransport.Session, c *conn) { t.connMx.Lock() - t.conns[sess.Context().Value(quic.ConnectionTracingKey).(uint64)] = c + t.conns[sess.Context().Value(quic.ConnectionTracingKey).(quic.ConnectionTracingID)] = c t.connMx.Unlock() } func (t *transport) removeConn(sess *webtransport.Session) { t.connMx.Lock() - delete(t.conns, sess.Context().Value(quic.ConnectionTracingKey).(uint64)) + delete(t.conns, sess.Context().Value(quic.ConnectionTracingKey).(quic.ConnectionTracingID)) t.connMx.Unlock() } diff --git a/test-plans/go.mod b/test-plans/go.mod index c21cf255ae..e879a48837 100644 --- a/test-plans/go.mod +++ b/test-plans/go.mod @@ -87,8 +87,8 @@ require ( github.com/prometheus/common v0.47.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/quic-go v0.42.0 // indirect - github.com/quic-go/webtransport-go v0.6.0 // indirect + github.com/quic-go/quic-go v0.43.1 // indirect + github.com/quic-go/webtransport-go v0.8.0 // indirect github.com/raulk/go-watchdog v1.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/stretchr/testify v1.8.4 // indirect diff --git a/test-plans/go.sum b/test-plans/go.sum index c31561ebc8..aa3b4788ad 100644 --- a/test-plans/go.sum +++ b/test-plans/go.sum @@ -309,10 +309,10 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/quic-go v0.42.0 h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM= -github.com/quic-go/quic-go v0.42.0/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M= -github.com/quic-go/webtransport-go v0.6.0 h1:CvNsKqc4W2HljHJnoT+rMmbRJybShZ0YPFDD3NxaZLY= -github.com/quic-go/webtransport-go v0.6.0/go.mod h1:9KjU4AEBqEQidGHNDkZrb8CAa1abRaosM2yGOyiikEc= +github.com/quic-go/quic-go v0.43.1 h1:fLiMNfQVe9q2JvSsiXo4fXOEguXHGGl9+6gLp4RPeZQ= +github.com/quic-go/quic-go v0.43.1/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M= +github.com/quic-go/webtransport-go v0.8.0 h1:HxSrwun11U+LlmwpgM1kEqIqH90IT4N8auv/cD7QFJg= +github.com/quic-go/webtransport-go v0.8.0/go.mod h1:N99tjprW432Ut5ONql/aUhSLT0YVSlwHohQsuac9WaM= github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=