Вход Регистрация
Файл: vkolhoze.com/vendor/guzzle/guzzle/src/Guzzle/Plugin/Backoff/CurlBackoffStrategy.php
Строк: 27
<?php

namespace GuzzlePluginBackoff;

use 
GuzzleHttpMessageRequestInterface;
use 
GuzzleHttpMessageResponse;
use 
GuzzleHttpExceptionHttpException;
use 
GuzzleHttpExceptionCurlException;

/**
 * Strategy used to retry when certain cURL error codes are encountered.
 */
class CurlBackoffStrategy extends AbstractErrorCodeBackoffStrategy
{
    
/** @var array Default cURL errors to retry */
    
protected static $defaultErrorCodes = array(
        
CURLE_COULDNT_RESOLVE_HOSTCURLE_COULDNT_CONNECTCURLE_PARTIAL_FILECURLE_WRITE_ERRORCURLE_READ_ERROR,
        
CURLE_OPERATION_TIMEOUTEDCURLE_SSL_CONNECT_ERRORCURLE_HTTP_PORT_FAILEDCURLE_GOT_NOTHING,
        
CURLE_SEND_ERRORCURLE_RECV_ERROR
    
);

    protected function 
getDelay($retriesRequestInterface $requestResponse $response nullHttpException $e null)
    {
        if (
$e && $e instanceof CurlException) {
            return isset(
$this->errorCodes[$e->getErrorNo()]) ? true null;
        }
    }
}
Онлайн: 0
Реклама