diff options
Diffstat (limited to 'libtorrent/src/http_connection.cpp')
-rw-r--r-- | libtorrent/src/http_connection.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libtorrent/src/http_connection.cpp b/libtorrent/src/http_connection.cpp index b831fa4f6..d750e92e5 100644 --- a/libtorrent/src/http_connection.cpp +++ b/libtorrent/src/http_connection.cpp @@ -399,8 +399,11 @@ void http_connection::on_read(error_code const& e TORRENT_ASSERT(m_download_quota >= 0); } - if (e == asio::error::eof) + // when using the asio SSL wrapper, it seems like + // we get the shut_down error instead of EOF + if (e == asio::error::eof || e == asio::error::shut_down) { + error_code ec = asio::error::eof; TORRENT_ASSERT(bytes_transferred == 0); char const* data = 0; std::size_t size = 0; @@ -409,7 +412,7 @@ void http_connection::on_read(error_code const& e data = m_parser.get_body().begin; size = m_parser.get_body().left(); } - callback(e, data, size); + callback(ec, data, size); close(); return; } |