Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit efb6414

Browse files
bug #30755 [HttpClient] correctly clean state on destruct in CurlResponse (nicolas-grekas)
This PR was merged into the 4.3-dev branch. Discussion ---------- [HttpClient] correctly clean state on destruct in CurlResponse | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30753 | License | MIT | Doc PR | - On destruct, we ask curl to close the stream once the headers arrived, but we don't silence the "error" this sets in curl. This fixes it. Commits ------- 332a88c [HttpClient] correctly clean state on destruct in CurlResponse
2 parents c30f462 + 332a88c commit efb6414

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ protected static function perform(\stdClass $multi, array &$responses = null): v
231231

232232
while ($info = curl_multi_info_read($multi->handle)) {
233233
$multi->handlesActivity[(int) $info['handle']][] = null;
234-
$multi->handlesActivity[(int) $info['handle']][] = \in_array($info['result'], [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) ? null : new TransportException(curl_error($info['handle']));
234+
$multi->handlesActivity[(int) $info['handle']][] = \in_array($info['result'], [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || (\CURLE_WRITE_ERROR === $info['result'] && 'destruct' === @curl_getinfo($info['handle'], CURLINFO_PRIVATE)) ? null : new TransportException(curl_error($info['handle']));
235235
}
236236
} finally {
237237
self::$performing = false;

0 commit comments

Comments
 (0)