From c347ccc439993454858a12c6be769330679a2fdc Mon Sep 17 00:00:00 2001 From: rakshasa Date: Fri, 9 Sep 2005 16:12:29 +0000 Subject: [PATCH] * Use ChunkHandle instead of ChunkListNode*, this will include write reference counter. * Get errno message when chunks can't be allocated. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@556 e378c898-3ddf-0310-93e7-cc216c733640 --- rak/error_number.h | 1 + src/core/curl_stack.cc | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rak/error_number.h b/rak/error_number.h index 7f2a4706..d2964b0f 100644 --- a/rak/error_number.h +++ b/rak/error_number.h @@ -56,6 +56,7 @@ public: bool is_closed() const { return m_errno == ECONNRESET || m_errno == ECONNABORTED; } static error_number current() { return errno; } + static void clear_global() { errno = 0; } private: int m_errno; diff --git a/src/core/curl_stack.cc b/src/core/curl_stack.cc index 8200abd4..ef8c625e 100644 --- a/src/core/curl_stack.cc +++ b/src/core/curl_stack.cc @@ -69,7 +69,7 @@ CurlStack::perform() { code = curl_multi_perform((CURLM*)m_handle, &s); if (code > 0) - throw torrent::local_error("Error calling curl_multi_perform"); + throw std::runtime_error("Error calling curl_multi_perform"); if (s != m_size) { // Done with some handles. @@ -82,7 +82,7 @@ CurlStack::perform() { rak::equal(msg->easy_handle, std::mem_fun(&CurlGet::handle))); if (itr == m_getList.end()) - throw torrent::client_error("Could not find CurlGet with the right easy_handle"); + throw std::logic_error("Could not find CurlGet with the right easy_handle"); (*itr)->perform(msg); } while (t); @@ -110,6 +110,9 @@ CurlStack::add_get(CurlGet* get) { m_size++; m_getList.push_back(get); + + // Curl ML suggest we need to do perform after adding a handle. + perform(); } void