Files
quic-go/mock_mtu_discoverer_test.go
Marten Seemann 2557fb98b2 initialize the MTU discoverer when processing the transport parameters (#4514)
On the client side, we always use the configured packet size. This comes
with the risk of failing the handshake if the path doesn't support this
MTU. If the server sends a max_udp_payload_size that's smaller than this
size, we can safely ignore this: Obviously, the server still processed
the (fully padded) Initial packet, despite claiming that it wouldn't do
so.

On the server side, there's no downside to using 1200 bytes until we
received the client's transport parameters:
* If the first packet didn't contain the entire ClientHello, all we can
do is ACK that packet. We don't need a lot of bytes for that.
* If it did, we will have processed the transport parameters and
initialized the MTU discoverer.
2024-05-13 22:50:26 -07:00

194 lines
6.1 KiB
Go

// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/quic-go/quic-go (interfaces: MTUDiscoverer)
//
// Generated by this command:
//
// mockgen -typed -build_flags=-tags=gomock -package quic -self_package github.com/quic-go/quic-go -destination mock_mtu_discoverer_test.go github.com/quic-go/quic-go MTUDiscoverer
//
// Package quic is a generated GoMock package.
package quic
import (
reflect "reflect"
time "time"
ackhandler "github.com/quic-go/quic-go/internal/ackhandler"
protocol "github.com/quic-go/quic-go/internal/protocol"
gomock "go.uber.org/mock/gomock"
)
// MockMTUDiscoverer is a mock of MTUDiscoverer interface.
type MockMTUDiscoverer struct {
ctrl *gomock.Controller
recorder *MockMTUDiscovererMockRecorder
}
// MockMTUDiscovererMockRecorder is the mock recorder for MockMTUDiscoverer.
type MockMTUDiscovererMockRecorder struct {
mock *MockMTUDiscoverer
}
// NewMockMTUDiscoverer creates a new mock instance.
func NewMockMTUDiscoverer(ctrl *gomock.Controller) *MockMTUDiscoverer {
mock := &MockMTUDiscoverer{ctrl: ctrl}
mock.recorder = &MockMTUDiscovererMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockMTUDiscoverer) EXPECT() *MockMTUDiscovererMockRecorder {
return m.recorder
}
// CurrentSize mocks base method.
func (m *MockMTUDiscoverer) CurrentSize() protocol.ByteCount {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CurrentSize")
ret0, _ := ret[0].(protocol.ByteCount)
return ret0
}
// CurrentSize indicates an expected call of CurrentSize.
func (mr *MockMTUDiscovererMockRecorder) CurrentSize() *MockMTUDiscovererCurrentSizeCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentSize", reflect.TypeOf((*MockMTUDiscoverer)(nil).CurrentSize))
return &MockMTUDiscovererCurrentSizeCall{Call: call}
}
// MockMTUDiscovererCurrentSizeCall wrap *gomock.Call
type MockMTUDiscovererCurrentSizeCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockMTUDiscovererCurrentSizeCall) Return(arg0 protocol.ByteCount) *MockMTUDiscovererCurrentSizeCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockMTUDiscovererCurrentSizeCall) Do(f func() protocol.ByteCount) *MockMTUDiscovererCurrentSizeCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockMTUDiscovererCurrentSizeCall) DoAndReturn(f func() protocol.ByteCount) *MockMTUDiscovererCurrentSizeCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// GetPing mocks base method.
func (m *MockMTUDiscoverer) GetPing() (ackhandler.Frame, protocol.ByteCount) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetPing")
ret0, _ := ret[0].(ackhandler.Frame)
ret1, _ := ret[1].(protocol.ByteCount)
return ret0, ret1
}
// GetPing indicates an expected call of GetPing.
func (mr *MockMTUDiscovererMockRecorder) GetPing() *MockMTUDiscovererGetPingCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPing", reflect.TypeOf((*MockMTUDiscoverer)(nil).GetPing))
return &MockMTUDiscovererGetPingCall{Call: call}
}
// MockMTUDiscovererGetPingCall wrap *gomock.Call
type MockMTUDiscovererGetPingCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockMTUDiscovererGetPingCall) Return(arg0 ackhandler.Frame, arg1 protocol.ByteCount) *MockMTUDiscovererGetPingCall {
c.Call = c.Call.Return(arg0, arg1)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockMTUDiscovererGetPingCall) Do(f func() (ackhandler.Frame, protocol.ByteCount)) *MockMTUDiscovererGetPingCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockMTUDiscovererGetPingCall) DoAndReturn(f func() (ackhandler.Frame, protocol.ByteCount)) *MockMTUDiscovererGetPingCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// ShouldSendProbe mocks base method.
func (m *MockMTUDiscoverer) ShouldSendProbe(arg0 time.Time) bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ShouldSendProbe", arg0)
ret0, _ := ret[0].(bool)
return ret0
}
// ShouldSendProbe indicates an expected call of ShouldSendProbe.
func (mr *MockMTUDiscovererMockRecorder) ShouldSendProbe(arg0 any) *MockMTUDiscovererShouldSendProbeCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShouldSendProbe", reflect.TypeOf((*MockMTUDiscoverer)(nil).ShouldSendProbe), arg0)
return &MockMTUDiscovererShouldSendProbeCall{Call: call}
}
// MockMTUDiscovererShouldSendProbeCall wrap *gomock.Call
type MockMTUDiscovererShouldSendProbeCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockMTUDiscovererShouldSendProbeCall) Return(arg0 bool) *MockMTUDiscovererShouldSendProbeCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockMTUDiscovererShouldSendProbeCall) Do(f func(time.Time) bool) *MockMTUDiscovererShouldSendProbeCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockMTUDiscovererShouldSendProbeCall) DoAndReturn(f func(time.Time) bool) *MockMTUDiscovererShouldSendProbeCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// Start mocks base method.
func (m *MockMTUDiscoverer) Start() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Start")
}
// Start indicates an expected call of Start.
func (mr *MockMTUDiscovererMockRecorder) Start() *MockMTUDiscovererStartCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockMTUDiscoverer)(nil).Start))
return &MockMTUDiscovererStartCall{Call: call}
}
// MockMTUDiscovererStartCall wrap *gomock.Call
type MockMTUDiscovererStartCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockMTUDiscovererStartCall) Return() *MockMTUDiscovererStartCall {
c.Call = c.Call.Return()
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockMTUDiscovererStartCall) Do(f func()) *MockMTUDiscovererStartCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockMTUDiscovererStartCall) DoAndReturn(f func()) *MockMTUDiscovererStartCall {
c.Call = c.Call.DoAndReturn(f)
return c
}