mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-18 23:26:17 +00:00
* 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
This commit is contained in:
@@ -56,6 +56,7 @@ public:
|
|||||||
bool is_closed() const { return m_errno == ECONNRESET || m_errno == ECONNABORTED; }
|
bool is_closed() const { return m_errno == ECONNRESET || m_errno == ECONNABORTED; }
|
||||||
|
|
||||||
static error_number current() { return errno; }
|
static error_number current() { return errno; }
|
||||||
|
static void clear_global() { errno = 0; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_errno;
|
int m_errno;
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ CurlStack::perform() {
|
|||||||
code = curl_multi_perform((CURLM*)m_handle, &s);
|
code = curl_multi_perform((CURLM*)m_handle, &s);
|
||||||
|
|
||||||
if (code > 0)
|
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) {
|
if (s != m_size) {
|
||||||
// Done with some handles.
|
// Done with some handles.
|
||||||
@@ -82,7 +82,7 @@ CurlStack::perform() {
|
|||||||
rak::equal(msg->easy_handle, std::mem_fun(&CurlGet::handle)));
|
rak::equal(msg->easy_handle, std::mem_fun(&CurlGet::handle)));
|
||||||
|
|
||||||
if (itr == m_getList.end())
|
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);
|
(*itr)->perform(msg);
|
||||||
} while (t);
|
} while (t);
|
||||||
@@ -110,6 +110,9 @@ CurlStack::add_get(CurlGet* get) {
|
|||||||
|
|
||||||
m_size++;
|
m_size++;
|
||||||
m_getList.push_back(get);
|
m_getList.push_back(get);
|
||||||
|
|
||||||
|
// Curl ML suggest we need to do perform after adding a handle.
|
||||||
|
perform();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user