minor #32948 [HttpClient] Minor fixes (fancyweb)
This PR was merged into the 4.3 branch.
Discussion
----------
[HttpClient] Minor fixes
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
356341bc19
[HttpClient] Minor fixes
This commit is contained in:
commit
3a185e2519
@ -1481,7 +1481,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->info('A comma separated list of hosts that do not require a proxy to be reached.')
|
->info('A comma separated list of hosts that do not require a proxy to be reached.')
|
||||||
->end()
|
->end()
|
||||||
->floatNode('timeout')
|
->floatNode('timeout')
|
||||||
->info('Defaults to "default_socket_timeout" ini parameter.')
|
->info('The idle timeout, defaults to the "default_socket_timeout" ini parameter.')
|
||||||
->end()
|
->end()
|
||||||
->scalarNode('bindto')
|
->scalarNode('bindto')
|
||||||
->info('A network interface name, IP address, a host name or a UNIX socket to bind to.')
|
->info('A network interface name, IP address, a host name or a UNIX socket to bind to.')
|
||||||
|
@ -37,7 +37,7 @@ class MockResponse implements ResponseInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|string[]|iterable $body The response body as a string or an iterable of strings,
|
* @param string|string[]|iterable $body The response body as a string or an iterable of strings,
|
||||||
* yielding an empty string simulates a timeout,
|
* yielding an empty string simulates an idle timeout,
|
||||||
* exceptions are turned to TransportException
|
* exceptions are turned to TransportException
|
||||||
*
|
*
|
||||||
* @see ResponseInterface::getInfo() for possible info, e.g. "response_headers"
|
* @see ResponseInterface::getInfo() for possible info, e.g. "response_headers"
|
||||||
@ -277,7 +277,7 @@ class MockResponse implements ResponseInterface
|
|||||||
if (!\is_string($body)) {
|
if (!\is_string($body)) {
|
||||||
foreach ($body as $chunk) {
|
foreach ($body as $chunk) {
|
||||||
if ('' === $chunk = (string) $chunk) {
|
if ('' === $chunk = (string) $chunk) {
|
||||||
// simulate a timeout
|
// simulate an idle timeout
|
||||||
$response->body[] = new ErrorChunk($offset);
|
$response->body[] = new ErrorChunk($offset);
|
||||||
} else {
|
} else {
|
||||||
$response->body[] = $chunk;
|
$response->body[] = $chunk;
|
||||||
|
@ -580,7 +580,7 @@ abstract class HttpClientTestCase extends TestCase
|
|||||||
|
|
||||||
$response = null;
|
$response = null;
|
||||||
$this->expectException(TransportExceptionInterface::class);
|
$this->expectException(TransportExceptionInterface::class);
|
||||||
$client->request('GET', 'http://symfony.com:8057/', ['timeout' => 3]);
|
$client->request('GET', 'http://symfony.com:8057/', ['timeout' => 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testTimeoutOnAccess()
|
public function testTimeoutOnAccess()
|
||||||
@ -643,7 +643,6 @@ abstract class HttpClientTestCase extends TestCase
|
|||||||
{
|
{
|
||||||
$client = $this->getHttpClient(__FUNCTION__);
|
$client = $this->getHttpClient(__FUNCTION__);
|
||||||
|
|
||||||
$downloaded = 0;
|
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
$client->request('GET', 'http://localhost:8057/timeout-long');
|
$client->request('GET', 'http://localhost:8057/timeout-long');
|
||||||
$client = null;
|
$client = null;
|
||||||
|
Reference in New Issue
Block a user