Skip to content
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

Allow responses of HEAD requests to have empty DATA frames #490

Merged
merged 1 commit into from
Oct 22, 2020

Conversation

eaufavor
Copy link
Contributor

Per https://tools.ietf.org/html/rfc7540#section-8.1.2.6

A response that is defined to have no payload, as described in [RFC7230], Section 3.3.2, can have a non-zero content-length header field, even though no content is included in DATA frames.

Without this patch, h2 errors with recv_data: content-length overflow; stream=StreamId(1); len=0; when empty DATA frame is received.

@eaufavor eaufavor force-pushed the HEAD_zero_DATA branch 2 times, most recently from 91ba8ae to 7b07928 Compare October 12, 2020 23:32
@seanmonstar
Copy link
Member

Nice catch, thanks!

Do you think we could add a test to tests/client_request.rs so we don't regress this?

@eaufavor
Copy link
Contributor Author

Added a test.

@eaufavor
Copy link
Contributor Author

eaufavor commented Oct 13, 2020

The h2spec test might have some troubles in CI. It has been hanging for hours since my first commit.
Locally it passes quickly.

Finished in 0.3034 seconds
145 tests, 144 passed, 1 skipped, 0 failed
h2spec passed!

@seanmonstar
Copy link
Member

Hm, how weird! I can't even get it to show me the output so far, to try to understand what it is hanging on...

@eaufavor
Copy link
Contributor Author

It will be killed after hanging 6 hours.
https://github.com/hyperium/h2/runs/1249393890 You can see the log via the "Download log achieve"

2020-10-12T23:37:39.9002362Z   3100K .......... .......... ........                        100% 93.3M=0.07s
2020-10-12T23:37:39.9002599Z 
2020-10-12T23:37:39.9004454Z 2020-10-12 23:37:39 (41.9 MB/s) - ‘h2spec_linux_amd64.tar.gz’ saved [3203286/3203286]
2020-10-12T23:37:39.9004788Z 
2020-10-12T23:37:40.0703625Z     Finished dev [unoptimized + debuginfo] target(s) in 0.05s
2020-10-13T05:33:19.5875096Z ##[error]The operation was canceled.
2020-10-13T05:33:19.5902345Z Cleaning up orphan processes
2020-10-13T05:33:19.6077171Z Terminate orphan process: pid (12380) (h2spec.sh)
2020-10-13T05:33:19.6102023Z Terminate orphan process: pid (12472) (h2spec.sh)
2020-10-13T05:33:19.6121418Z Terminate orphan process: pid (12473) (sed)
2020-10-13T05:33:19.6141672Z Terminate orphan process: pid (12474) (server)

So it looks like it hangs on starting the server.

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