-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
reliably queue MAX_DATA frames #4844
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4844 +/- ##
=======================================
Coverage 83.69% 83.69%
=======================================
Files 149 149
Lines 16078 16087 +9
=======================================
+ Hits 13456 13464 +8
- Misses 2091 2092 +1
Partials 531 531 ☔ View full report in Codecov by Sentry. |
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.
lgtm
@@ -205,9 +207,13 @@ func (s *receiveStream) readImpl(p []byte) (bool, int, error) { | |||
// when a RESET_STREAM was received, the flow controller was already | |||
// informed about the final byteOffset for this stream | |||
if !s.cancelledRemotely { | |||
if queueMaxStreamData := s.flowController.AddBytesRead(protocol.ByteCount(m)); queueMaxStreamData { | |||
hasStream, hasConn := s.flowController.AddBytesRead(protocol.ByteCount(m)) |
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.
nit: may as well assign these to your vars hasXWindowUpdate
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.
Depends on how the loop executes / returns. I think it should be fine, but I wanted to be very explicit about not setting value from true
back to false
.
We need to make sure that a MAX_DATA frame actually triggers the packing of a new packet (with which it can then be sent out). Otherwise, reading from a stream might get the MAX_DATA frame queued, but if no packet is sent, it's never sent out to the peer, potentially leading to a deadlock of the connection.