mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-06 05:37:36 +03:00
Merge pull request #3132 from lucas-clemente/amplification-limit-fixes
various amplification limit fixes
This commit is contained in:
commit
4b10e67bf1
4 changed files with 87 additions and 31 deletions
|
@ -2594,6 +2594,7 @@ var _ = Describe("Client Session", func() {
|
|||
It("closes and returns the right error", func() {
|
||||
sph := mockackhandler.NewMockSentPacketHandler(mockCtrl)
|
||||
sess.sentPacketHandler = sph
|
||||
sph.EXPECT().ReceivedBytes(gomock.Any())
|
||||
sph.EXPECT().PeekPacketNumber(protocol.EncryptionInitial).Return(protocol.PacketNumber(128), protocol.PacketNumberLen4)
|
||||
sess.config.Versions = []protocol.VersionNumber{1234, 4321}
|
||||
errChan := make(chan error, 1)
|
||||
|
@ -2692,6 +2693,7 @@ var _ = Describe("Client Session", func() {
|
|||
sph := mockackhandler.NewMockSentPacketHandler(mockCtrl)
|
||||
sess.sentPacketHandler = sph
|
||||
sph.EXPECT().ResetForRetry()
|
||||
sph.EXPECT().ReceivedBytes(gomock.Any())
|
||||
cryptoSetup.EXPECT().ChangeConnectionID(protocol.ConnectionID{0xde, 0xad, 0xbe, 0xef})
|
||||
packer.EXPECT().SetToken([]byte("foobar"))
|
||||
tracer.EXPECT().ReceivedRetry(gomock.Any()).Do(func(hdr *wire.Header) {
|
||||
|
@ -2981,6 +2983,7 @@ var _ = Describe("Client Session", func() {
|
|||
It("ignores Initial packets which use original source id, after accepting a Retry", func() {
|
||||
sph := mockackhandler.NewMockSentPacketHandler(mockCtrl)
|
||||
sess.sentPacketHandler = sph
|
||||
sph.EXPECT().ReceivedBytes(gomock.Any()).Times(2)
|
||||
sph.EXPECT().ResetForRetry()
|
||||
newSrcConnID := protocol.ConnectionID{0xde, 0xad, 0xbe, 0xef}
|
||||
cryptoSetup.EXPECT().ChangeConnectionID(newSrcConnID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue