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

Commitc60bf39

Browse files
Mike-ECTglynos
authored andcommitted
Fixed a bug that too many bytes were expected during chunked body processing.
1 parent6cb7388 commitc60bf39

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,20 @@ namespace boost { namespace network { namespace http { namespace impl {
147147
throwboost::system::system_error(error);
148148
}else {
149149
bool stopping_inner =false;
150+
std::istreambuf_iterator<char> eos;
151+
std::istreambuf_iterator<char>stream_iterator0(&response_buffer);
152+
for (; chunk_size >0 && stream_iterator0 != eos; --chunk_size)
153+
body_stream << *stream_iterator0++;
154+
150155
do {
151-
std::size_t chunk_bytes_read =read(socket_, response_buffer,boost::asio::transfer_at_least(chunk_size), error);
152-
if (chunk_bytes_read ==0) {
153-
if (error != boost::asio::error::eof)throwboost::system::system_error(error);
154-
stopping_inner =true;
156+
if (chunk_size !=0) {
157+
std::size_t chunk_bytes_read =read(socket_, response_buffer,boost::asio::transfer_at_least(chunk_size), error);
158+
if (chunk_bytes_read ==0) {
159+
if (error != boost::asio::error::eof)throwboost::system::system_error(error);
160+
stopping_inner =true;
161+
}
155162
}
156163

157-
std::istreambuf_iterator<char> eos;
158164
std::istreambuf_iterator<char>stream_iterator(&response_buffer);
159165
for (; chunk_size >0 && stream_iterator != eos; --chunk_size)
160166
body_stream << *stream_iterator++;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp