Skip to content

Commit cf34137

Browse files
Merge branch '4.4' into 5.3
* 4.4: Fix tests on PHP 8.1 [Cache] Fix memory leak [DependencyInjection] fix inlining when non-shared services are involved [DoctrineBridge] add support for the JSON type [PHPUnitBridge] Fix Uncaught ValueError [FrameworkBundle] fix registering late resettable services [Validator] Missing translations for Greek (el) translate for japanese 101,102,103 [HttpClient] Curl http client has to reinit curl multi handle on reset [Validator] Add Swedish translation for issue #43737
2 parents 290eb48 + c5d182e commit cf34137

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Internal/CurlClientState.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ public function reset()
6666
curl_setopt($ch, \CURLOPT_VERBOSE, false);
6767
}
6868
}
69+
70+
curl_multi_close($this->handle);
71+
$this->handle = curl_multi_init();
6972
}
7073

7174
public function __sleep(): array

Tests/CurlHttpClientTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ public function testTimeoutIsNotAFatalError()
5959
parent::testTimeoutIsNotAFatalError();
6060
}
6161

62+
public function testHandleIsReinitOnReset()
63+
{
64+
$httpClient = $this->getHttpClient(__FUNCTION__);
65+
66+
$r = new \ReflectionProperty($httpClient, 'multi');
67+
$r->setAccessible(true);
68+
$clientState = $r->getValue($httpClient);
69+
$initialHandleId = (int) $clientState->handle;
70+
$httpClient->reset();
71+
self::assertNotSame($initialHandleId, (int) $clientState->handle);
72+
}
73+
6274
public function testOverridingRefererUsingCurlOptions()
6375
{
6476
$httpClient = $this->getHttpClient(__FUNCTION__);

0 commit comments

Comments
 (0)