private function CurlMulti::executeHandles

Execute and select curl handles until there is activity

Parameters

bool $select Set to TRUE to select the file descriptors:

int $timeout Select timeout in seconds:

int $active Previous active value:

Return value

int Returns the number of active handles

1 call to CurlMulti::executeHandles()
CurlMulti::perform in drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php
Get the data from the multi handle

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php, line 474

Class

CurlMulti
Send { This implementation allows callers to send blocking requests that return back to the caller when their requests complete, regardless of whether or not previously sending requests in the curl_multi object have completed. The implementation…

Namespace

Guzzle\Http\Curl

Code

private function executeHandles($select = false, $timeout = 1, $active = 0) {
  do {

    // @codeCoverageIgnoreStart
    if ($select && $active && curl_multi_select($this->multiHandle, $timeout) == -1) {

      // Perform a usleep if a previously executed select returned -1
      // @see https://bugs.php.net/bug.php?id=61141
      usleep(125);
    }

    // @codeCoverageIgnoreEnd
    do {
      $mrc = curl_multi_exec($this->multiHandle, $active);
    } while ($mrc == CURLM_CALL_MULTI_PERFORM);

    // Check the return value to ensure an error did not occur
    $this
      ->checkCurlResult($mrc);

    // Poll once if not selecting, or poll until there are no handles with activity
  } while ($select && $active);
  return $active;
}