-
-
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
Hyper Curl test 580 and 580 Root cause #2780
Comments
Ah yes, I remember this possibly being a thing. Thanks for the detailed report! |
Any ideas for where the fix should live: |
I found that we did discuss this some in #2572. I don't think we'd update
|
Adding an extra vec to |
Update from the curl side, the maintainers of libcurl would prefer a fix on the hyper side over changing the tests for this one. |
I've been working changing HeaderCaseMap used in the ffi hyper_headers to a On another note, do you know if the robinhood hashing in |
Sorry for the slow response, I've been thinking about this and not been able to think of a good solution (and so haven't had something to say).
I still don't know what the best answer here is. |
Thanks for the update ("The order of values for a specific name are preserved" was very helpful) . I've got a branch with 580 and 581 passing now, I'll post a PR. |
Libcurl expects that headers are iterated in the same order that they are recieved. Previously this caused curl tests 580 and 581 to fail. SUMMARY OF CHANGES: Add a new data structure to HeaderCaseMap that represents the order in which headers originally appear in a HTTP message. This datastructure is `Vec<(Headername, multimap-index)>`. This vector is ordered by the order which headers were recieved. This new datastucture is used in hyper_headers_foreach to iterate through headers in the correct order. CLOSES ISSUE: hyperium#2780 BEAKING CHANGE: HeaderCaseMap::append now requires that names passed into it impl Into<HeaderName> + Clone. Currently all types that impl IntoHeaderName (in hyper and http) also impl these traits already.
Libcurl expects that headers are iterated in the same order that they are recieved. Previously this caused curl tests 580 and 581 to fail. This necessitated exposing a way to preserve the original ordering of http headers. SUMMARY OF CHANGES: Add a new data structure called OriginalHeaderOrder that represents the order in which headers originally appear in a HTTP message. This datastructure is `Vec<(Headername, multimap-index)>`. This vector is ordered by the order which headers were recieved. Add the following ffi functions: - ffi::client::hyper_clientconn_options_set_preserve_header_order : An ffi interface to configure a connection to preserve header order. - ffi::client::hyper_clientconn_options_set_preserve_header_case : An ffi interface to configure a connection to preserve header case. - ffi::http_types::hyper_headers_foreach_ordered : Iterates the headers in the order the were recieved, passing each name and value pair to the callback. Add a new option to ParseContext, and Conn::State called `preserve_header_order`. This option, and all the code paths it creates are behind the `ffi` feature flag. This should not change performance of response parsing for non-ffi users. CLOSES ISSUE: hyperium#2780
Version
hyper::ffi current version
Platform
All?
Description
Found the RC of failing curl tests 580 and 581!
[short summary of the bug]
hyper_headers_foreach iterates through headers in by header name, not by order recieved! The smoking gun for for curl tests 580 and 581 is this line.
For test 581:
Raw response sent by server:
Curl is expecting an iterator that returns headers in the order that they were received:
but hyper is returning ALL of the
Content-Type
headers before moving onto theConnection
header. Results in:Hyper Code Responcible
@seanmonstar
The text was updated successfully, but these errors were encountered: