File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
boost/network/protocol/http/client/connection Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -168,15 +168,18 @@ struct sync_connection_base_impl {
168168 } else {
169169 bool stopping_inner = false ;
170170 do {
171- std::size_t chunk_bytes_read =
172- read (socket_,
173- response_buffer,
174- boost::asio::transfer_at_least (chunk_size),
175- error);
176- if (chunk_bytes_read == 0 ) {
177- if (error != boost::asio::error::eof)
178- throw boost::system::system_error (error);
179- stopping_inner = true ;
171+ if (response_buffer.size () < (chunk_size+2 )){
172+ std::size_t bytes_to_read = (chunk_size+2 ) - response_buffer.size ();
173+ std::size_t chunk_bytes_read =
174+ read (socket_,
175+ response_buffer,
176+ boost::asio::transfer_at_least (bytes_to_read),
177+ error);
178+ if (chunk_bytes_read == 0 ) {
179+ if (error != boost::asio::error::eof)
180+ throw boost::system::system_error (error);
181+ stopping_inner = true ;
182+ }
180183 }
181184
182185 std::istreambuf_iterator<char > eos;
You can’t perform that action at this time.
0 commit comments