- Notifications
You must be signed in to change notification settings - Fork425
Fix issue #110 and issue #168.#217
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -286,6 +286,11 @@ namespace boost { namespace network { namespace http { namespace impl { | ||
trim(header_pair.second); | ||
headers.insert(header_pair); | ||
} | ||
// determine if the body parser will need to handle chunked encoding | ||
typename headers_range<basic_response<Tag> >::type transfer_encoding_range = | ||
headers.equal_range("Transfer-Encoding"); | ||
is_chunk_encoding = !empty(transfer_encoding_range) | ||
&& boost::iequals(boost::begin(transfer_encoding_range)->second, "chunked"); | ||
headers_promise.set_value(headers); | ||
} | ||
@@ -373,6 +378,7 @@ namespace boost { namespace network { namespace http { namespace impl { | ||
buffer_type part; | ||
typename buffer_type::const_iterator part_begin; | ||
string_type partial_parsed; | ||
bool is_chunk_encoding; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This variable seems unnecessary. You only ever need to check this just before writing it into the message body once. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Right, but without it I'm not sure how I'd get the header data to check if it's chunked encoding just before writing the message body. At that point, I have no reference to the response object, so I can't get the value stored in that future (and if I get a future from the promise that Ido have access to, I cause issues because there can only be one future for any given promise). I suppose I could try to look for that value as we're building up the buffer to parse the headers out with, but that felt more hacky than doing it this way, where I definitely have access to the headers that are about to be put into the promise. Maybe I'm overlooking a better way, though? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Ah, yes, you're right. | ||
}; | ||