Skip to content

Commit 710b69e

Browse files
committed
Merge branch '4.4' into 5.3
* 4.4: (29 commits) fix: Improve FR validators translation 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 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" added missing translation for galician Add missing translation in Vietnamese Add missing translation in Bulgarian added missing translations for portuguese [#43450] Add missing validator slovak translation ...
2 parents 8143b1b + 9a5fdf1 commit 710b69e

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
@@ -247,13 +247,15 @@ public function getContent(bool $throw = true): string
247247

248248
public function __destruct()
249249
{
250-
curl_setopt($this->handle, \CURLOPT_VERBOSE, false);
250+
try {
251+
if (null === $this->timeout) {
252+
return; // Unused pushed response
253+
}
251254

252-
if (null === $this->timeout) {
253-
return; // Unused pushed response
255+
$this->doDestruct();
256+
} finally {
257+
curl_setopt($this->handle, \CURLOPT_VERBOSE, false);
254258
}
255-
256-
$this->doDestruct();
257259
}
258260

259261
/**

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)