Always add new http requests to the back the queue.

This commit is contained in:
Aleric Inglewood
2013-06-22 22:20:37 +02:00
parent 8a825c4228
commit ee59617c5e
3 changed files with 25 additions and 5 deletions

View File

@@ -301,10 +301,17 @@ void AIPerService::removed_from_multi_handle(AICapabilityType capability_type, b
--mTotalAdded;
}
void AIPerService::queue(AICurlEasyRequest const& easy_request, AICapabilityType capability_type)
// Returns true if the request was queued.
bool AIPerService::queue(AICurlEasyRequest const& easy_request, AICapabilityType capability_type, bool force_queuing)
{
mCapabilityType[capability_type].mQueuedRequests.push_back(easy_request.get_ptr());
TotalQueued_wat(sTotalQueued)->count++;
CapabilityType::queued_request_type& queued_requests(mCapabilityType[capability_type].mQueuedRequests);
bool needs_queuing = force_queuing || !queued_requests.empty();
if (needs_queuing)
{
queued_requests.push_back(easy_request.get_ptr());
TotalQueued_wat(sTotalQueued)->count++;
}
return needs_queuing;
}
bool AIPerService::cancel(AICurlEasyRequest const& easy_request, AICapabilityType capability_type)