From 5fe9f9bd8943fbbfd797880ce99706d3ad82678b Mon Sep 17 00:00:00 2001 From: Toby Date: Sun, 6 Nov 2022 10:59:16 -0800 Subject: [PATCH] chore: fix multiple typos in comments (#3612) * chore: fix multiple typos I run into * Update conn_id_generator_test.go Co-authored-by: Marten Seemann * Update internal/ackhandler/sent_packet_handler_test.go Co-authored-by: Marten Seemann Co-authored-by: Marten Seemann --- conn_id_generator_test.go | 2 +- connection.go | 2 +- internal/ackhandler/sent_packet_handler_test.go | 2 +- internal/flowcontrol/base_flow_controller.go | 2 +- send_stream.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/conn_id_generator_test.go b/conn_id_generator_test.go index 48416ef880b..f1b43b24a1d 100644 --- a/conn_id_generator_test.go +++ b/conn_id_generator_test.go @@ -75,7 +75,7 @@ var _ = Describe("Connection ID Generator", func() { Expect(queuedFrames).To(HaveLen(protocol.MaxIssuedConnectionIDs - 1)) }) - // SetMaxActiveConnIDs is called twice when we dialing a 0-RTT connection: + // SetMaxActiveConnIDs is called twice when dialing a 0-RTT connection: // once for the restored from the old connections, once when we receive the transport parameters Context("dealing with 0-RTT", func() { It("doesn't issue new connection IDs when SetMaxActiveConnIDs is called with the same value", func() { diff --git a/connection.go b/connection.go index 56d5f8424ef..c761080bd17 100644 --- a/connection.go +++ b/connection.go @@ -1217,7 +1217,7 @@ func (s *connection) handleUnpackedPacket( // We create the connection as soon as we receive the first packet from the client. // We do that before authenticating the packet. // That means that if the source connection ID was corrupted, - // we might have create a connection with an incorrect source connection ID. + // we might have created a connection with an incorrect source connection ID. // Once we authenticate the first packet, we need to update it. if s.perspective == protocol.PerspectiveServer { if packet.hdr.SrcConnectionID != s.handshakeDestConnID { diff --git a/internal/ackhandler/sent_packet_handler_test.go b/internal/ackhandler/sent_packet_handler_test.go index c39b50f48df..8a7641c2d6d 100644 --- a/internal/ackhandler/sent_packet_handler_test.go +++ b/internal/ackhandler/sent_packet_handler_test.go @@ -190,7 +190,7 @@ var _ = Describe("SentPacketHandler", func() { Expect(err).ToNot(HaveOccurred()) Expect(handler.appDataPackets.largestAcked).To(Equal(protocol.PacketNumber(3))) // this wouldn't happen in practice - // for testing purposes, we pretend send a different ACK frame in a duplicated packet, to be able to verify that it actually doesn't get processed + // for testing purposes, we pretend to send a different ACK frame in a duplicated packet, to be able to verify that it actually doesn't get processed _, err = handler.ReceivedAck(ack2, protocol.Encryption1RTT, time.Now()) Expect(err).ToNot(HaveOccurred()) Expect(handler.appDataPackets.largestAcked).To(Equal(protocol.PacketNumber(4))) diff --git a/internal/flowcontrol/base_flow_controller.go b/internal/flowcontrol/base_flow_controller.go index 675b7e4d87d..a58af2d9b4b 100644 --- a/internal/flowcontrol/base_flow_controller.go +++ b/internal/flowcontrol/base_flow_controller.go @@ -47,7 +47,7 @@ func (c *baseFlowController) AddBytesSent(n protocol.ByteCount) { c.bytesSent += n } -// UpdateSendWindow is be called after receiving a MAX_{STREAM_}DATA frame. +// UpdateSendWindow is called after receiving a MAX_{STREAM_}DATA frame. func (c *baseFlowController) UpdateSendWindow(offset protocol.ByteCount) { if offset > c.sendWindow { c.sendWindow = offset diff --git a/send_stream.go b/send_stream.go index 3daf6781391..66807927610 100644 --- a/send_stream.go +++ b/send_stream.go @@ -122,7 +122,7 @@ func (s *sendStream) Write(p []byte) (int, error) { var copied bool var deadline time.Time // As soon as dataForWriting becomes smaller than a certain size x, we copy all the data to a STREAM frame (s.nextFrame), - // which can the be popped the next time we assemble a packet. + // which can then be popped the next time we assemble a packet. // This allows us to return Write() when all data but x bytes have been sent out. // When the user now calls Close(), this is much more likely to happen before we popped that last STREAM frame, // allowing us to set the FIN bit on that frame (instead of sending an empty STREAM frame with FIN).