removed incorrect asserts. added ip to the extension header. removed the mandatory libtorrent suffix on the user agent

This commit is contained in:
Arvid Norberg 2006-09-28 00:49:40 +00:00
parent b3cad36d59
commit c687c428c4
5 changed files with 7 additions and 7 deletions

View File

@ -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<std::string> events;

View File

@ -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_)

View File

@ -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<std::string> 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<char> msg;

View File

@ -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)

View File

@ -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);
}
}