diff --git a/ChangeLog b/ChangeLog index 81673ad3f..1d3392ec9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,8 @@ * fix uTP edge case where udp socket buffer fills up * fix nagle implementation in uTP + * fix potential integer overflow issue in timers on windows + * minor fix to peer_proportional mixed_mode algorithm (TCP limit could go too low) * graceful pause fix * i2p fixes * fix issue when loading certain malformed .torrent files diff --git a/src/http_connection.cpp b/src/http_connection.cpp index cc8d324b0..3180f6da5 100644 --- a/src/http_connection.cpp +++ b/src/http_connection.cpp @@ -171,9 +171,13 @@ 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; + + APPEND_FMT1("Host: %s", hostname.c_str()); + if (port != default_port) APPEND_FMT1(":%d\r\n", port); + else APPEND_FMT("\r\n"); } else { diff --git a/src/time.cpp b/src/time.cpp index c3f04dcb5..32f0ad563 100644 --- a/src/time.cpp +++ b/src/time.cpp @@ -190,12 +190,12 @@ namespace libtorrent int total_seconds(time_duration td) { - return int(performance_counter_to_microseconds(td.diff) + return boost::int64_t(performance_counter_to_microseconds(td.diff) / 1000000); } int total_milliseconds(time_duration td) { - return int(performance_counter_to_microseconds(td.diff) + return boost::uint64_t(performance_counter_to_microseconds(td.diff) / 1000); } boost::int64_t total_microseconds(time_duration td)