Browse Source

tweaks. increase m_desired_queue_size, maybe 2 is too low due to rounding

number of pieces to the nearest multiple of 8. not sure.
miguelfreitas
Miguel Freitas 11 years ago
parent
commit
34024136ae
  1. 2
      libtorrent/include/libtorrent/policy.hpp
  2. 6
      libtorrent/src/bt_peer_connection.cpp
  3. 1
      libtorrent/src/identify_client.cpp
  4. 2
      libtorrent/src/peer_connection.cpp
  5. 3
      src/twister.cpp

2
libtorrent/include/libtorrent/policy.hpp

@ -95,7 +95,7 @@ namespace libtorrent @@ -95,7 +95,7 @@ namespace libtorrent
enum
{
// the limits of the download queue size
min_request_queue = 2,
min_request_queue = 8,
// the amount of free upload allowed before
// the peer is choked

6
libtorrent/src/bt_peer_connection.cpp

@ -3105,6 +3105,9 @@ namespace libtorrent @@ -3105,6 +3105,9 @@ namespace libtorrent
if (i != p.end_peer())
{
TORRENT_ASSERT((*i)->connection->pid() == pid);
#ifdef TORRENT_VERBOSE_LOGGING
peer_log("*** will disconnect: duplicated connection\n");
#endif
// we found another connection with the same peer-id
// which connection should be closed in order to be
// sure that the other end closes the same connection?
@ -3128,6 +3131,9 @@ namespace libtorrent @@ -3128,6 +3131,9 @@ namespace libtorrent
// since it most likely is ourself then
if (pid == m_ses.get_peer_id())
{
#ifdef TORRENT_VERBOSE_LOGGING
peer_log("*** will disconnect: duplicated connection\n");
#endif
if (peer_info_struct()) t->get_policy().ban_peer(peer_info_struct());
disconnect(errors::self_connection, 1);
return;

1
libtorrent/src/identify_client.cpp

@ -216,6 +216,7 @@ namespace @@ -216,6 +216,7 @@ namespace
, {"TR", "Transmission"}
, {"TS", "TorrentStorm"}
, {"TT", "TuoTu"}
, {"TW", "twister"}
, {"U", "UPnP"}
, {"UL", "uLeecher"}
, {"UM", "uTorrent Mac"}

2
libtorrent/src/peer_connection.cpp

@ -165,7 +165,7 @@ namespace libtorrent @@ -165,7 +165,7 @@ namespace libtorrent
, m_upload_rate_peak(0)
, m_rtt(0)
, m_prefer_whole_pieces(0)
, m_desired_queue_size(2)
, m_desired_queue_size(8)
, m_fast_reconnect(false)
, m_outgoing(outgoing)
, m_received_listen_port(false)

3
src/twister.cpp

@ -155,9 +155,10 @@ void ThreadWaitExtIP() @@ -155,9 +155,10 @@ void ThreadWaitExtIP()
session_settings settings;
// settings to test local connections
settings.allow_multiple_connections_per_ip = true;
settings.enable_outgoing_utp = false; // test (netstat display)
//settings.enable_outgoing_utp = false; // (false to see connections in netstat)
//settings.dht_announce_interval = 60; // test
//settings.min_announce_interval = 60; // test
settings.anonymous_mode = false; // (false => send peer_id, avoid connecting to itself)
ses->set_settings(settings);

Loading…
Cancel
Save