Skip to content

Commit 7957b48

Browse files
committed
bug symfony#41624 [HttpClient] Revert bindto workaround for unaffected PHP versions (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] Revert bindto workaround for unaffected PHP versions | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix symfony#41622 | License | MIT | Doc PR | N/A This PR reverts the changes of symfony#38086 for PHP versions that don't need that workaround. Commits ------- e9afce3 [HttpClient] Revert bindto workaround
2 parents 7ca0995 + e9afce3 commit 7957b48

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Component/HttpClient/NativeHttpClient.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ public function request(string $method, string $url, array $options = []): Respo
193193
$options['timeout'] = min($options['max_duration'], $options['timeout']);
194194
}
195195

196+
$bindto = $options['bindto'];
197+
if (!$bindto && (70322 === \PHP_VERSION_ID || 70410 === \PHP_VERSION_ID)) {
198+
$bindto = '0:0';
199+
}
200+
196201
$context = [
197202
'http' => [
198203
'protocol_version' => min($options['http_version'] ?: '1.1', '1.1'),
@@ -221,7 +226,7 @@ public function request(string $method, string $url, array $options = []): Respo
221226
'disable_compression' => true,
222227
], static function ($v) { return null !== $v; }),
223228
'socket' => [
224-
'bindto' => $options['bindto'] ?: '0:0',
229+
'bindto' => $bindto,
225230
'tcp_nodelay' => true,
226231
],
227232
];

0 commit comments

Comments
 (0)