* Fixed various memory leaks/errors.

* Don't increment beyond end when incrementing a entry's completed
counter.

* Don't allow ChokeManager::try_unchoke to succeed when it has been
less than 10 seconds since the last unchoke.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@562 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-09-17 01:31:30 +00:00
parent 5ada857c3e
commit 94d31cc681
4 changed files with 22 additions and 8 deletions
+3 -3
View File
@@ -106,7 +106,7 @@ CurlStack::add_get(CurlGet* get) {
CURLMcode code;
if ((code = curl_multi_add_handle((CURLM*)m_handle, get->handle())) > 0)
throw torrent::local_error("curl_multi_add_handle \"" + std::string(curl_multi_strerror(code)));
throw std::logic_error("curl_multi_add_handle \"" + std::string(curl_multi_strerror(code)));
m_size++;
m_getList.push_back(get);
@@ -118,12 +118,12 @@ CurlStack::add_get(CurlGet* get) {
void
CurlStack::remove_get(CurlGet* get) {
if (curl_multi_remove_handle((CURLM*)m_handle, get->handle()) > 0)
throw torrent::local_error("Error calling curl_multi_remove_handle");
throw std::logic_error("Error calling curl_multi_remove_handle");
CurlGetList::iterator itr = std::find(m_getList.begin(), m_getList.end(), get);
if (itr == m_getList.end())
throw torrent::client_error("Could not find CurlGet when calling CurlStack::remove");
throw std::logic_error("Could not find CurlGet when calling CurlStack::remove");
m_size--;
m_getList.erase(itr);