Skip to content

Commit c7fd9db

Browse files
committed
Merge branch '5.2' into 5.3
* 5.2: [HttpClient] Revert bindto workaround
2 parents ef85ca5 + f287c41 commit c7fd9db

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

NativeHttpClient.php

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

190+
$bindto = $options['bindto'];
191+
if (!$bindto && (70322 === \PHP_VERSION_ID || 70410 === \PHP_VERSION_ID)) {
192+
$bindto = '0:0';
193+
}
194+
190195
$context = [
191196
'http' => [
192197
'protocol_version' => min($options['http_version'] ?: '1.1', '1.1'),
@@ -215,7 +220,7 @@ public function request(string $method, string $url, array $options = []): Respo
215220
'disable_compression' => true,
216221
], static function ($v) { return null !== $v; }),
217222
'socket' => [
218-
'bindto' => $options['bindto'] ?: '0:0',
223+
'bindto' => $bindto,
219224
'tcp_nodelay' => true,
220225
],
221226
];

0 commit comments

Comments
 (0)