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

Commit7602c3e

Browse files
Ivan  Johannessendeanberris
Ivan Johannessen
authored andcommitted
Fixed sync_connection_base_impl::read_body_transfer_chunk_encoding method to account for data alreay read into the buffer
1 parent5953b8c commit7602c3e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎boost/network/protocol/http/impl/sync_connection_base.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,13 @@ namespace boost { namespace network { namespace http { namespace impl {
158158
}while (!stopping);
159159
}elsethrowstd::runtime_error("Unsupported Transfer-Encoding.");
160160
}else {
161-
size_t length = lexical_cast<size_t>(boost::begin(content_length_range)->second);
162-
size_t bytes_read =0;
161+
size_t already_read = response_buffer.size( );
162+
if ( already_read )
163+
body_stream << &response_buffer;
164+
size_t length = lexical_cast<size_t>(boost::begin(content_length_range)->second) - already_read;
165+
if ( length ==0 )
166+
return;
167+
size_t bytes_read =0;
163168
while ((bytes_read =boost::asio::read(socket_, response_buffer,boost::asio::transfer_at_least(1), error))) {
164169
body_stream << &response_buffer;
165170
length -= bytes_read;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp