forked from quic-go/quic-go
distinguish coalesced and 1-RTT packets when determining ECN mode
This commit is contained in:
@@ -29,8 +29,7 @@ type SentPacketHandler interface {
|
||||
// only to be called once the handshake is complete
|
||||
QueueProbePacket(protocol.EncryptionLevel) bool /* was a packet queued */
|
||||
|
||||
ECNMode() protocol.ECN
|
||||
|
||||
ECNMode(isShortHeaderPacket bool) protocol.ECN // isShortHeaderPacket should only be true for non-coalesced 1-RTT packets
|
||||
PeekPacketNumber(protocol.EncryptionLevel) (protocol.PacketNumber, protocol.PacketNumberLen)
|
||||
PopPacketNumber(protocol.EncryptionLevel) protocol.PacketNumber
|
||||
|
||||
|
||||
@@ -717,10 +717,13 @@ func (h *sentPacketHandler) GetLossDetectionTimeout() time.Time {
|
||||
return h.alarm
|
||||
}
|
||||
|
||||
func (h *sentPacketHandler) ECNMode() protocol.ECN {
|
||||
func (h *sentPacketHandler) ECNMode(isShortHeaderPacket bool) protocol.ECN {
|
||||
if !h.enableECN {
|
||||
return protocol.ECNUnsupported
|
||||
}
|
||||
if !isShortHeaderPacket {
|
||||
return protocol.ECNNon
|
||||
}
|
||||
// TODO: implement ECN logic
|
||||
return protocol.ECNNon
|
||||
}
|
||||
|
||||
@@ -50,17 +50,17 @@ func (mr *MockSentPacketHandlerMockRecorder) DropPackets(arg0 interface{}) *gomo
|
||||
}
|
||||
|
||||
// ECNMode mocks base method.
|
||||
func (m *MockSentPacketHandler) ECNMode() protocol.ECN {
|
||||
func (m *MockSentPacketHandler) ECNMode(arg0 bool) protocol.ECN {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ECNMode")
|
||||
ret := m.ctrl.Call(m, "ECNMode", arg0)
|
||||
ret0, _ := ret[0].(protocol.ECN)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// ECNMode indicates an expected call of ECNMode.
|
||||
func (mr *MockSentPacketHandlerMockRecorder) ECNMode() *gomock.Call {
|
||||
func (mr *MockSentPacketHandlerMockRecorder) ECNMode(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ECNMode", reflect.TypeOf((*MockSentPacketHandler)(nil).ECNMode))
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ECNMode", reflect.TypeOf((*MockSentPacketHandler)(nil).ECNMode), arg0)
|
||||
}
|
||||
|
||||
// GetLossDetectionTimeout mocks base method.
|
||||
|
||||
Reference in New Issue
Block a user