Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@deweerdt
Copy link
Member

Before this PR, H2O would send an empty body to the client, if upstream
sent chunked response headers but no response body. This fixes it by
checking that we've at least received one byte when deciding whether to
treat connection close as an error or not

Credit to @robguima for the finding and analysis

Before this PR, H2O would send an empty body to the client, if upstream
sent chunked response headers but no response body. This fixes it by
checking that we've at least received one byte when deciding whether to
treat connection close as an error or not

Credit to @robguima for the finding and analysis
Copy link
Member

@kazuho kazuho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. LGTM modulo a suggestion of an editorial refinement, please see below.

client->bytes_to_consume = 0;
client->sock->bytes_read = client->sock->input->size;
if (reader == on_req_chunked)
client->_seen_at_least_one_chunk = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to initialize _seen_at_least_one_chunk here?

It is my understanding that all the members of h2o_http1client_t (with the exception of super) is zero-cleared when initialized in setup_client.

Assuming that, I might prefer setting this here to avoid confusion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good call, we don't need the initialization here, fixing

@deweerdt
Copy link
Member Author

deweerdt commented Jul 3, 2019

@kazuho thank you for the review, i believe that d27178a addresses the comment you made

@kazuho kazuho merged commit 84a5df4 into h2o:master Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants