diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 7ea5e7b35..af0765252 100755 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -553,7 +553,7 @@ int main(int ac, char* av[]) } } - settings.user_agent = "client_test " LIBTORRENT_VERSION; + settings.user_agent = "client_test/" LIBTORRENT_VERSION; std::deque events; diff --git a/include/libtorrent/session_settings.hpp b/include/libtorrent/session_settings.hpp index 6ffa09fdc..80d328611 100644 --- a/include/libtorrent/session_settings.hpp +++ b/include/libtorrent/session_settings.hpp @@ -40,7 +40,7 @@ namespace libtorrent struct TORRENT_EXPORT session_settings { - session_settings(std::string const& user_agent_ = "libtorrent " + session_settings(std::string const& user_agent_ = "libtorrent/" LIBTORRENT_VERSION) : proxy_port(0) , user_agent(user_agent_) diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index 738896170..6c150f49a 100755 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -1123,6 +1123,10 @@ namespace libtorrent handshake["m"] = extension_list; handshake["p"] = m_ses.m_listen_interface.port(); handshake["v"] = m_ses.m_settings.user_agent; + std::string remote_address; + std::back_insert_iterator out(remote_address); + detail::write_address(remote().address(), out); + handshake["ip"] = remote_address; handshake["reqq"] = m_ses.m_settings.max_allowed_in_request_queue; std::vector msg; diff --git a/src/http_tracker_connection.cpp b/src/http_tracker_connection.cpp index 6c9e6be16..3299cf5b8 100755 --- a/src/http_tracker_connection.cpp +++ b/src/http_tracker_connection.cpp @@ -345,7 +345,7 @@ namespace libtorrent m_send_buffer += " HTTP/1.0\r\nAccept-Encoding: gzip\r\n" "User-Agent: "; m_send_buffer += m_settings.user_agent; - m_send_buffer += " (libtorrent)\r\n" + m_send_buffer += "\r\n" "Host: "; m_send_buffer += hostname; if (port != 80) diff --git a/src/udp_tracker_connection.cpp b/src/udp_tracker_connection.cpp index df7cee3a1..db9bba50a 100755 --- a/src/udp_tracker_connection.cpp +++ b/src/udp_tracker_connection.cpp @@ -120,7 +120,6 @@ namespace libtorrent catch (std::exception& e) { fail(-1, e.what()); - assert(false); }; void udp_tracker_connection::on_timeout() @@ -242,7 +241,6 @@ namespace libtorrent catch (std::exception& e) { fail(-1, e.what()); - assert(false); } void udp_tracker_connection::send_udp_announce() @@ -429,7 +427,6 @@ namespace libtorrent catch (std::exception& e) { fail(-1, e.what()); - assert(false); }; // msvc 7.1 seems to require this void udp_tracker_connection::scrape_response(asio::error const& error @@ -510,7 +507,6 @@ namespace libtorrent catch (std::exception& e) { fail(-1, e.what()); - assert(false); } }