protected function CurlMulti::removeHandle

Remove a curl handle from the curl multi object

Nasty things (bus errors, segmentation faults) can sometimes occur when removing curl handles when in a callback or a recursive scope. Here we are queueing all curl handles that need to be removed and closed so that this happens only in the outermost scope when everything has completed sending.

Parameters

RequestInterface $request Request that owns the handle:

2 calls to CurlMulti::removeHandle()
CurlMulti::processResponse in drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php
Check for errors and fix headers of a request based on a curl response
CurlMulti::remove in drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php
Remove a request from the pool.

File

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

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

protected function removeHandle(RequestInterface $request) {
  if ($this->handles
    ->contains($request)) {
    $handle = $this->handles[$request];
    unset($this->resourceHash[(int) $handle
      ->getHandle()]);
    unset($this->handles[$request]);
    $this->removeHandles[] = $handle;
  }
}