From d2c4bf0da81a1970b871c60f5d09a500deb09314 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 4 Aug 2019 17:48:42 +0200 Subject: [PATCH] [HttpClient] use "idle" instead of "inactivity" when telling about the timeout option --- .../FrameworkBundle/DependencyInjection/Configuration.php | 2 +- src/Symfony/Component/HttpClient/Chunk/ErrorChunk.php | 2 +- src/Symfony/Contracts/HttpClient/ChunkInterface.php | 8 ++++---- src/Symfony/Contracts/HttpClient/HttpClientInterface.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 488d56aac0..b4ce6a2c6a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -1348,7 +1348,7 @@ class Configuration implements ConfigurationInterface ->info('A comma separated list of hosts that do not require a proxy to be reached.') ->end() ->floatNode('timeout') - ->info('Defaults to "default_socket_timeout" ini parameter.') + ->info('The idle timeout, defaults to the "default_socket_timeout" ini parameter.') ->end() ->scalarNode('bindto') ->info('A network interface name, IP address, a host name or a UNIX socket to bind to.') diff --git a/src/Symfony/Component/HttpClient/Chunk/ErrorChunk.php b/src/Symfony/Component/HttpClient/Chunk/ErrorChunk.php index 6b1e44f69f..d2a69bc38a 100644 --- a/src/Symfony/Component/HttpClient/Chunk/ErrorChunk.php +++ b/src/Symfony/Component/HttpClient/Chunk/ErrorChunk.php @@ -30,7 +30,7 @@ class ErrorChunk implements ChunkInterface { $this->offset = $offset; $this->error = $error; - $this->errorMessage = null !== $error ? $error->getMessage() : 'Reading from the response stream reached the inactivity timeout.'; + $this->errorMessage = null !== $error ? $error->getMessage() : 'Reading from the response stream reached the idle timeout.'; } /** diff --git a/src/Symfony/Contracts/HttpClient/ChunkInterface.php b/src/Symfony/Contracts/HttpClient/ChunkInterface.php index bbec2cdfa6..d6fd73d894 100644 --- a/src/Symfony/Contracts/HttpClient/ChunkInterface.php +++ b/src/Symfony/Contracts/HttpClient/ChunkInterface.php @@ -27,7 +27,7 @@ use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface; interface ChunkInterface { /** - * Tells when the inactivity timeout has been reached. + * Tells when the idle timeout has been reached. * * @throws TransportExceptionInterface on a network error */ @@ -36,21 +36,21 @@ interface ChunkInterface /** * Tells when headers just arrived. * - * @throws TransportExceptionInterface on a network error or when the inactivity timeout is reached + * @throws TransportExceptionInterface on a network error or when the idle timeout is reached */ public function isFirst(): bool; /** * Tells when the body just completed. * - * @throws TransportExceptionInterface on a network error or when the inactivity timeout is reached + * @throws TransportExceptionInterface on a network error or when the idle timeout is reached */ public function isLast(): bool; /** * Returns the content of the response chunk. * - * @throws TransportExceptionInterface on a network error or when the inactivity timeout is reached + * @throws TransportExceptionInterface on a network error or when the idle timeout is reached */ public function getContent(): string; diff --git a/src/Symfony/Contracts/HttpClient/HttpClientInterface.php b/src/Symfony/Contracts/HttpClient/HttpClientInterface.php index 6636af7a23..c974ba97e3 100644 --- a/src/Symfony/Contracts/HttpClient/HttpClientInterface.php +++ b/src/Symfony/Contracts/HttpClient/HttpClientInterface.php @@ -52,7 +52,7 @@ interface HttpClientInterface 'resolve' => [], // string[] - a map of host to IP address that SHOULD replace DNS resolution 'proxy' => null, // string - by default, the proxy-related env vars handled by curl SHOULD be honored 'no_proxy' => null, // string - a comma separated list of hosts that do not require a proxy to be reached - 'timeout' => null, // float - the inactivity timeout - defaults to ini_get('default_socket_timeout') + 'timeout' => null, // float - the idle timeout - defaults to ini_get('default_socket_timeout') 'bindto' => '0', // string - the interface or the local socket to bind to 'verify_peer' => true, // see https://php.net/context.ssl for the following options 'verify_host' => true, @@ -85,7 +85,7 @@ interface HttpClientInterface * Yields responses chunk by chunk as they complete. * * @param ResponseInterface|ResponseInterface[]|iterable $responses One or more responses created by the current HTTP client - * @param float|null $timeout The inactivity timeout before exiting the iterator + * @param float|null $timeout The idle timeout before yielding timeout chunks */ public function stream($responses, float $timeout = null): ResponseStreamInterface; }