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

Commitf9ab8b3

Browse files
Mike-ECTglynos
authored andcommitted
Fixed an issue with chunked content - client was expecting too many bytes and could block forever.
1 parent2ee4843 commitf9ab8b3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎boost/network/protocol/http/client/connection/sync_base.hpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ namespace boost { namespace network { namespace http { namespace impl {
132132
bool stopping =false;
133133
do {
134134
std::size_t chunk_size_line =read_until(socket_, response_buffer,"\r\n", error);
135+
std::size_t tooMuchRead = response_buffer.size() - chunk_size_line;
135136
if ((chunk_size_line ==0) && (error != boost::asio::error::eof))throwboost::system::system_error(error);
136137
std::size_t chunk_size =0;
137138
string_type data;
@@ -148,7 +149,8 @@ namespace boost { namespace network { namespace http { namespace impl {
148149
}else {
149150
bool stopping_inner =false;
150151
do {
151-
std::size_t chunk_bytes_read =read(socket_, response_buffer,boost::asio::transfer_at_least(chunk_size +2), error);
152+
assert( tooMuchRead <= chunk_size +2 );
153+
std::size_t chunk_bytes_read =read(socket_, response_buffer,boost::asio::transfer_at_least(chunk_size +2 - tooMuchRead), error);
152154
if (chunk_bytes_read ==0) {
153155
if (error != boost::asio::error::eof)throwboost::system::system_error(error);
154156
stopping_inner =true;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp