//If stream reading is ahead, than some data is already in the old buffer and needs to be copied to new resized buffer
if(_buffer&&stream_read>0){
memcpy(new_buffer,_buffer.get(),stream_read);
}
_buffer.reset(new_buffer);
_bufferSize=min_buffer_size;
}
//Fetch remaining data from stream
//If error in tcp_write in ClientContext::_write_some() occured earlier and therefore release_buffer was not called last time, than the requested stream data is already in the buffer.