Skip to content

Commit 46a95a8

Browse files
committed
Update quic-go and webtransport-go
1 parent 735edd1 commit 46a95a8

File tree

12 files changed

+47
-93
lines changed

12 files changed

+47
-93
lines changed

connection.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type Stream interface {
5252
SendStream
5353
}
5454

55-
// A Stream is the interface implemented by the receiving end of unidirectional
55+
// ReceiveStream is the interface implemented by the receiving end of unidirectional
5656
// streams.
5757
type ReceiveStream interface {
5858
// Read reads from the stream.
@@ -66,7 +66,7 @@ type ReceiveStream interface {
6666
StreamID() uint64
6767
}
6868

69-
// A Stream is the interface implemented by the sending end of unidirectional
69+
// SendStream is the interface implemented by the sending end of unidirectional
7070
// streams.
7171
type SendStream interface {
7272
// Write writes to the stream.

go.mod

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ go 1.23.6
44

55
require (
66
github.com/mengelbart/qlog v0.1.0
7-
github.com/quic-go/quic-go v0.49.0
8-
github.com/quic-go/webtransport-go v0.8.1-0.20241018022711-4ac2c9250e66
7+
github.com/quic-go/quic-go v0.53.0
8+
github.com/quic-go/webtransport-go v0.9.0
99
github.com/stretchr/testify v1.10.0
1010
go.uber.org/goleak v1.3.0
1111
go.uber.org/mock v0.5.0
@@ -14,14 +14,10 @@ require (
1414

1515
require (
1616
github.com/davecgh/go-spew v1.1.1 // indirect
17-
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
18-
github.com/google/pprof v0.0.0-20250128161936-077ca0a936bf // indirect
1917
github.com/kr/text v0.2.0 // indirect
20-
github.com/onsi/ginkgo/v2 v2.22.2 // indirect
2118
github.com/pmezard/go-difflib v1.0.0 // indirect
2219
github.com/quic-go/qpack v0.5.1 // indirect
2320
golang.org/x/crypto v0.36.0 // indirect
24-
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect
2521
golang.org/x/mod v0.22.0 // indirect
2622
golang.org/x/net v0.38.0 // indirect
2723
golang.org/x/sys v0.31.0 // indirect

go.sum

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,22 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
33
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
44
github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk=
55
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
6-
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
7-
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
8-
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
9-
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
106
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
117
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
12-
github.com/google/pprof v0.0.0-20250128161936-077ca0a936bf h1:BvBLUD2hkvLI3dJTJMiopAq8/wp43AAZKTP7qdpptbU=
13-
github.com/google/pprof v0.0.0-20250128161936-077ca0a936bf/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
148
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
159
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
1610
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
1711
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
1812
github.com/mengelbart/qlog v0.1.0 h1:8cDMuCMcKtzkPXUU5FF7OBwqKiy+De0GKvIvNawifoA=
1913
github.com/mengelbart/qlog v0.1.0/go.mod h1:nIlGcUugkfDu41B8LKdAwjHQ1NxAF54D9hS2EDOlVyk=
20-
github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU=
21-
github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk=
22-
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
23-
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
2414
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
2515
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
2616
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
2717
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
28-
github.com/quic-go/quic-go v0.49.0 h1:w5iJHXwHxs1QxyBv1EHKuC50GX5to8mJAxvtnttJp94=
29-
github.com/quic-go/quic-go v0.49.0/go.mod h1:s2wDnmCdooUQBmQfpUSTCYBl1/D4FcqbULMMkASvR6s=
30-
github.com/quic-go/webtransport-go v0.8.1-0.20241018022711-4ac2c9250e66 h1:4WFk6u3sOT6pLa1kQ50ZVdm8BQFgJNA117cepZxtLIg=
31-
github.com/quic-go/webtransport-go v0.8.1-0.20241018022711-4ac2c9250e66/go.mod h1:Vp72IJajgeOL6ddqrAhmp7IM9zbTcgkQxD/YdxrVwMw=
18+
github.com/quic-go/quic-go v0.53.0 h1:QHX46sISpG2S03dPeZBgVIZp8dGagIaiu2FiVYvpCZI=
19+
github.com/quic-go/quic-go v0.53.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=
20+
github.com/quic-go/webtransport-go v0.9.0 h1:jgys+7/wm6JarGDrW+lD/r9BGqBAmqY/ssklE09bA70=
21+
github.com/quic-go/webtransport-go v0.9.0/go.mod h1:4FUYIiUc75XSsF6HShcLeXXYZJ9AGwo/xh3L8M/P1ao=
3222
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
3323
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
3424
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
@@ -39,8 +29,6 @@ go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=
3929
go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
4030
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
4131
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
42-
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc=
43-
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU=
4432
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
4533
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
4634
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
@@ -51,12 +39,8 @@ golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
5139
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
5240
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
5341
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
54-
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
55-
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
5642
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
5743
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
58-
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
59-
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
6044
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
6145
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
6246
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

integrationtests/utils.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"github.com/stretchr/testify/assert"
2020
)
2121

22-
func connect(t *testing.T) (server, client quic.Connection, cancel func()) {
22+
func connect(t *testing.T) (server, client *quic.Conn, cancel func()) {
2323
tlsConfig, err := generateTLSConfig()
2424
assert.NoError(t, err)
2525
listener, err := quic.ListenAddr("localhost:0", tlsConfig, &quic.Config{
@@ -45,15 +45,15 @@ func connect(t *testing.T) (server, client quic.Connection, cancel func()) {
4545
}
4646
}
4747

48-
func setup(t *testing.T, sConn, cConn quic.Connection, handler moqtransport.Handler) (
48+
func setup(t *testing.T, sConn, cConn *quic.Conn, handler moqtransport.Handler) (
4949
serverSession *moqtransport.Session,
5050
clientSession *moqtransport.Session,
5151
cancel func(),
5252
) {
5353
return setupWithHandlers(t, sConn, cConn, handler, nil)
5454
}
5555

56-
func setupWithHandlers(t *testing.T, sConn, cConn quic.Connection, handler moqtransport.Handler, subscribeHandler moqtransport.SubscribeHandler) (
56+
func setupWithHandlers(t *testing.T, sConn, cConn *quic.Conn, handler moqtransport.Handler, subscribeHandler moqtransport.SubscribeHandler) (
5757
serverSession *moqtransport.Session,
5858
clientSession *moqtransport.Session,
5959
cancel func(),

quicmoq/connection.go

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ import (
88
)
99

1010
type connection struct {
11-
connection quic.Connection
11+
connection *quic.Conn
1212
perspective moqtransport.Perspective
1313
}
1414

15-
func NewServer(conn quic.Connection) moqtransport.Connection {
15+
func NewServer(conn *quic.Conn) moqtransport.Connection {
1616
return New(conn, moqtransport.PerspectiveServer)
1717
}
1818

19-
func NewClient(conn quic.Connection) moqtransport.Connection {
19+
func NewClient(conn *quic.Conn) moqtransport.Connection {
2020
return New(conn, moqtransport.PerspectiveClient)
2121
}
2222

23-
func New(conn quic.Connection, perspective moqtransport.Perspective) moqtransport.Connection {
23+
func New(conn *quic.Conn, perspective moqtransport.Perspective) moqtransport.Connection {
2424
return &connection{conn, perspective}
2525
}
2626

@@ -30,12 +30,7 @@ func (c *connection) AcceptStream(ctx context.Context) (moqtransport.Stream, err
3030
return nil, err
3131
}
3232
return &Stream{
33-
send: &SendStream{
34-
stream: s,
35-
},
36-
receive: &ReceiveStream{
37-
stream: s,
38-
},
33+
stream: s,
3934
}, nil
4035
}
4136

@@ -55,12 +50,7 @@ func (c *connection) OpenStream() (moqtransport.Stream, error) {
5550
return nil, err
5651
}
5752
return &Stream{
58-
send: &SendStream{
59-
stream: s,
60-
},
61-
receive: &ReceiveStream{
62-
stream: s,
63-
},
53+
stream: s,
6454
}, nil
6555
}
6656

@@ -70,12 +60,7 @@ func (c *connection) OpenStreamSync(ctx context.Context) (moqtransport.Stream, e
7060
return nil, err
7161
}
7262
return &Stream{
73-
send: &SendStream{
74-
stream: s,
75-
},
76-
receive: &ReceiveStream{
77-
stream: s,
78-
},
63+
stream: s,
7964
}, nil
8065
}
8166

quicmoq/receive_stream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
var _ moqtransport.ReceiveStream = (*ReceiveStream)(nil)
99

1010
type ReceiveStream struct {
11-
stream quic.ReceiveStream
11+
stream *quic.ReceiveStream
1212
}
1313

1414
// Read implements moqtransport.ReceiveStream.

quicmoq/send_stream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
var _ moqtransport.SendStream = (*SendStream)(nil)
99

1010
type SendStream struct {
11-
stream quic.SendStream
11+
stream *quic.SendStream
1212
}
1313

1414
// Write implements moqtransport.SendStream.

quicmoq/stream.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
11
package quicmoq
22

3-
import "github.com/mengelbart/moqtransport"
3+
import (
4+
"github.com/mengelbart/moqtransport"
5+
"github.com/quic-go/quic-go"
6+
)
47

58
var _ moqtransport.Stream = (*Stream)(nil)
69

710
type Stream struct {
8-
send *SendStream
9-
receive *ReceiveStream
11+
stream *quic.Stream
1012
}
1113

1214
// Read implements moqtransport.Stream.
1315
func (s *Stream) Read(p []byte) (n int, err error) {
14-
return s.receive.Read(p)
16+
return s.stream.Read(p)
1517
}
1618

1719
// Write implements moqtransport.Stream.
1820
func (s *Stream) Write(p []byte) (n int, err error) {
19-
return s.send.Write(p)
21+
return s.stream.Write(p)
2022
}
2123

2224
// Close implements moqtransport.Stream.
2325
func (s *Stream) Close() error {
24-
return s.send.Close()
26+
return s.stream.Close()
2527
}
2628

2729
// Reset implements moqtransport.Stream.
2830
func (s *Stream) Reset(code uint32) {
29-
s.send.Reset(code)
31+
s.stream.CancelWrite(quic.StreamErrorCode(code))
3032
}
3133

3234
// Stop implements moqtransport.Stream.
3335
func (s *Stream) Stop(code uint32) {
34-
s.receive.Stop(code)
36+
s.stream.CancelRead(quic.StreamErrorCode(code))
3537
}
3638

3739
// StreamID implements moqtransport.Stream.
3840
func (s *Stream) StreamID() uint64 {
39-
return s.send.StreamID()
41+
return uint64(s.stream.StreamID())
4042
}

webtransportmoq/connection.go

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@ func (c *webTransportConn) AcceptStream(ctx context.Context) (moqtransport.Strea
3030
return nil, err
3131
}
3232
return &Stream{
33-
send: &SendStream{
34-
stream: s,
35-
},
36-
receive: &ReceiveStream{
37-
stream: s,
38-
},
33+
stream: s,
3934
}, nil
4035
}
4136

@@ -55,12 +50,7 @@ func (c *webTransportConn) OpenStream() (moqtransport.Stream, error) {
5550
return nil, err
5651
}
5752
return &Stream{
58-
send: &SendStream{
59-
stream: s,
60-
},
61-
receive: &ReceiveStream{
62-
stream: s,
63-
},
53+
stream: s,
6454
}, nil
6555
}
6656

@@ -70,12 +60,7 @@ func (c *webTransportConn) OpenStreamSync(ctx context.Context) (moqtransport.Str
7060
return nil, err
7161
}
7262
return &Stream{
73-
send: &SendStream{
74-
stream: s,
75-
},
76-
receive: &ReceiveStream{
77-
stream: s,
78-
},
63+
stream: s,
7964
}, nil
8065
}
8166

webtransportmoq/receive_stream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
var _ moqtransport.ReceiveStream = (*ReceiveStream)(nil)
99

1010
type ReceiveStream struct {
11-
stream webtransport.ReceiveStream
11+
stream *webtransport.ReceiveStream
1212
}
1313

1414
// Read implements moqtransport.ReceiveStream.

0 commit comments

Comments
 (0)