mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
pass around receivedPacket as struct instead of as pointer (#3823)
This commit is contained in:
parent
591ab1ab5e
commit
072a602cc1
16 changed files with 96 additions and 94 deletions
|
@ -70,7 +70,7 @@ var _ = Describe("Transport", func() {
|
|||
handled := make(chan struct{}, 2)
|
||||
phm.EXPECT().Get(connID1).DoAndReturn(func(protocol.ConnectionID) (packetHandler, bool) {
|
||||
h := NewMockPacketHandler(mockCtrl)
|
||||
h.EXPECT().handlePacket(gomock.Any()).Do(func(p *receivedPacket) {
|
||||
h.EXPECT().handlePacket(gomock.Any()).Do(func(p receivedPacket) {
|
||||
defer GinkgoRecover()
|
||||
connID, err := wire.ParseConnectionID(p.data, 0)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
@ -81,7 +81,7 @@ var _ = Describe("Transport", func() {
|
|||
})
|
||||
phm.EXPECT().Get(connID2).DoAndReturn(func(protocol.ConnectionID) (packetHandler, bool) {
|
||||
h := NewMockPacketHandler(mockCtrl)
|
||||
h.EXPECT().handlePacket(gomock.Any()).Do(func(p *receivedPacket) {
|
||||
h.EXPECT().handlePacket(gomock.Any()).Do(func(p receivedPacket) {
|
||||
defer GinkgoRecover()
|
||||
connID, err := wire.ParseConnectionID(p.data, 0)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
@ -205,7 +205,7 @@ var _ = Describe("Transport", func() {
|
|||
gomock.InOrder(
|
||||
phm.EXPECT().GetByResetToken(token),
|
||||
phm.EXPECT().Get(connID).Return(conn, true),
|
||||
conn.EXPECT().handlePacket(gomock.Any()).Do(func(p *receivedPacket) {
|
||||
conn.EXPECT().handlePacket(gomock.Any()).Do(func(p receivedPacket) {
|
||||
Expect(p.data).To(Equal(b))
|
||||
Expect(p.rcvTime).To(BeTemporally("~", time.Now(), time.Second))
|
||||
}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue