Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 98acf1c

Browse filesBrowse files
committed
bug #37400 [HttpClient] unset activity list when creating CurlResponse (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] unset activity list when creating CurlResponse | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This might fix an error that looks like a race condition. I've seen it, and @Toflar too, but we're unable to reproduce. > Argument 2 passed to Symfony\Component\HttpClient\Chunk\DataChunk::__construct() must be of the type string, null given This patch tentatively empties activity lists. If the issue is related to the PHP engine reusing resource ids, this will fix it. Otherwise, we'll know we'll have to look elsewhere. > looking at https://github.com/symfony/http-client/blob/4.4/Response/ResponseTrait.php#L363 I don’t really see how this can happen other than inflate_add() returning null > $response->inflate is true before becoming a resource; there must be a race condition in the curl client that ends up listing a data chunk before a FirstChunk in the activity list, which would explain why inflate_add is given a non-resource (`true`). Commits ------- b249f00 [HttpClient] unset activity list when creating CurlResponse
2 parents 030b10c + b249f00 commit 98acf1c
Copy full SHA for 98acf1c

File tree

1 file changed

+1
-0
lines changed
Filter options

1 file changed

+1
-0
lines changed

‎src/Symfony/Component/HttpClient/Response/CurlResponse.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/Response/CurlResponse.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function __construct(CurlClientState $multi, $ch, array $options = null,
4343
$this->multi = $multi;
4444

4545
if (\is_resource($ch)) {
46+
unset($multi->handlesActivity[(int) $ch]);
4647
$this->handle = $ch;
4748
$this->debugBuffer = fopen('php://temp', 'w+');
4849
if (0x074000 === $curlVersion) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.