Skip to content

Commit

Permalink
bug #37190 [HttpClient] disable AMP's inactivity timeout, we deal wit…
Browse files Browse the repository at this point in the history
…h it on our own already (nicolas-grekas)

This PR was merged into the 5.1 branch.

Discussion
----------

[HttpClient] disable AMP's inactivity timeout, we deal with it on our own already

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36911
| License       | MIT
| Doc PR        | -

I encountered this today also.

Commits
-------

a7b18ff [HttpClient] disable AMP's inactivity timeout, we deal with it on our own already
  • Loading branch information
fabpot committed Jun 11, 2020
2 parents 7c892ee + a7b18ff commit 8169581
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Symfony/Component/HttpClient/AmpHttpClient.php
Expand Up @@ -120,6 +120,9 @@ public function request(string $method, string $url, array $options = []): Respo
$request->setTcpConnectTimeout(1000 * $options['timeout']);
$request->setTlsHandshakeTimeout(1000 * $options['timeout']);
$request->setTransferTimeout(1000 * $options['max_duration']);
if (method_exists($request, 'setInactivityTimeout')) {
$request->setInactivityTimeout(0);
}

if ('' !== $request->getUri()->getUserInfo() && !$request->hasHeader('authorization')) {
$auth = explode(':', $request->getUri()->getUserInfo(), 2);
Expand Down

0 comments on commit 8169581

Please sign in to comment.