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

http2 trailer show header #5663

Closed
MoMannn opened this issue Jul 8, 2020 · 2 comments
Closed

http2 trailer show header #5663

MoMannn opened this issue Jul 8, 2020 · 2 comments
Assignees
Labels

Comments

@MoMannn
Copy link

MoMannn commented Jul 8, 2020

I did this

So I called a http2 server that sends trailer headers (so headers frame after data frames) like so:

curl url --http2-prior-knowledge --verbose

I got the response as such:

* Connected to localhost (127.0.0.1) port 8080 (#0)
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fe0c900d600)
> GET / HTTP/2
> Host: localhost:8080
> User-Agent: curl/7.64.1
> Accept: */*
> 
* Connection state changed (MAX_CONCURRENT_STREAMS == 4294967295)!
< HTTP/2 200 
< trailer: test
< 
* Connection #0 to host localhost left intact
Hello world!* Closing connection 0

I expected the following

I expected that after data headers: test: ok would also be displayed.

curl/libcurl version

curl 7.64.1 (x86_64-apple-darwin19.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.39.2

operating system

Mac os 10.15.4

@bagder bagder added the HTTP/2 label Jul 9, 2020
@bagder
Copy link
Member

bagder commented Jul 30, 2020

This is a report for an older curl version. We changed the trailer handling in 7.71.0 (54a2b63) but it seems to be broken currently anyway.

@bagder bagder self-assigned this Jul 30, 2020
@bagder
Copy link
Member

bagder commented Jul 30, 2020

BTW, in order to reproduce I used these cmdlines (invoked in the curl source root):

  1. nghttpd --no-tls --trailer 'foo: bar' 8000
  2. ./src/curl --http2-prior-knowledge --verbose localhost:8000/README

bagder added a commit that referenced this issue Aug 3, 2020
The previous h2 trailer fix in 54a2b63 was wrong and caused a
regression: it cannot deal with trailers immediately when read since
they may be read off the connection by the wrong 'data' owner.

This change reverts the logic back to gathering all trailers into a
single buffer, like before 54a2b63.

Reported-by: Tadej Vengust
Fixes #5663
Closes #
@bagder bagder closed this as completed in 7f187d8 Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants