Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
Fix issue#110 and issue#168.
  • Loading branch information
Chase Geigle committedFeb 27, 2013
commitc6c1607b36849398ae040da4bb03bb95047c9ed3
29 changes: 28 additions & 1 deletionboost/network/protocol/http/message/async_message.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -118,7 +118,34 @@ namespace boost { namespace network { namespace http {
}

string_type const body() const {
return body_.get();
string_type body;
string_type partial_parsed = body_.get();

typename headers_range<basic_response<Tag> >::type transfer_encoding_range = headers().equal_range("Transfer-Encoding");
if (!empty(transfer_encoding_range) && boost::iequals(boost::begin(transfer_encoding_range)->second, "chunked")) {
typename string_type::iterator begin = partial_parsed.begin();
string_type crlf = "\r\n";
for (typename string_type::iterator iter = std::search(begin, partial_parsed.end(), crlf.begin(), crlf.end());
iter != partial_parsed.end();
iter = std::search(begin, partial_parsed.end(), crlf.begin(), crlf.end())) {
string_type line(begin, iter);
if (line.empty()) break;
std::stringstream stream(line);
int len;
stream >> std::hex >> len;
iter += 2;
if (!len) break;
if (len <= partial_parsed.end() - iter) {
body.insert(body.end(), iter, iter + len);
iter += len;
}
begin = iter;
}
} else {
std::swap(body, partial_parsed);
}

return body;
}

void body(boost::shared_future<string_type> const & future) const {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp