diff --git a/ChangeLog b/ChangeLog index 634d0eecc..c6f5c713e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,10 @@ * fix uTP edge case where udp socket buffer fills up * fix nagle implementation in uTP + * pass along host header with http proxy requests and possible http_connection shutdown hang + +0.16.12 release + * fix building with C++11 * fix IPv6 support in UDP socket (uTP) * fix mingw build issues diff --git a/src/http_connection.cpp b/src/http_connection.cpp index 53d22d8e7..cc8d324b0 100644 --- a/src/http_connection.cpp +++ b/src/http_connection.cpp @@ -171,6 +171,7 @@ void http_connection::get(std::string const& url, time_duration timeout, int pri if (ps->type == proxy_settings::http_pw) APPEND_FMT1("Proxy-Authorization: Basic %s\r\n", base64encode( ps->username + ":" + ps->password).c_str()); + APPEND_FMT1("Host: %s", hostname.c_str()); hostname = ps->hostname; port = ps->port; } @@ -667,6 +668,8 @@ void http_connection::on_write(error_code const& e) return; } + if (m_abort) return; + std::string().swap(sendbuffer); m_recvbuffer.resize(4096); @@ -701,6 +704,7 @@ void http_connection::on_read(error_code const& e #if defined TORRENT_ASIO_DEBUGGING complete_async("http_connection::on_read"); #endif + if (m_rate_limit) { m_download_quota -= bytes_transferred; @@ -709,6 +713,8 @@ void http_connection::on_read(error_code const& e if (e == asio::error::operation_aborted) return; + if (m_abort) return; + // keep ourselves alive even if the callback function // deletes this object boost::shared_ptr me(shared_from_this());