New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#3851 ping frame added in handshake #3935
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to make this change in the packet packer instead of the connection.
Also please don't just modify random files that are unrelated to this PR.
packet_packer.go
Outdated
@@ -331,9 +331,14 @@ func (p *packetPacker) PackCoalescedPacket(onlyAck bool, maxPacketSize protocol. | |||
initialHdr, initialPayload = p.maybeGetCryptoPacket(maxPacketSize-protocol.ByteCount(initialSealer.Overhead()), protocol.EncryptionInitial, onlyAck, true, v) | |||
if initialPayload.length > 0 { | |||
size += p.longHeaderPacketLength(initialHdr, initialPayload, v) + protocol.ByteCount(initialSealer.Overhead()) | |||
|
|||
if size >= maxPacketSize-protocol.MinCoalescedPacketSize { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if doesn’t seem correct:
- You’re not allowed to add a PING if
ackOnly
is set. - You should only add a PING if there’s no other frames in the packet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should only add a PING if there’s no other frames in the packet.
is it a bug in our code ? because I confirmed this from rfc9000#section-17.2.2-8 which says
The payload of an Initial packet includes a CRYPTO frame (or frames) containing a cryptographic handshake message, ACK frames, or both. PING, PADDING, and CONNECTION_CLOSE frames of type 0x1c are also permitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you think it’s a bug? All these frames are permitted, but we’re only concerned with the situation where we only happen to have an ACK frame to send.
Ping Frame added when packet is nil and handShake is not confirmed yet.
Commenting this line took 108 seconds to complete all tests
With this line took 82 seconds to complete all tests