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

fix(ffi): Change hyper_headers_foreach to iterate in recieved order #2798

Merged

Commits on Apr 11, 2022

  1. feature(ffi): Added connection option to preserve header order.

    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
    liamwarfield authored and Liam Warfield committed Apr 11, 2022
    Copy the full SHA
    f4fec5c View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    3154fbb View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2022

  1. refactor(ffi): add docs to OriginalHeaderOrder and refactor hyper_hea…

    …ders_foreach_ordered
    
    hyper_headers_foreach_ordered was merged into hyper_headers_foreach.
    OriginalHeaderOrder docs were given examples
    OriginalHeaderOrder has named members for better clarity.
    
    BREAKING CHANGE: ffi::client::hyper_clientconn_options_new no longer
    sets the http1_preserve_header_case connection option by default.
    Users should now call
    ffi::client::hyper_clientconn_options_set_preserve_header_order
    if they desire that functionality
    liamwarfield committed Apr 14, 2022
    Copy the full SHA
    720743e View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2022

  1. missed a few #[cfg(feature = "ffi")]

    This cased the CI to fail
    liamwarfield authored and Liam Warfield committed Apr 22, 2022
    Copy the full SHA
    fcc9851 View commit details
    Browse the repository at this point in the history