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() {
testErr := errors.New("stream open error")
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().OpenStreamSync(context.Background()).Return(nil, testErr).MaxTimes(1)
session.EXPECT().CloseWithError(gomock.Any(), gomock.Any()).MaxTimes(1)
@ -144,7 +144,7 @@ var _ = Describe("Client", func() {
var (
request *http.Request
str *mockquic.MockStream
sess *mockquic.MockSession
sess *mockquic.MockEarlySession
)
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(gomock.Any()).MaxTimes(1) // SETTINGS frame
str = mockquic.NewMockStream(mockCtrl)
sess = mockquic.NewMockSession(mockCtrl)
sess = mockquic.NewMockEarlySession(mockCtrl)
sess.EXPECT().OpenUniStream().Return(controlStr, nil).MaxTimes(1)
dialAddr = func(hostname string, _ *tls.Config, _ *quic.Config) (quic.Session, error) {
return sess, nil

View file

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

View file

@ -22,8 +22,8 @@ import (
// allows mocking of quic.Listen and quic.ListenAddr
var (
quicListen = quic.Listen
quicListenAddr = quic.ListenAddr
quicListen = quic.ListenEarly
quicListenAddr = quic.ListenAddrEarly
)
const nextProtoH3 = "h3-24"
@ -53,7 +53,7 @@ type Server struct {
port uint32 // used atomically
mutex sync.Mutex
listeners map[*quic.Listener]struct{}
listeners map[*quic.EarlyListener]struct{}
closed utils.AtomicBool
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
if conn == nil {
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
// 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.
func (s *Server) addListener(l *quic.Listener) {
func (s *Server) addListener(l *quic.EarlyListener) {
s.mutex.Lock()
if s.listeners == nil {
s.listeners = make(map[*quic.Listener]struct{})
s.listeners = make(map[*quic.EarlyListener]struct{})
}
s.listeners[l] = struct{}{}
s.mutex.Unlock()
}
func (s *Server) removeListener(l *quic.Listener) {
func (s *Server) removeListener(l *quic.EarlyListener) {
s.mutex.Lock()
delete(s.listeners, l)
s.mutex.Unlock()
}
func (s *Server) handleConn(sess quic.Session) {
func (s *Server) handleConn(sess quic.EarlySession) {
// TODO: accept control streams
decoder := qpack.NewDecoder(nil)
@ -173,6 +173,10 @@ func (s *Server) handleConn(sess quic.Session) {
(&settingsFrame{}).Write(buf)
str.Write(buf.Bytes())
// Wait for completion of the handshake.
// TODO(#2311): allow 0-RTT requests.
<-sess.HandshakeComplete().Done()
for {
str, err := sess.AcceptStream(context.Background())
if err != nil {

View file

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

View file

@ -1,8 +1,8 @@
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/session.go github.com/lucas-clemente/quic-go Session && goimports -w quic/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_session.go github.com/lucas-clemente/quic-go EarlySession && goimports -w quic/early_session.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_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"

View file

@ -1,5 +1,5 @@
// 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
@ -13,46 +13,46 @@ import (
quic "github.com/lucas-clemente/quic-go"
)
// MockListener is a mock of Listener interface
type MockListener struct {
// MockEarlyListener is a mock of EarlyListener interface
type MockEarlyListener struct {
ctrl *gomock.Controller
recorder *MockListenerMockRecorder
recorder *MockEarlyListenerMockRecorder
}
// MockListenerMockRecorder is the mock recorder for MockListener
type MockListenerMockRecorder struct {
mock *MockListener
// MockEarlyListenerMockRecorder is the mock recorder for MockEarlyListener
type MockEarlyListenerMockRecorder struct {
mock *MockEarlyListener
}
// NewMockListener creates a new mock instance
func NewMockListener(ctrl *gomock.Controller) *MockListener {
mock := &MockListener{ctrl: ctrl}
mock.recorder = &MockListenerMockRecorder{mock}
// NewMockEarlyListener creates a new mock instance
func NewMockEarlyListener(ctrl *gomock.Controller) *MockEarlyListener {
mock := &MockEarlyListener{ctrl: ctrl}
mock.recorder = &MockEarlyListenerMockRecorder{mock}
return mock
}
// 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
}
// 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()
ret := m.ctrl.Call(m, "Accept", arg0)
ret0, _ := ret[0].(quic.Session)
ret0, _ := ret[0].(quic.EarlySession)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// 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()
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
func (m *MockListener) Addr() net.Addr {
func (m *MockEarlyListener) Addr() net.Addr {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Addr")
ret0, _ := ret[0].(net.Addr)
@ -60,13 +60,13 @@ func (m *MockListener) Addr() net.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()
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
func (m *MockListener) Close() error {
func (m *MockEarlyListener) Close() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Close")
ret0, _ := ret[0].(error)
@ -74,7 +74,7 @@ func (m *MockListener) Close() error {
}
// Close indicates an expected call of Close
func (mr *MockListenerMockRecorder) Close() *gomock.Call {
func (mr *MockEarlyListenerMockRecorder) Close() *gomock.Call {
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.
// 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
@ -15,31 +15,31 @@ import (
protocol "github.com/lucas-clemente/quic-go/internal/protocol"
)
// MockSession is a mock of Session interface
type MockSession struct {
// MockEarlySession is a mock of EarlySession interface
type MockEarlySession struct {
ctrl *gomock.Controller
recorder *MockSessionMockRecorder
recorder *MockEarlySessionMockRecorder
}
// MockSessionMockRecorder is the mock recorder for MockSession
type MockSessionMockRecorder struct {
mock *MockSession
// MockEarlySessionMockRecorder is the mock recorder for MockEarlySession
type MockEarlySessionMockRecorder struct {
mock *MockEarlySession
}
// NewMockSession creates a new mock instance
func NewMockSession(ctrl *gomock.Controller) *MockSession {
mock := &MockSession{ctrl: ctrl}
mock.recorder = &MockSessionMockRecorder{mock}
// NewMockEarlySession creates a new mock instance
func NewMockEarlySession(ctrl *gomock.Controller) *MockEarlySession {
mock := &MockEarlySession{ctrl: ctrl}
mock.recorder = &MockEarlySessionMockRecorder{mock}
return mock
}
// 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
}
// 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()
ret := m.ctrl.Call(m, "AcceptStream", arg0)
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
func (mr *MockSessionMockRecorder) AcceptStream(arg0 interface{}) *gomock.Call {
func (mr *MockEarlySessionMockRecorder) AcceptStream(arg0 interface{}) *gomock.Call {
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
func (m *MockSession) AcceptUniStream(arg0 context.Context) (quic.ReceiveStream, error) {
func (m *MockEarlySession) AcceptUniStream(arg0 context.Context) (quic.ReceiveStream, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AcceptUniStream", arg0)
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
func (mr *MockSessionMockRecorder) AcceptUniStream(arg0 interface{}) *gomock.Call {
func (mr *MockEarlySessionMockRecorder) AcceptUniStream(arg0 interface{}) *gomock.Call {
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
func (m *MockSession) CloseWithError(arg0 protocol.ApplicationErrorCode, arg1 string) error {
func (m *MockEarlySession) CloseWithError(arg0 protocol.ApplicationErrorCode, arg1 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseWithError", arg0, arg1)
ret0, _ := ret[0].(error)
@ -77,13 +77,13 @@ func (m *MockSession) CloseWithError(arg0 protocol.ApplicationErrorCode, arg1 st
}
// 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()
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
func (m *MockSession) ConnectionState() tls.ConnectionState {
func (m *MockEarlySession) ConnectionState() tls.ConnectionState {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ConnectionState")
ret0, _ := ret[0].(tls.ConnectionState)
@ -91,13 +91,13 @@ func (m *MockSession) ConnectionState() tls.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()
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
func (m *MockSession) Context() context.Context {
func (m *MockEarlySession) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
@ -105,13 +105,27 @@ func (m *MockSession) Context() context.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()
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
func (m *MockSession) LocalAddr() net.Addr {
func (m *MockEarlySession) LocalAddr() net.Addr {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LocalAddr")
ret0, _ := ret[0].(net.Addr)
@ -119,13 +133,13 @@ func (m *MockSession) LocalAddr() net.Addr {
}
// LocalAddr indicates an expected call of LocalAddr
func (mr *MockSessionMockRecorder) LocalAddr() *gomock.Call {
func (mr *MockEarlySessionMockRecorder) LocalAddr() *gomock.Call {
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
func (m *MockSession) OpenStream() (quic.Stream, error) {
func (m *MockEarlySession) OpenStream() (quic.Stream, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "OpenStream")
ret0, _ := ret[0].(quic.Stream)
@ -134,13 +148,13 @@ func (m *MockSession) OpenStream() (quic.Stream, error) {
}
// OpenStream indicates an expected call of OpenStream
func (mr *MockSessionMockRecorder) OpenStream() *gomock.Call {
func (mr *MockEarlySessionMockRecorder) OpenStream() *gomock.Call {
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
func (m *MockSession) OpenStreamSync(arg0 context.Context) (quic.Stream, error) {
func (m *MockEarlySession) OpenStreamSync(arg0 context.Context) (quic.Stream, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "OpenStreamSync", arg0)
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
func (mr *MockSessionMockRecorder) OpenStreamSync(arg0 interface{}) *gomock.Call {
func (mr *MockEarlySessionMockRecorder) OpenStreamSync(arg0 interface{}) *gomock.Call {
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
func (m *MockSession) OpenUniStream() (quic.SendStream, error) {
func (m *MockEarlySession) OpenUniStream() (quic.SendStream, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "OpenUniStream")
ret0, _ := ret[0].(quic.SendStream)
@ -164,13 +178,13 @@ func (m *MockSession) OpenUniStream() (quic.SendStream, error) {
}
// OpenUniStream indicates an expected call of OpenUniStream
func (mr *MockSessionMockRecorder) OpenUniStream() *gomock.Call {
func (mr *MockEarlySessionMockRecorder) OpenUniStream() *gomock.Call {
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
func (m *MockSession) OpenUniStreamSync(arg0 context.Context) (quic.SendStream, error) {
func (m *MockEarlySession) OpenUniStreamSync(arg0 context.Context) (quic.SendStream, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "OpenUniStreamSync", arg0)
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
func (mr *MockSessionMockRecorder) OpenUniStreamSync(arg0 interface{}) *gomock.Call {
func (mr *MockEarlySessionMockRecorder) OpenUniStreamSync(arg0 interface{}) *gomock.Call {
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
func (m *MockSession) RemoteAddr() net.Addr {
func (m *MockEarlySession) RemoteAddr() net.Addr {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RemoteAddr")
ret0, _ := ret[0].(net.Addr)
@ -193,7 +207,7 @@ func (m *MockSession) RemoteAddr() net.Addr {
}
// RemoteAddr indicates an expected call of RemoteAddr
func (mr *MockSessionMockRecorder) RemoteAddr() *gomock.Call {
func (mr *MockEarlySessionMockRecorder) RemoteAddr() *gomock.Call {
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))
}