use 0.5-RTT data to open the control stream in the http3 server

This commit is contained in:
Marten Seemann 2020-01-25 18:53:35 +07:00
parent 2bac900862
commit bc25840519
7 changed files with 119 additions and 98 deletions

View file

@ -128,7 +128,7 @@ var _ = Describe("Client", func() {
It("errors if it can't open a stream", func() { It("errors if it can't open a stream", func() {
testErr := errors.New("stream open error") testErr := errors.New("stream open error")
client = newClient("localhost:1337", nil, &roundTripperOpts{}, nil, nil) client = newClient("localhost:1337", nil, &roundTripperOpts{}, nil, nil)
session := mockquic.NewMockSession(mockCtrl) session := mockquic.NewMockEarlySession(mockCtrl)
session.EXPECT().OpenUniStream().Return(nil, testErr).MaxTimes(1) session.EXPECT().OpenUniStream().Return(nil, testErr).MaxTimes(1)
session.EXPECT().OpenStreamSync(context.Background()).Return(nil, testErr).MaxTimes(1) session.EXPECT().OpenStreamSync(context.Background()).Return(nil, testErr).MaxTimes(1)
session.EXPECT().CloseWithError(gomock.Any(), gomock.Any()).MaxTimes(1) session.EXPECT().CloseWithError(gomock.Any(), gomock.Any()).MaxTimes(1)
@ -144,7 +144,7 @@ var _ = Describe("Client", func() {
var ( var (
request *http.Request request *http.Request
str *mockquic.MockStream str *mockquic.MockStream
sess *mockquic.MockSession sess *mockquic.MockEarlySession
) )
decodeHeader := func(str io.Reader) map[string]string { decodeHeader := func(str io.Reader) map[string]string {
@ -171,7 +171,7 @@ var _ = Describe("Client", func() {
controlStr.EXPECT().Write([]byte{0x0}).Return(1, nil).MaxTimes(1) controlStr.EXPECT().Write([]byte{0x0}).Return(1, nil).MaxTimes(1)
controlStr.EXPECT().Write(gomock.Any()).MaxTimes(1) // SETTINGS frame controlStr.EXPECT().Write(gomock.Any()).MaxTimes(1) // SETTINGS frame
str = mockquic.NewMockStream(mockCtrl) str = mockquic.NewMockStream(mockCtrl)
sess = mockquic.NewMockSession(mockCtrl) sess = mockquic.NewMockEarlySession(mockCtrl)
sess.EXPECT().OpenUniStream().Return(controlStr, nil).MaxTimes(1) sess.EXPECT().OpenUniStream().Return(controlStr, nil).MaxTimes(1)
dialAddr = func(hostname string, _ *tls.Config, _ *quic.Config) (quic.Session, error) { dialAddr = func(hostname string, _ *tls.Config, _ *quic.Config) (quic.Session, error) {
return sess, nil return sess, nil

View file

@ -60,7 +60,7 @@ var _ = Describe("RoundTripper", func() {
var ( var (
rt *RoundTripper rt *RoundTripper
req1 *http.Request req1 *http.Request
session *mockquic.MockSession session *mockquic.MockEarlySession
) )
BeforeEach(func() { BeforeEach(func() {
@ -74,7 +74,7 @@ var _ = Describe("RoundTripper", func() {
origDialAddr := dialAddr origDialAddr := dialAddr
BeforeEach(func() { BeforeEach(func() {
session = mockquic.NewMockSession(mockCtrl) session = mockquic.NewMockEarlySession(mockCtrl)
origDialAddr = dialAddr origDialAddr = dialAddr
dialAddr = func(addr string, tlsConf *tls.Config, config *quic.Config) (quic.Session, error) { dialAddr = func(addr string, tlsConf *tls.Config, config *quic.Config) (quic.Session, error) {
// return an error when trying to open a stream // return an error when trying to open a stream

View file

@ -22,8 +22,8 @@ import (
// allows mocking of quic.Listen and quic.ListenAddr // allows mocking of quic.Listen and quic.ListenAddr
var ( var (
quicListen = quic.Listen quicListen = quic.ListenEarly
quicListenAddr = quic.ListenAddr quicListenAddr = quic.ListenAddrEarly
) )
const nextProtoH3 = "h3-24" const nextProtoH3 = "h3-24"
@ -53,7 +53,7 @@ type Server struct {
port uint32 // used atomically port uint32 // used atomically
mutex sync.Mutex mutex sync.Mutex
listeners map[*quic.Listener]struct{} listeners map[*quic.EarlyListener]struct{}
closed utils.AtomicBool closed utils.AtomicBool
logger utils.Logger logger utils.Logger
@ -119,7 +119,7 @@ func (s *Server) serveImpl(tlsConf *tls.Config, conn net.PacketConn) error {
} }
} }
var ln quic.Listener var ln quic.EarlyListener
var err error var err error
if conn == nil { if conn == nil {
ln, err = quicListenAddr(s.Addr, tlsConf, s.QuicConfig) ln, err = quicListenAddr(s.Addr, tlsConf, s.QuicConfig)
@ -144,22 +144,22 @@ func (s *Server) serveImpl(tlsConf *tls.Config, conn net.PacketConn) error {
// We store a pointer to interface in the map set. This is safe because we only // We store a pointer to interface in the map set. This is safe because we only
// call trackListener via Serve and can track+defer untrack the same pointer to // call trackListener via Serve and can track+defer untrack the same pointer to
// local variable there. We never need to compare a Listener from another caller. // local variable there. We never need to compare a Listener from another caller.
func (s *Server) addListener(l *quic.Listener) { func (s *Server) addListener(l *quic.EarlyListener) {
s.mutex.Lock() s.mutex.Lock()
if s.listeners == nil { if s.listeners == nil {
s.listeners = make(map[*quic.Listener]struct{}) s.listeners = make(map[*quic.EarlyListener]struct{})
} }
s.listeners[l] = struct{}{} s.listeners[l] = struct{}{}
s.mutex.Unlock() s.mutex.Unlock()
} }
func (s *Server) removeListener(l *quic.Listener) { func (s *Server) removeListener(l *quic.EarlyListener) {
s.mutex.Lock() s.mutex.Lock()
delete(s.listeners, l) delete(s.listeners, l)
s.mutex.Unlock() s.mutex.Unlock()
} }
func (s *Server) handleConn(sess quic.Session) { func (s *Server) handleConn(sess quic.EarlySession) {
// TODO: accept control streams // TODO: accept control streams
decoder := qpack.NewDecoder(nil) decoder := qpack.NewDecoder(nil)
@ -173,6 +173,10 @@ func (s *Server) handleConn(sess quic.Session) {
(&settingsFrame{}).Write(buf) (&settingsFrame{}).Write(buf)
str.Write(buf.Bytes()) str.Write(buf.Bytes())
// Wait for completion of the handshake.
// TODO(#2311): allow 0-RTT requests.
<-sess.HandshakeComplete().Done()
for { for {
str, err := sess.AcceptStream(context.Background()) str, err := sess.AcceptStream(context.Background())
if err != nil { if err != nil {

View file

@ -46,7 +46,7 @@ var _ = Describe("Server", func() {
var ( var (
qpackDecoder *qpack.Decoder qpackDecoder *qpack.Decoder
str *mockquic.MockStream str *mockquic.MockStream
sess *mockquic.MockSession sess *mockquic.MockEarlySession
exampleGetRequest *http.Request exampleGetRequest *http.Request
examplePostRequest *http.Request examplePostRequest *http.Request
) )
@ -105,7 +105,7 @@ var _ = Describe("Server", func() {
qpackDecoder = qpack.NewDecoder(nil) qpackDecoder = qpack.NewDecoder(nil)
str = mockquic.NewMockStream(mockCtrl) str = mockquic.NewMockStream(mockCtrl)
sess = mockquic.NewMockSession(mockCtrl) sess = mockquic.NewMockEarlySession(mockCtrl)
addr := &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 1337} addr := &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 1337}
sess.EXPECT().RemoteAddr().Return(addr).AnyTimes() sess.EXPECT().RemoteAddr().Return(addr).AnyTimes()
}) })
@ -165,13 +165,16 @@ var _ = Describe("Server", func() {
}) })
Context("stream- and connection-level errors", func() { Context("stream- and connection-level errors", func() {
var sess *mockquic.MockSession var sess *mockquic.MockEarlySession
BeforeEach(func() { BeforeEach(func() {
addr := &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 1337} addr := &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 1337}
sess = mockquic.NewMockSession(mockCtrl) sess = mockquic.NewMockEarlySession(mockCtrl)
controlStr := mockquic.NewMockStream(mockCtrl) controlStr := mockquic.NewMockStream(mockCtrl)
controlStr.EXPECT().Write(gomock.Any()) controlStr.EXPECT().Write(gomock.Any())
ctx, cancel := context.WithCancel(context.Background())
cancel()
sess.EXPECT().HandshakeComplete().Return(ctx)
sess.EXPECT().OpenUniStream().Return(controlStr, nil) sess.EXPECT().OpenUniStream().Return(controlStr, nil)
sess.EXPECT().AcceptStream(gomock.Any()).Return(str, nil) sess.EXPECT().AcceptStream(gomock.Any()).Return(str, nil)
sess.EXPECT().AcceptStream(gomock.Any()).Return(nil, errors.New("done")) sess.EXPECT().AcceptStream(gomock.Any()).Return(nil, errors.New("done"))
@ -403,9 +406,9 @@ var _ = Describe("Server", func() {
}) })
It("serves a packet conn", func() { It("serves a packet conn", func() {
ln := mockquic.NewMockListener(mockCtrl) ln := mockquic.NewMockEarlyListener(mockCtrl)
conn := &net.UDPConn{} conn := &net.UDPConn{}
quicListen = func(c net.PacketConn, tlsConf *tls.Config, config *quic.Config) (quic.Listener, error) { quicListen = func(c net.PacketConn, tlsConf *tls.Config, config *quic.Config) (quic.EarlyListener, error) {
Expect(c).To(Equal(conn)) Expect(c).To(Equal(conn))
return ln, nil return ln, nil
} }
@ -432,13 +435,13 @@ var _ = Describe("Server", func() {
}) })
It("serves two packet conns", func() { It("serves two packet conns", func() {
ln1 := mockquic.NewMockListener(mockCtrl) ln1 := mockquic.NewMockEarlyListener(mockCtrl)
ln2 := mockquic.NewMockListener(mockCtrl) ln2 := mockquic.NewMockEarlyListener(mockCtrl)
lns := []quic.Listener{ln1, ln2} lns := []quic.EarlyListener{ln1, ln2}
conn1 := &net.UDPConn{} conn1 := &net.UDPConn{}
conn2 := &net.UDPConn{} conn2 := &net.UDPConn{}
conns := []net.PacketConn{conn1, conn2} conns := []net.PacketConn{conn1, conn2}
quicListen = func(c net.PacketConn, tlsConf *tls.Config, config *quic.Config) (quic.Listener, error) { quicListen = func(c net.PacketConn, tlsConf *tls.Config, config *quic.Config) (quic.EarlyListener, error) {
conn := conns[0] conn := conns[0]
conns = conns[1:] conns = conns[1:]
ln := lns[0] ln := lns[0]
@ -496,7 +499,7 @@ var _ = Describe("Server", func() {
It("uses the quic.Config to start the QUIC server", func() { It("uses the quic.Config to start the QUIC server", func() {
conf := &quic.Config{HandshakeTimeout: time.Nanosecond} conf := &quic.Config{HandshakeTimeout: time.Nanosecond}
var receivedConf *quic.Config var receivedConf *quic.Config
quicListenAddr = func(addr string, _ *tls.Config, config *quic.Config) (quic.Listener, error) { quicListenAddr = func(addr string, _ *tls.Config, config *quic.Config) (quic.EarlyListener, error) {
receivedConf = config receivedConf = config
return nil, errors.New("listen err") return nil, errors.New("listen err")
} }
@ -508,7 +511,7 @@ var _ = Describe("Server", func() {
It("replaces the ALPN token to the tls.Config", func() { It("replaces the ALPN token to the tls.Config", func() {
tlsConf := &tls.Config{NextProtos: []string{"foo", "bar"}} tlsConf := &tls.Config{NextProtos: []string{"foo", "bar"}}
var receivedConf *tls.Config var receivedConf *tls.Config
quicListenAddr = func(addr string, tlsConf *tls.Config, _ *quic.Config) (quic.Listener, error) { quicListenAddr = func(addr string, tlsConf *tls.Config, _ *quic.Config) (quic.EarlyListener, error) {
receivedConf = tlsConf receivedConf = tlsConf
return nil, errors.New("listen err") return nil, errors.New("listen err")
} }
@ -521,7 +524,7 @@ var _ = Describe("Server", func() {
It("uses the ALPN token if no tls.Config is given", func() { It("uses the ALPN token if no tls.Config is given", func() {
var receivedConf *tls.Config var receivedConf *tls.Config
quicListenAddr = func(addr string, tlsConf *tls.Config, _ *quic.Config) (quic.Listener, error) { quicListenAddr = func(addr string, tlsConf *tls.Config, _ *quic.Config) (quic.EarlyListener, error) {
receivedConf = tlsConf receivedConf = tlsConf
return nil, errors.New("listen err") return nil, errors.New("listen err")
} }
@ -537,7 +540,7 @@ var _ = Describe("Server", func() {
} }
var receivedConf *tls.Config var receivedConf *tls.Config
quicListenAddr = func(addr string, conf *tls.Config, _ *quic.Config) (quic.Listener, error) { quicListenAddr = func(addr string, conf *tls.Config, _ *quic.Config) (quic.EarlyListener, error) {
receivedConf = conf receivedConf = conf
return nil, errors.New("listen err") return nil, errors.New("listen err")
} }
@ -562,7 +565,7 @@ var _ = Describe("Server", func() {
} }
var receivedConf *tls.Config var receivedConf *tls.Config
quicListenAddr = func(addr string, conf *tls.Config, _ *quic.Config) (quic.Listener, error) { quicListenAddr = func(addr string, conf *tls.Config, _ *quic.Config) (quic.EarlyListener, error) {
receivedConf = conf receivedConf = conf
return nil, errors.New("listen err") return nil, errors.New("listen err")
} }
@ -585,7 +588,7 @@ var _ = Describe("Server", func() {
It("errors when listening fails", func() { It("errors when listening fails", func() {
testErr := errors.New("listen error") testErr := errors.New("listen error")
quicListenAddr = func(addr string, tlsConf *tls.Config, config *quic.Config) (quic.Listener, error) { quicListenAddr = func(addr string, tlsConf *tls.Config, config *quic.Config) (quic.EarlyListener, error) {
return nil, testErr return nil, testErr
} }
fullpem, privkey := testdata.GetCertificatePaths() fullpem, privkey := testdata.GetCertificatePaths()

View file

@ -1,8 +1,8 @@
package mocks package mocks
//go:generate sh -c "mockgen -package mockquic -destination quic/stream.go github.com/lucas-clemente/quic-go Stream && goimports -w quic/stream.go" //go:generate sh -c "mockgen -package mockquic -destination quic/stream.go github.com/lucas-clemente/quic-go Stream && goimports -w quic/stream.go"
//go:generate sh -c "mockgen -package mockquic -destination quic/session.go github.com/lucas-clemente/quic-go Session && goimports -w quic/session.go" //go:generate sh -c "mockgen -package mockquic -destination quic/early_session.go github.com/lucas-clemente/quic-go EarlySession && goimports -w quic/early_session.go"
//go:generate sh -c "mockgen -package mockquic -destination quic/listener.go github.com/lucas-clemente/quic-go Listener && goimports -w quic/listener.go" //go:generate sh -c "mockgen -package mockquic -destination quic/early_listener.go github.com/lucas-clemente/quic-go EarlyListener && goimports -w quic/early_listener.go"
//go:generate sh -c "mockgen -package mocks -destination short_header_sealer.go github.com/lucas-clemente/quic-go/internal/handshake ShortHeaderSealer && goimports -w short_header_sealer.go" //go:generate sh -c "mockgen -package mocks -destination short_header_sealer.go github.com/lucas-clemente/quic-go/internal/handshake ShortHeaderSealer && goimports -w short_header_sealer.go"
//go:generate sh -c "mockgen -package mocks -destination short_header_opener.go github.com/lucas-clemente/quic-go/internal/handshake ShortHeaderOpener && goimports -w short_header_opener.go" //go:generate sh -c "mockgen -package mocks -destination short_header_opener.go github.com/lucas-clemente/quic-go/internal/handshake ShortHeaderOpener && goimports -w short_header_opener.go"
//go:generate sh -c "mockgen -package mocks -destination long_header_opener.go github.com/lucas-clemente/quic-go/internal/handshake LongHeaderOpener && goimports -w long_header_opener.go" //go:generate sh -c "mockgen -package mocks -destination long_header_opener.go github.com/lucas-clemente/quic-go/internal/handshake LongHeaderOpener && goimports -w long_header_opener.go"

View file

@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT. // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/lucas-clemente/quic-go (interfaces: Listener) // Source: github.com/lucas-clemente/quic-go (interfaces: EarlyListener)
// Package mockquic is a generated GoMock package. // Package mockquic is a generated GoMock package.
package mockquic package mockquic
@ -13,46 +13,46 @@ import (
quic "github.com/lucas-clemente/quic-go" quic "github.com/lucas-clemente/quic-go"
) )
// MockListener is a mock of Listener interface // MockEarlyListener is a mock of EarlyListener interface
type MockListener struct { type MockEarlyListener struct {
ctrl *gomock.Controller ctrl *gomock.Controller
recorder *MockListenerMockRecorder recorder *MockEarlyListenerMockRecorder
} }
// MockListenerMockRecorder is the mock recorder for MockListener // MockEarlyListenerMockRecorder is the mock recorder for MockEarlyListener
type MockListenerMockRecorder struct { type MockEarlyListenerMockRecorder struct {
mock *MockListener mock *MockEarlyListener
} }
// NewMockListener creates a new mock instance // NewMockEarlyListener creates a new mock instance
func NewMockListener(ctrl *gomock.Controller) *MockListener { func NewMockEarlyListener(ctrl *gomock.Controller) *MockEarlyListener {
mock := &MockListener{ctrl: ctrl} mock := &MockEarlyListener{ctrl: ctrl}
mock.recorder = &MockListenerMockRecorder{mock} mock.recorder = &MockEarlyListenerMockRecorder{mock}
return mock return mock
} }
// EXPECT returns an object that allows the caller to indicate expected use // EXPECT returns an object that allows the caller to indicate expected use
func (m *MockListener) EXPECT() *MockListenerMockRecorder { func (m *MockEarlyListener) EXPECT() *MockEarlyListenerMockRecorder {
return m.recorder return m.recorder
} }
// Accept mocks base method // Accept mocks base method
func (m *MockListener) Accept(arg0 context.Context) (quic.Session, error) { func (m *MockEarlyListener) Accept(arg0 context.Context) (quic.EarlySession, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Accept", arg0) ret := m.ctrl.Call(m, "Accept", arg0)
ret0, _ := ret[0].(quic.Session) ret0, _ := ret[0].(quic.EarlySession)
ret1, _ := ret[1].(error) ret1, _ := ret[1].(error)
return ret0, ret1 return ret0, ret1
} }
// Accept indicates an expected call of Accept // Accept indicates an expected call of Accept
func (mr *MockListenerMockRecorder) Accept(arg0 interface{}) *gomock.Call { func (mr *MockEarlyListenerMockRecorder) Accept(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Accept", reflect.TypeOf((*MockListener)(nil).Accept), arg0) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Accept", reflect.TypeOf((*MockEarlyListener)(nil).Accept), arg0)
} }
// Addr mocks base method // Addr mocks base method
func (m *MockListener) Addr() net.Addr { func (m *MockEarlyListener) Addr() net.Addr {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Addr") ret := m.ctrl.Call(m, "Addr")
ret0, _ := ret[0].(net.Addr) ret0, _ := ret[0].(net.Addr)
@ -60,13 +60,13 @@ func (m *MockListener) Addr() net.Addr {
} }
// Addr indicates an expected call of Addr // Addr indicates an expected call of Addr
func (mr *MockListenerMockRecorder) Addr() *gomock.Call { func (mr *MockEarlyListenerMockRecorder) Addr() *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Addr", reflect.TypeOf((*MockListener)(nil).Addr)) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Addr", reflect.TypeOf((*MockEarlyListener)(nil).Addr))
} }
// Close mocks base method // Close mocks base method
func (m *MockListener) Close() error { func (m *MockEarlyListener) Close() error {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Close") ret := m.ctrl.Call(m, "Close")
ret0, _ := ret[0].(error) ret0, _ := ret[0].(error)
@ -74,7 +74,7 @@ func (m *MockListener) Close() error {
} }
// Close indicates an expected call of Close // Close indicates an expected call of Close
func (mr *MockListenerMockRecorder) Close() *gomock.Call { func (mr *MockEarlyListenerMockRecorder) Close() *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockListener)(nil).Close)) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockEarlyListener)(nil).Close))
} }

View file

@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT. // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/lucas-clemente/quic-go (interfaces: Session) // Source: github.com/lucas-clemente/quic-go (interfaces: EarlySession)
// Package mockquic is a generated GoMock package. // Package mockquic is a generated GoMock package.
package mockquic package mockquic
@ -15,31 +15,31 @@ import (
protocol "github.com/lucas-clemente/quic-go/internal/protocol" protocol "github.com/lucas-clemente/quic-go/internal/protocol"
) )
// MockSession is a mock of Session interface // MockEarlySession is a mock of EarlySession interface
type MockSession struct { type MockEarlySession struct {
ctrl *gomock.Controller ctrl *gomock.Controller
recorder *MockSessionMockRecorder recorder *MockEarlySessionMockRecorder
} }
// MockSessionMockRecorder is the mock recorder for MockSession // MockEarlySessionMockRecorder is the mock recorder for MockEarlySession
type MockSessionMockRecorder struct { type MockEarlySessionMockRecorder struct {
mock *MockSession mock *MockEarlySession
} }
// NewMockSession creates a new mock instance // NewMockEarlySession creates a new mock instance
func NewMockSession(ctrl *gomock.Controller) *MockSession { func NewMockEarlySession(ctrl *gomock.Controller) *MockEarlySession {
mock := &MockSession{ctrl: ctrl} mock := &MockEarlySession{ctrl: ctrl}
mock.recorder = &MockSessionMockRecorder{mock} mock.recorder = &MockEarlySessionMockRecorder{mock}
return mock return mock
} }
// EXPECT returns an object that allows the caller to indicate expected use // EXPECT returns an object that allows the caller to indicate expected use
func (m *MockSession) EXPECT() *MockSessionMockRecorder { func (m *MockEarlySession) EXPECT() *MockEarlySessionMockRecorder {
return m.recorder return m.recorder
} }
// AcceptStream mocks base method // AcceptStream mocks base method
func (m *MockSession) AcceptStream(arg0 context.Context) (quic.Stream, error) { func (m *MockEarlySession) AcceptStream(arg0 context.Context) (quic.Stream, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AcceptStream", arg0) ret := m.ctrl.Call(m, "AcceptStream", arg0)
ret0, _ := ret[0].(quic.Stream) ret0, _ := ret[0].(quic.Stream)
@ -48,13 +48,13 @@ func (m *MockSession) AcceptStream(arg0 context.Context) (quic.Stream, error) {
} }
// AcceptStream indicates an expected call of AcceptStream // AcceptStream indicates an expected call of AcceptStream
func (mr *MockSessionMockRecorder) AcceptStream(arg0 interface{}) *gomock.Call { func (mr *MockEarlySessionMockRecorder) AcceptStream(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcceptStream", reflect.TypeOf((*MockSession)(nil).AcceptStream), arg0) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcceptStream", reflect.TypeOf((*MockEarlySession)(nil).AcceptStream), arg0)
} }
// AcceptUniStream mocks base method // AcceptUniStream mocks base method
func (m *MockSession) AcceptUniStream(arg0 context.Context) (quic.ReceiveStream, error) { func (m *MockEarlySession) AcceptUniStream(arg0 context.Context) (quic.ReceiveStream, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AcceptUniStream", arg0) ret := m.ctrl.Call(m, "AcceptUniStream", arg0)
ret0, _ := ret[0].(quic.ReceiveStream) ret0, _ := ret[0].(quic.ReceiveStream)
@ -63,13 +63,13 @@ func (m *MockSession) AcceptUniStream(arg0 context.Context) (quic.ReceiveStream,
} }
// AcceptUniStream indicates an expected call of AcceptUniStream // AcceptUniStream indicates an expected call of AcceptUniStream
func (mr *MockSessionMockRecorder) AcceptUniStream(arg0 interface{}) *gomock.Call { func (mr *MockEarlySessionMockRecorder) AcceptUniStream(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcceptUniStream", reflect.TypeOf((*MockSession)(nil).AcceptUniStream), arg0) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcceptUniStream", reflect.TypeOf((*MockEarlySession)(nil).AcceptUniStream), arg0)
} }
// CloseWithError mocks base method // CloseWithError mocks base method
func (m *MockSession) CloseWithError(arg0 protocol.ApplicationErrorCode, arg1 string) error { func (m *MockEarlySession) CloseWithError(arg0 protocol.ApplicationErrorCode, arg1 string) error {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseWithError", arg0, arg1) ret := m.ctrl.Call(m, "CloseWithError", arg0, arg1)
ret0, _ := ret[0].(error) ret0, _ := ret[0].(error)
@ -77,13 +77,13 @@ func (m *MockSession) CloseWithError(arg0 protocol.ApplicationErrorCode, arg1 st
} }
// CloseWithError indicates an expected call of CloseWithError // CloseWithError indicates an expected call of CloseWithError
func (mr *MockSessionMockRecorder) CloseWithError(arg0, arg1 interface{}) *gomock.Call { func (mr *MockEarlySessionMockRecorder) CloseWithError(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseWithError", reflect.TypeOf((*MockSession)(nil).CloseWithError), arg0, arg1) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseWithError", reflect.TypeOf((*MockEarlySession)(nil).CloseWithError), arg0, arg1)
} }
// ConnectionState mocks base method // ConnectionState mocks base method
func (m *MockSession) ConnectionState() tls.ConnectionState { func (m *MockEarlySession) ConnectionState() tls.ConnectionState {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ConnectionState") ret := m.ctrl.Call(m, "ConnectionState")
ret0, _ := ret[0].(tls.ConnectionState) ret0, _ := ret[0].(tls.ConnectionState)
@ -91,13 +91,13 @@ func (m *MockSession) ConnectionState() tls.ConnectionState {
} }
// ConnectionState indicates an expected call of ConnectionState // ConnectionState indicates an expected call of ConnectionState
func (mr *MockSessionMockRecorder) ConnectionState() *gomock.Call { func (mr *MockEarlySessionMockRecorder) ConnectionState() *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectionState", reflect.TypeOf((*MockSession)(nil).ConnectionState)) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectionState", reflect.TypeOf((*MockEarlySession)(nil).ConnectionState))
} }
// Context mocks base method // Context mocks base method
func (m *MockSession) Context() context.Context { func (m *MockEarlySession) Context() context.Context {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context") ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context) ret0, _ := ret[0].(context.Context)
@ -105,13 +105,27 @@ func (m *MockSession) Context() context.Context {
} }
// Context indicates an expected call of Context // Context indicates an expected call of Context
func (mr *MockSessionMockRecorder) Context() *gomock.Call { func (mr *MockEarlySessionMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockSession)(nil).Context)) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockEarlySession)(nil).Context))
}
// HandshakeComplete mocks base method
func (m *MockEarlySession) HandshakeComplete() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "HandshakeComplete")
ret0, _ := ret[0].(context.Context)
return ret0
}
// HandshakeComplete indicates an expected call of HandshakeComplete
func (mr *MockEarlySessionMockRecorder) HandshakeComplete() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandshakeComplete", reflect.TypeOf((*MockEarlySession)(nil).HandshakeComplete))
} }
// LocalAddr mocks base method // LocalAddr mocks base method
func (m *MockSession) LocalAddr() net.Addr { func (m *MockEarlySession) LocalAddr() net.Addr {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LocalAddr") ret := m.ctrl.Call(m, "LocalAddr")
ret0, _ := ret[0].(net.Addr) ret0, _ := ret[0].(net.Addr)
@ -119,13 +133,13 @@ func (m *MockSession) LocalAddr() net.Addr {
} }
// LocalAddr indicates an expected call of LocalAddr // LocalAddr indicates an expected call of LocalAddr
func (mr *MockSessionMockRecorder) LocalAddr() *gomock.Call { func (mr *MockEarlySessionMockRecorder) LocalAddr() *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocalAddr", reflect.TypeOf((*MockSession)(nil).LocalAddr)) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocalAddr", reflect.TypeOf((*MockEarlySession)(nil).LocalAddr))
} }
// OpenStream mocks base method // OpenStream mocks base method
func (m *MockSession) OpenStream() (quic.Stream, error) { func (m *MockEarlySession) OpenStream() (quic.Stream, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "OpenStream") ret := m.ctrl.Call(m, "OpenStream")
ret0, _ := ret[0].(quic.Stream) ret0, _ := ret[0].(quic.Stream)
@ -134,13 +148,13 @@ func (m *MockSession) OpenStream() (quic.Stream, error) {
} }
// OpenStream indicates an expected call of OpenStream // OpenStream indicates an expected call of OpenStream
func (mr *MockSessionMockRecorder) OpenStream() *gomock.Call { func (mr *MockEarlySessionMockRecorder) OpenStream() *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenStream", reflect.TypeOf((*MockSession)(nil).OpenStream)) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenStream", reflect.TypeOf((*MockEarlySession)(nil).OpenStream))
} }
// OpenStreamSync mocks base method // OpenStreamSync mocks base method
func (m *MockSession) OpenStreamSync(arg0 context.Context) (quic.Stream, error) { func (m *MockEarlySession) OpenStreamSync(arg0 context.Context) (quic.Stream, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "OpenStreamSync", arg0) ret := m.ctrl.Call(m, "OpenStreamSync", arg0)
ret0, _ := ret[0].(quic.Stream) ret0, _ := ret[0].(quic.Stream)
@ -149,13 +163,13 @@ func (m *MockSession) OpenStreamSync(arg0 context.Context) (quic.Stream, error)
} }
// OpenStreamSync indicates an expected call of OpenStreamSync // OpenStreamSync indicates an expected call of OpenStreamSync
func (mr *MockSessionMockRecorder) OpenStreamSync(arg0 interface{}) *gomock.Call { func (mr *MockEarlySessionMockRecorder) OpenStreamSync(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenStreamSync", reflect.TypeOf((*MockSession)(nil).OpenStreamSync), arg0) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenStreamSync", reflect.TypeOf((*MockEarlySession)(nil).OpenStreamSync), arg0)
} }
// OpenUniStream mocks base method // OpenUniStream mocks base method
func (m *MockSession) OpenUniStream() (quic.SendStream, error) { func (m *MockEarlySession) OpenUniStream() (quic.SendStream, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "OpenUniStream") ret := m.ctrl.Call(m, "OpenUniStream")
ret0, _ := ret[0].(quic.SendStream) ret0, _ := ret[0].(quic.SendStream)
@ -164,13 +178,13 @@ func (m *MockSession) OpenUniStream() (quic.SendStream, error) {
} }
// OpenUniStream indicates an expected call of OpenUniStream // OpenUniStream indicates an expected call of OpenUniStream
func (mr *MockSessionMockRecorder) OpenUniStream() *gomock.Call { func (mr *MockEarlySessionMockRecorder) OpenUniStream() *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenUniStream", reflect.TypeOf((*MockSession)(nil).OpenUniStream)) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenUniStream", reflect.TypeOf((*MockEarlySession)(nil).OpenUniStream))
} }
// OpenUniStreamSync mocks base method // OpenUniStreamSync mocks base method
func (m *MockSession) OpenUniStreamSync(arg0 context.Context) (quic.SendStream, error) { func (m *MockEarlySession) OpenUniStreamSync(arg0 context.Context) (quic.SendStream, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "OpenUniStreamSync", arg0) ret := m.ctrl.Call(m, "OpenUniStreamSync", arg0)
ret0, _ := ret[0].(quic.SendStream) ret0, _ := ret[0].(quic.SendStream)
@ -179,13 +193,13 @@ func (m *MockSession) OpenUniStreamSync(arg0 context.Context) (quic.SendStream,
} }
// OpenUniStreamSync indicates an expected call of OpenUniStreamSync // OpenUniStreamSync indicates an expected call of OpenUniStreamSync
func (mr *MockSessionMockRecorder) OpenUniStreamSync(arg0 interface{}) *gomock.Call { func (mr *MockEarlySessionMockRecorder) OpenUniStreamSync(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenUniStreamSync", reflect.TypeOf((*MockSession)(nil).OpenUniStreamSync), arg0) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenUniStreamSync", reflect.TypeOf((*MockEarlySession)(nil).OpenUniStreamSync), arg0)
} }
// RemoteAddr mocks base method // RemoteAddr mocks base method
func (m *MockSession) RemoteAddr() net.Addr { func (m *MockEarlySession) RemoteAddr() net.Addr {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RemoteAddr") ret := m.ctrl.Call(m, "RemoteAddr")
ret0, _ := ret[0].(net.Addr) ret0, _ := ret[0].(net.Addr)
@ -193,7 +207,7 @@ func (m *MockSession) RemoteAddr() net.Addr {
} }
// RemoteAddr indicates an expected call of RemoteAddr // RemoteAddr indicates an expected call of RemoteAddr
func (mr *MockSessionMockRecorder) RemoteAddr() *gomock.Call { func (mr *MockEarlySessionMockRecorder) RemoteAddr() *gomock.Call {
mr.mock.ctrl.T.Helper() mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoteAddr", reflect.TypeOf((*MockSession)(nil).RemoteAddr)) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoteAddr", reflect.TypeOf((*MockEarlySession)(nil).RemoteAddr))
} }