Skip to content

Commit f95c06b

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: (35 commits) fix: Improve FR validators translation [Notifier] Add push channel to notifier Fix CS [Lock] Split PdoStore into DoctrineDbalStore [Cache] Split PdoAdapter into DoctrineDbalAdapter Add swedish translation for issue #43458 [HttpClient] fix collecting debug info on destruction of CurlResponse Fix CS added missing thai translations Add missing translations for Chinese (zh_TW) [DependencyInjection] fix "url" env var processor update translation [Serializer] symfony#36594 attributes cache breaks normalization Remove untranslated translation for Afrikaans [Validator] Add missing validator polish translation [Security,Validator] Added missing Latvian translations #41053 Add the missing translations for Indonesian (id) [Validator] Add missing Lithuanian translation [Validator] Add missing Czech translation replace "ispravna" with "važeća" in translating "valid HTML/CSS" ...
2 parents c2a64d4 + 97749d5 commit f95c06b

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

Response/CurlResponse.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,15 @@ public function getContent(bool $throw = true): string
249249

250250
public function __destruct()
251251
{
252-
curl_setopt($this->handle, \CURLOPT_VERBOSE, false);
252+
try {
253+
if (null === $this->timeout) {
254+
return; // Unused pushed response
255+
}
253256

254-
if (null === $this->timeout) {
255-
return; // Unused pushed response
257+
$this->doDestruct();
258+
} finally {
259+
curl_setopt($this->handle, \CURLOPT_VERBOSE, false);
256260
}
257-
258-
$this->doDestruct();
259261
}
260262

261263
/**

Tests/HttpClientTestCase.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,4 +361,16 @@ public function testHandleIsRemovedOnException()
361361
$this->assertCount(0, $clientState->openHandles);
362362
}
363363
}
364+
365+
public function testDebugInfoOnDestruct()
366+
{
367+
$client = $this->getHttpClient(__FUNCTION__);
368+
369+
$traceInfo = [];
370+
$client->request('GET', 'http://localhost:8057', ['on_progress' => function (int $dlNow, int $dlSize, array $info) use (&$traceInfo) {
371+
$traceInfo = $info;
372+
}]);
373+
374+
$this->assertNotEmpty($traceInfo['debug']);
375+
}
364376
}

0 commit comments

Comments
 (0)