more test_transfer polish. fix issue where passing on our listen port depended on anonymous_mode, instead of use_proxy. not passing it on would break a few unit tests

This commit is contained in:
Arvid Norberg 2014-01-26 08:36:56 +00:00
parent 36c9add067
commit 077f728931
2 changed files with 6 additions and 2 deletions

View File

@ -2123,12 +2123,16 @@ namespace libtorrent
entry handshake;
entry::dictionary_type& m = handshake["m"].dict();
// if we're using a proxy, our listen port won't be useful
// anyway.
if (!m_ses.settings().force_proxy && is_outgoing())
handshake["p"] = m_ses.listen_port();
// only send the port in case we bade the connection
// on incoming connections the other end already knows
// our listen port
if (!m_ses.m_settings.anonymous_mode)
{
if (is_outgoing()) handshake["p"] = m_ses.listen_port();
handshake["v"] = m_ses.settings().handshake_client_version.empty()
? m_ses.settings().user_agent : m_ses.settings().handshake_client_version;
}

View File

@ -196,7 +196,7 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
, std::make_pair(48075 + listen_port, 49000), "0.0.0.0", 0, alert_mask);
session ses2(fingerprint("LT", 0, 1, 0, 0)
, std::make_pair(49075 + listen_port, 50000), "0.0.0.0", 0, alert_mask);
++listen_port;
listen_port += 10;
proxy_settings ps;
if (proxy_type)