From b20096f0dbc2f2c5a2c41cc495202126c6c83f57 Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Sat, 2 Jan 2016 11:24:07 -0500 Subject: [PATCH 1/2] Comments typos --- include/libtorrent/block_cache.hpp | 2 +- include/libtorrent/bt_peer_connection.hpp | 4 ++-- include/libtorrent/choker.hpp | 2 +- include/libtorrent/file.hpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/libtorrent/block_cache.hpp b/include/libtorrent/block_cache.hpp index 9b9e6afe6..5348c327a 100644 --- a/include/libtorrent/block_cache.hpp +++ b/include/libtorrent/block_cache.hpp @@ -206,7 +206,7 @@ namespace libtorrent // if this is set, we'll be calculating the hash // for this piece. This member stores the interim - // state while we're calulcating the hash. + // state while we're calculating the hash. partial_hash* hash; // set to a unique identifier of a peer that last diff --git a/include/libtorrent/bt_peer_connection.hpp b/include/libtorrent/bt_peer_connection.hpp index eca21e8f4..bc2628730 100644 --- a/include/libtorrent/bt_peer_connection.hpp +++ b/include/libtorrent/bt_peer_connection.hpp @@ -358,7 +358,7 @@ private: #if !defined(TORRENT_DISABLE_ENCRYPTION) && !defined(TORRENT_DISABLE_EXTENSIONS) // this is set to true after the encryption method has been - // succesfully negotiated (either plaintext or rc4), to signal + // successfully negotiated (either plaintext or rc4), to signal // automatic encryption/decryption. bool m_encrypted:1; @@ -377,7 +377,7 @@ private: // where in the send buffer actual payload // data is located. This is currently // only used to be able to gather statistics - // seperately on payload and protocol data. + // separately on payload and protocol data. struct range { range(int s, int l) diff --git a/include/libtorrent/choker.hpp b/include/libtorrent/choker.hpp index 0399c42d8..ef3e60a2e 100644 --- a/include/libtorrent/choker.hpp +++ b/include/libtorrent/choker.hpp @@ -44,7 +44,7 @@ namespace libtorrent // sort. Only the unchoke slots first elements are sorted. // the return value are the number of peers that should be unchoked. This // is also the number of elements that are valid at the beginning of the - // peer list. Peers bayond this initial range are not sorted. + // peer list. Peers beyond this initial range are not sorted. TORRENT_EXTRA_EXPORT int unchoke_sort(std::vector& peers , int max_upload_rate, time_duration unchoke_interval , aux::session_settings const& sett); diff --git a/include/libtorrent/file.hpp b/include/libtorrent/file.hpp index 2914fbe85..629c8fefa 100644 --- a/include/libtorrent/file.hpp +++ b/include/libtorrent/file.hpp @@ -255,7 +255,7 @@ namespace libtorrent // this generally improves disk performance. no_atime = 0x8, - // open the file for random acces. This disables read-ahead + // open the file for random access. This disables read-ahead // logic random_access = 0x10, From b9a5525ab27e6e3804912d95fd8c2774efcab379 Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Sat, 2 Jan 2016 11:43:09 -0500 Subject: [PATCH 2/2] Store dht_settings::max_peers in session state --- src/session_impl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 18656e1f3..a27ca1309 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -690,6 +690,7 @@ namespace aux { dht_sett["max_fail_count"] = m_dht_settings.max_fail_count; dht_sett["max_torrents"] = m_dht_settings.max_torrents; dht_sett["max_dht_items"] = m_dht_settings.max_dht_items; + dht_sett["max_peers"] = m_dht_settings.max_peers; dht_sett["max_torrent_search_reply"] = m_dht_settings.max_torrent_search_reply; dht_sett["restrict_routing_ips"] = m_dht_settings.restrict_routing_ips; dht_sett["restrict_search_ips"] = m_dht_settings.restrict_search_ips; @@ -763,6 +764,8 @@ namespace aux { if (val) m_dht_settings.max_torrents = val.int_value(); val = settings.dict_find_int("max_dht_items"); if (val) m_dht_settings.max_dht_items = val.int_value(); + val = settings.dict_find_int("max_peers"); + if (val) m_dht_settings.max_peers = val.int_value(); val = settings.dict_find_int("max_torrent_search_reply"); if (val) m_dht_settings.max_torrent_search_reply = val.int_value(); val = settings.dict_find_int("restrict_routing_ips");