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 chunk and content-length encoding#759

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
deanberris merged 2 commits intocpp-netlib:0.13-releasefromLoopinFool:0.13-release-integration
May 15, 2017
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
PrevPrevious commit
Cleaned up indentation.
Don't potentially access memory beyond the end of the string buffer.In the case of a partial chunk, exit the loop. Continuing to search for crlf in the middle of a binary data chunk can result in an infinite loop, and wasn't the right logic.
  • Loading branch information
Aaron Avery committedMay 11, 2017
commit3ad7753865e5c34ca5684f8cb32db3c2ac481c34
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -361,22 +361,23 @@ struct http_async_protocol_handler {
for (typename string_type::const_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())) {
iter = std::search(begin, partial_parsed.end(), crlf.begin(), crlf.end())) {
string_type line(begin, iter);
if (line.empty()) {
std::advance(iter, 2);
begin = iter;
continue;
std::advance(iter, 2);
begin = iter;
continue;
}
std::stringstream stream(line);
int len;
stream >> std::hex >> len;
std::advance(iter, 2);
if (!len) return true;
if (len <= partial_parsed.end() - iter) {
std::advance(iter, len + 2);
}
std::advance(iter, len);
} else {
return false;
}
begin = iter;
}
return false;
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp