if (curl_errno($this->handle
) === CURLE_WRITE_ERROR ||
curl_errno($this->handle
) === CURLE_BAD_CONTENT_ENCODING
) { // Reset encoding and try again
curl_setopt($this->handle, CURLOPT_ENCODING, 'none'
);
$this->response_data = '';
$this->response_bytes = 0;
curl_exec($this->handle
);
$response =
$this->response_data;
} $this->
process_response($response,
$options);
// Need to remove the $this reference from the curl handle.
// Otherwise \WpOrg\Requests\Transport\Curl won't be garbage collected and the curl_close() will never be called.
curl_setopt($this->handle, CURLOPT_HEADERFUNCTION, null
);
curl_setopt($this->handle, CURLOPT_WRITEFUNCTION, null
);
return $this->headers;
} /**
* Send multiple requests simultaneously
*
* @param array $requests Request data
* @param array $options Global options
* @return array Array of \WpOrg\Requests\Response objects (may contain \WpOrg\Requests\Exception or string responses as well)
*
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $requests argument is not an array or iterable object with array access.
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array.
*/