]> git.pld-linux.org Git - packages/libtorrent.git/commitdiff
- fixed "less-than zero quota" exception from PeerConnectionBase::down_chunk
authorKarol Krenski <charles@pld-linux.org>
Mon, 26 Sep 2005 13:18:18 +0000 (13:18 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    libtorrent-throttle2.patch -> 1.1

libtorrent-throttle2.patch [new file with mode: 0644]

diff --git a/libtorrent-throttle2.patch b/libtorrent-throttle2.patch
new file mode 100644 (file)
index 0000000..fb5c29e
--- /dev/null
@@ -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);
This page took 0.098654 seconds and 4 git commands to generate.