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 80079f5

Browse filesBrowse files
committed
Handle empty response data correctly
curl will return -1.0 for CURLINFO_CONTENT_LENGTH_DOWNLOAD since 7.19.4 if not known (means not specified by the server response). When handling data for empty responses, this will cause us to compare 0.0 (CURLINFO_SIZE_DOWNLOAD) with -1.0 (CURLINFO_CONTENT_LENGTH_DOWNLOAD) and thus error out with SSL error 0 then (which means normal close). We therefore now explicitly allow to download 0 bytes, when no size has been indicated.
1 parent 60ffe2d commit 80079f5
Copy full SHA for 80079f5

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
@@ -321,6 +321,7 @@ private static function perform(ClientState $multi, ?array &$responses = null):
321321

322322
$multi->handlesActivity[$id][] = null;
323323
$multi->handlesActivity[$id][] = \in_array($result, [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || '_0' === $waitFor || curl_getinfo($ch, \CURLINFO_SIZE_DOWNLOAD) === curl_getinfo($ch, \CURLINFO_CONTENT_LENGTH_DOWNLOAD) ? null : new TransportException(ucfirst(curl_error($ch) ?: curl_strerror($result)).sprintf(' for "%s".', curl_getinfo($ch, \CURLINFO_EFFECTIVE_URL)));
324+
$multi->handlesActivity[$id][] = \in_array($result, [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || '_0' === $waitFor || curl_getinfo($ch, \CURLINFO_SIZE_DOWNLOAD) === curl_getinfo($ch, \CURLINFO_CONTENT_LENGTH_DOWNLOAD) || (0.0 === curl_getinfo($ch, \CURLINFO_SIZE_DOWNLOAD) && -1.0 === curl_getinfo($ch, \CURLINFO_CONTENT_LENGTH_DOWNLOAD)) ? null : new TransportException(ucfirst(curl_error($ch) ?: curl_strerror($result)).sprintf(' for "%s".', curl_getinfo($ch, \CURLINFO_EFFECTIVE_URL)));
324325
}
325326
} finally {
326327
$multi->performing = false;

0 commit comments

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