You are here

private function CurlMultiHandler::cancel in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php \GuzzleHttp\Handler\CurlMultiHandler::cancel()

Cancels a handle from sending and removes references to it.

Parameters

int $id Handle ID to cancel and remove.:

Return value

bool True on success, false on failure.

1 call to CurlMultiHandler::cancel()
CurlMultiHandler::__invoke in vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php

File

vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php, line 146

Class

CurlMultiHandler
Returns an asynchronous response using curl_multi_* functions.

Namespace

GuzzleHttp\Handler

Code

private function cancel($id) {

  // Cannot cancel if it has been processed.
  if (!isset($this->handles[$id])) {
    return false;
  }
  $handle = $this->handles[$id]['easy']->handle;
  unset($this->delays[$id], $this->handles[$id]);
  curl_multi_remove_handle($this->_mh, $handle);
  curl_close($handle);
  return true;
}