YoastSEO_Vendor\GuzzleHttp\Handler
CurlFactory::retryFailedRewind() private Yoast 1.0
This function ensures that a response was set on a transaction. If one was not set, then the request is retried if possible. This error typically means you are sending a payload, curl encountered a "Connection died, retrying a fresh connect" error, tried to rewind the stream, and then encountered a "necessary data rewind wasn't possible" error, causing the request to be sent through curl_multi_info_read() without an error status.
{} Это метод класса: CurlFactory{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$result = CurlFactory::retryFailedRewind( $handler, \YoastSEO_Vendor\GuzzleHttp\Handler\EasyHandle $easy, $ctx );
Код CurlFactory::retryFailedRewind() CurlFactory::retryFailedRewind Yoast 15.6.2
private static function retryFailedRewind(callable $handler, \YoastSEO_Vendor\GuzzleHttp\Handler\EasyHandle $easy, array $ctx)
{
try {
// Only rewind if the body has been read from.
$body = $easy->request->getBody();
if ($body->tell() > 0) {
$body->rewind();
}
} catch (\RuntimeException $e) {
$ctx['error'] = 'The connection unexpectedly failed without ' . 'providing an error. The request would have been retried, ' . 'but attempting to rewind the request body failed. ' . 'Exception: ' . $e;
return self::createRejection($easy, $ctx);
}
// Retry no more than 3 times before giving up.
if (!isset($easy->options['_curl_retries'])) {
$easy->options['_curl_retries'] = 1;
} elseif ($easy->options['_curl_retries'] == 2) {
$ctx['error'] = 'The cURL request was retried 3 times ' . 'and did not succeed. The most likely reason for the failure ' . 'is that cURL was unable to rewind the body of the request ' . 'and subsequent retries resulted in the same error. Turn on ' . 'the debug option to see what went wrong. See ' . 'https://bugs.php.net/bug.php?id=47204 for more information.';
return self::createRejection($easy, $ctx);
} else {
$easy->options['_curl_retries']++;
}
return $handler($easy->request, $easy->options);
}