Merge branch '4.4' into 5.2

* 4.4:
  [HttpClient] Revert bindto workaround
This commit is contained in:
Alexander M. Turek 2021-06-08 20:04:30 +02:00
commit 6ff8926d69

View File

@ -187,6 +187,11 @@ final class NativeHttpClient implements HttpClientInterface, LoggerAwareInterfac
$options['timeout'] = min($options['max_duration'], $options['timeout']);
}
$bindto = $options['bindto'];
if (!$bindto && (70322 === \PHP_VERSION_ID || 70410 === \PHP_VERSION_ID)) {
$bindto = '0:0';
}
$context = [
'http' => [
'protocol_version' => min($options['http_version'] ?: '1.1', '1.1'),
@ -215,7 +220,7 @@ final class NativeHttpClient implements HttpClientInterface, LoggerAwareInterfac
'disable_compression' => true,
], static function ($v) { return null !== $v; }),
'socket' => [
'bindto' => $options['bindto'] ?: '0:0',
'bindto' => $bindto,
'tcp_nodelay' => true,
],
];