Pings and pongs arriving back to back stop at the deadline - #117
Merged
Merged
Conversation
receiveUntil consumed ping and pong frames and went on to the next frame without looking at the clock, and the deadline is otherwise noticed only when the socket runs dry. A relay sending control frames back to back held receiveTimeout past its deadline for as long as it kept going. The clock is now checked after every frame the caller never sees, through one helper that the unreadable-message path shares. Closes #116.
Carries the fix on this branch: a deadline holds while pings and pongs are arriving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #116.
receiveUntilconsumed ping and pong frames and went straight on to the next frame without looking at the clock, and the deadline given toreceiveTimeoutis otherwise noticed only when the socket runs dry. A relay sending control frames back to back held the call past its deadline for as long as it kept going. 0.14.3 added this check after a message the parser cannot read; control frames were left out.The clock is now checked after every frame the caller never sees, through one helper the unreadable-message path shares. Returning there still consumes nothing the caller would have seen, since a ping or pong carries no message.
Tests
pings and pongs arriving back to back still stop at the deadlinegives an already-passed deadline to a pong, then a ping, then a NOTICE. It expectserror.Timeoutafter each control frame, the ping answered, and the NOTICE on the next call. Removing the check after the ping, or after the pong, each fails it.All 212 tests pass.
Release
The last commit bumps the version to 0.14.5.