From 90b3006d222cb0ca74da453deea021150fe7dd11 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 11 Feb 2009 07:54:16 +0000 Subject: [PATCH] fixed bug when talking to https 1.0 servers --- ChangeLog | 1 + src/http_connection.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33fa648f1..cd83b28c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -59,6 +59,7 @@ release 0.14.2 * fixed mapped files bug where it wouldn't be properly restored from resume data properly * removed locale dependency in xml parser (caused asserts on windows) + * fixed bug when talking to https 1.0 servers release 0.14.1 diff --git a/src/http_connection.cpp b/src/http_connection.cpp index cda88d8dd..3aa469859 100644 --- a/src/http_connection.cpp +++ b/src/http_connection.cpp @@ -409,8 +409,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; @@ -419,7 +422,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; }