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

Trailers support in C API #2699

Open
bagder opened this issue Nov 19, 2021 · 8 comments
Open

Trailers support in C API #2699

bagder opened this issue Nov 19, 2021 · 8 comments
Labels
A-ffi Area: ffi (C API) C-feature Category: feature. This is adding a new feature. E-easy Effort: easy. A task that would be a great starting point for a new contributor. S-blocked Status: blocked on something else.

Comments

@bagder
Copy link
Contributor

bagder commented Nov 19, 2021

I'm making curl use hyper instead of its native HTTP code.

curl supports trailers but I find no API to get them provided from hyper so until it does, I can't make curl+hyper match the native implementation in features.

Sample HTTP/1.1 response below. I want the chunky-trailer: header data part.

HTTP/1.1 200 funky chunky!
Server: fakeit/0.9 fakeitbad/1.0
Transfer-Encoding: chunked
Trailer: chunky-trailer

40
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
30
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
21
cccccccccccccccccccccccccccccccc

0
chunky-trailer: header data

@bagder bagder added the C-feature Category: feature. This is adding a new feature. label Nov 19, 2021
@seanmonstar seanmonstar added A-ffi Area: ffi (C API) E-easy Effort: easy. A task that would be a great starting point for a new contributor. labels Nov 19, 2021
@seanmonstar
Copy link
Member

Ah, sure. We do have support for trailers on the a streaming body, but currently it only supports HTTP/2 trailers (there hasn't been much demand for HTTP/1.1 trailers). So there's two steps here:

  1. Expose hyper_body_trailers() in the C API. We can track that in this issue.
  2. Add HTTP/1.1 trailers support. I've opened Receiving HTTP/1.1 trailers #2703 for that.

@seanmonstar seanmonstar changed the title Trailers support Trailers support in C API Nov 19, 2021
@bagder
Copy link
Contributor Author

bagder commented Dec 6, 2021

I would also like to see support added for sending trailers in HTTP chunked requests.

@seanmonstar
Copy link
Member

Good point, I don't know why I say "client-side receiving" and "server-side sending". I've cleaned them up to just "receiving" and "sending".

@Xuanwo
Copy link
Contributor

Xuanwo commented Jan 27, 2022

Let's me have a try.

@nnethercote
Copy link
Contributor

nnethercote commented Aug 30, 2023

The following curl tests fail due to hyper's lack of trailers support: 266, 1417, 1540, 1591, 1943.

@seanmonstar
Copy link
Member

FWIW, I haven't seen much demand for HTTP/1.1 trailers from anything else. So priority of implementing this (at least myself) is pretty low. Would it work to just mark all those as known to not work?

@nnethercote
Copy link
Contributor

FWIW, I haven't seen much demand for HTTP/1.1 trailers from anything else. So priority of implementing this (at least myself) is pretty low. Would it work to just mark all those as known to not work?

I don't know enough about this to comment. More of a question for @bagder and @bdaehlie.

@bagder
Copy link
Contributor Author

bagder commented Sep 13, 2023

In curl it is already documented as a feature that does not work with hyper. We have set of those. That list is unfortunate because it confuses users and we will need to make sure to distribute the knowledge of those limitations into the user documentation if they remain when we want to remove the experimental tag.

@seanmonstar seanmonstar added the S-blocked Status: blocked on something else. label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ffi Area: ffi (C API) C-feature Category: feature. This is adding a new feature. E-easy Effort: easy. A task that would be a great starting point for a new contributor. S-blocked Status: blocked on something else.
Projects
Status: Cause Known
Development

No branches or pull requests

4 participants