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:
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user