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
enum enum
{ {
// the limits of the download queue size // the limits of the download queue size
min_request_queue = 2, min_request_queue = 8,
// the amount of free upload allowed before // the amount of free upload allowed before
// the peer is choked // the peer is choked

6
libtorrent/src/bt_peer_connection.cpp

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

1
libtorrent/src/identify_client.cpp

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

2
libtorrent/src/peer_connection.cpp

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

3
src/twister.cpp

@ -155,9 +155,10 @@ void ThreadWaitExtIP()
session_settings settings; session_settings settings;
// settings to test local connections // settings to test local connections
settings.allow_multiple_connections_per_ip = true; 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.dht_announce_interval = 60; // test
//settings.min_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); ses->set_settings(settings);

Loading…
Cancel
Save