diff --git a/libi2pd_client/Torrents.cpp b/libi2pd_client/Torrents.cpp index 3935213b..99affd0f 100644 --- a/libi2pd_client/Torrents.cpp +++ b/libi2pd_client/Torrents.cpp @@ -1150,7 +1150,8 @@ namespace torrents } } if (m_NumRequests > 0) m_NumRequests--; - RequestNextBlocks (); + if (m_NumRequests <= MAX_NUM_REQUESTS*2/3) + RequestNextBlocks (); // update stats auto ts = i2p::util::GetMonotonicMilliseconds (); if (m_LastBlockDownloadTimestamp) diff --git a/libi2pd_client/Torrents.h b/libi2pd_client/Torrents.h index 7cc3db89..eaccb2e2 100644 --- a/libi2pd_client/Torrents.h +++ b/libi2pd_client/Torrents.h @@ -49,7 +49,7 @@ namespace torrents constexpr int PEER_KEEP_ALIVE_TIMEOUT = 120; // in seconds constexpr int PEER_KEEP_SEND_INTERVAL = 95; // in seconds constexpr int PEER_KEEP_ALIVE_CHECK_INTERVAL = 15; // in seconds - constexpr size_t MAX_NUM_REQUESTS = 8; + constexpr size_t MAX_NUM_REQUESTS = 12; constexpr size_t MAX_NUM_PIECES = 6; constexpr int PIECE_INACTIVITY_TIMEOUT = 60; // in seconds constexpr int TORRENTS_STATUS_UPDATE_INTERVAL = 25; // in seconds