Moving stuff around a bit...

This commit is contained in:
Aleric Inglewood
2012-07-18 01:41:36 +02:00
parent 48ae0d003d
commit 706b9c55c2
3 changed files with 10 additions and 5 deletions

View File

@@ -1324,8 +1324,12 @@ CurlMultiHandle::~CurlMultiHandle()
{
curl_multi_cleanup(mMultiHandle);
Stats::multi_calls++;
#ifdef CWDEBUG
int total = --sTotalMultiHandles;
Dout(dc::curl, "Called CurlMultiHandle::~CurlMultiHandle() [" << (void*)this << "], " << total << " remaining.");
#else
--sTotalMultiHandles;
Dout(dc::curl, "Called CurlMultiHandle::~CurlMultiHandle() [" << (void*)this << "], " << sTotalMultiHandles << " remaining.");
#endif
}
} // namespace AICurlPrivate

View File

@@ -233,11 +233,12 @@ typedef AIAccess<AICurlPrivate::CurlEasyRequest> AICurlEasyRequest_wat;
// Events generated by AICurlPrivate::CurlEasyHandle.
struct AICurlEasyHandleEvents {
virtual ~AICurlEasyHandleEvents(){}
// Events.
virtual void added_to_multi_handle(AICurlEasyRequest_wat& curl_easy_request_w) = 0;
virtual void finished(AICurlEasyRequest_wat& curl_easy_request_w) = 0;
virtual void removed_from_multi_handle(AICurlEasyRequest_wat& curl_easy_request_w) = 0;
// Avoid compiler warning.
virtual ~AICurlEasyHandleEvents() { }
};
#include "aicurlprivate.h"

View File

@@ -248,8 +248,8 @@ void PollSet::remove(curl_socket_t s)
// mFdSet.fd_array instead of mFileDescriptors and mIter instead of mNext.
if (FD_ISSET(s, &mFdSet))
{
int i = --mFdSet.fd_count;
llassert(i >= 0);
llassert(mFdSet.fd_count > 0);
unsigned int i = --mFdSet.fd_count;
curl_socket_t cur = mFdSet.fd_array[i];
while (cur != s)
{
@@ -258,7 +258,7 @@ void PollSet::remove(curl_socket_t s)
mFileDescriptors[i] = cur;
cur = next;
}
if (mIter > (unsigned int)i)
if (mIter > i)
--mIter;
llassert(mIter <= mFdSet.fd_count);
}