Skip to content

Commit 792f0d0

Browse files
committed
Fixes #78 -- short reads with Asio+OpenSSL.
1 parent 868dd23 commit 792f0d0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

boost/network/protocol/http/client/connection/async_normal.hpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,16 @@ namespace boost { namespace network { namespace http { namespace impl {
199199
}
200200

201201
void handle_received_data(state_t state, bool get_body, body_callback_function_type callback, boost::system::error_code const & ec, std::size_t bytes_transferred) {
202-
if (!ec || ec == boost::asio::error::eof) {
202+
static long short_read_error = 335544539;
203+
bool is_ssl_short_read_error =
204+
#ifdef BOOST_NETWORK_ENABLE_HTTPS
205+
ec.category() == asio::error::ssl_category &&
206+
ec.value() == short_read_error
207+
#else
208+
false
209+
#endif
210+
;
211+
if (!ec || ec == boost::asio::error::eof || is_ssl_short_read_error) {
203212
logic::tribool parsed_ok;
204213
size_t remainder;
205214
switch(state) {

0 commit comments

Comments
 (0)