SOURCES: libtorrent-throttle2.patch (NEW) - fixed "less-than zero ...
charles
charles at pld-linux.org
Mon Sep 26 15:18:23 CEST 2005
Author: charles Date: Mon Sep 26 13:18:23 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- fixed "less-than zero quota" exception from PeerConnectionBase::down_chunk
---- Files affected:
SOURCES:
libtorrent-throttle2.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/libtorrent-throttle2.patch
diff -u /dev/null SOURCES/libtorrent-throttle2.patch:1.1
--- /dev/null Mon Sep 26 15:18:23 2005
+++ SOURCES/libtorrent-throttle2.patch Mon Sep 26 15:18:18 2005
@@ -0,0 +1,24 @@
+--- libtorrent/src/protocol/peer_connection_base.cc
++++ libtorrent/src/protocol/peer_connection_base.cc
+@@ -77,8 +77,8 @@
+ if (m_download == NULL)
+ throw internal_error("PeerConnection::~PeerConnection() m_fd is valid but m_state and/or m_net is NULL");
+
+- m_up->set_choked(false);
+ m_download->choke_manager()->disconnected(this);
++ m_up->set_choked(true);
+
+ pollCustom->remove_read(this);
+ pollCustom->remove_write(this);
+@@ -299,8 +299,10 @@
+ uint32_t bytes = quota - left;
+
+ m_downRate.insert(bytes);
+- m_downThrottle->used(bytes);
+
++ if (is_down_throttled() && !m_downThrottle->is_unlimited())
++ m_downThrottle->used(std::min<uint32_t>(bytes, m_downThrottle->get_quota()));
++
+ throttleRead.get_rate_slow().insert(bytes);
+ throttleRead.get_rate_quick().insert(bytes);
+ m_download->get_down_rate().insert(bytes);
================================================================
More information about the pld-cvs-commit
mailing list