-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(client): early server response shouldn't propagate NO_ERROR #3275
fix(client): early server response shouldn't propagate NO_ERROR #3275
Conversation
Closes hyperium#2872 Added test is failing against version without these changes.
Some(Err(e)) => { | ||
return match e.reason() { | ||
// These reasons should cause stop of body reading, but don't fail it. | ||
// The same logic as for `Read for H2Upgraded` is applied here. |
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'm referring to this line here:
Line 296 in a45d5d5
Some(Reason::NO_ERROR) | Some(Reason::CANCEL) => Ok(()), |
And it makes sense in terms of protocol behavior for the reasons.
Both of them call the same operation (self.recv_stream.poll_data(cx)
) and seems that logic should be the same. But we can make it more specific.
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.
Btw, an additional example from another lang & lib where it was also solved by avoiding error if response has been read: square/okhttp#6295
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.
Seems good to me given we already do something similar for streams upgraded from HTTP/2.
…rium#3275) Closes hyperium#2872 Signed-off-by: Sven Pfennig <[email protected]>
Closes #2872
Added test is failing against the current version (before this fix)
Backport for
0.14.x
: #3274