Queue/throttle fix.

If AIPerService::add_queued_to fails because a new request is throttled,
then do not add the request to the end of the queue, nor remove it from
the queue: do nothing: it makes no sense to move the request to the back
because they all belong to the same service and all of them will be
either throttled or not.

Note: Still need to fix that in this case we should look in queues of
other services.
This commit is contained in:
Aleric Inglewood
2013-05-12 18:10:49 +02:00
parent f8aac1f3dd
commit 67e88561dc
3 changed files with 15 additions and 5 deletions

View File

@@ -287,7 +287,11 @@ void AIPerService::add_queued_to(curlthread::MultiHandle* multi_handle)
{
if (!mQueuedRequests.empty())
{
multi_handle->add_easy_request(mQueuedRequests.front());
if (!multi_handle->add_easy_request(mQueuedRequests.front(), true))
{
// Throttled.
return;
}
mQueuedRequests.pop_front();
if (mQueuedRequests.empty())
{