feat(ffi): add option to get raw headers from response

This commit is contained in:
Sean McArthur
2021-06-11 14:12:56 -07:00
parent 08b2138e40
commit 8c89a8c166
9 changed files with 132 additions and 2 deletions

View File

@@ -49,6 +49,8 @@ where
preserve_header_case: false,
title_case_headers: false,
h09_responses: false,
#[cfg(feature = "ffi")]
raw_headers: false,
notify_read: false,
reading: Reading::Init,
writing: Writing::Init,
@@ -98,6 +100,11 @@ where
self.state.allow_half_close = true;
}
#[cfg(feature = "ffi")]
pub(crate) fn set_raw_headers(&mut self, enabled: bool) {
self.state.raw_headers = enabled;
}
pub(crate) fn into_inner(self) -> (I, Bytes) {
self.io.into_inner()
}
@@ -162,6 +169,8 @@ where
h1_parser_config: self.state.h1_parser_config.clone(),
preserve_header_case: self.state.preserve_header_case,
h09_responses: self.state.h09_responses,
#[cfg(feature = "ffi")]
raw_headers: self.state.raw_headers,
}
)) {
Ok(msg) => msg,
@@ -766,6 +775,8 @@ struct State {
preserve_header_case: bool,
title_case_headers: bool,
h09_responses: bool,
#[cfg(feature = "ffi")]
raw_headers: bool,
/// Set to true when the Dispatcher should poll read operations
/// again. See the `maybe_notify` method for more.
notify_read: bool,