Skip to content

Commit 76cc56c

Browse files
Merge branch '4.3' into 4.4
* 4.3: [FrameworkBundle] Fix framework bundle lock configuration not working as expected [Validator] Add the missing translations for the Azerbaijani locale [HttpClient] workaround bad Content-Length sent by old libcurl [Cache] dont override native Memcached options Fix CS Fix exceptions (PDOException) error code type Fix return type of Process::restart(). [Cache] fail gracefully when locking is not supported [HttpClient] fix race condition when reading response with informational status Names for buttons should start with lowercase
2 parents 4abe41d + 26f4b1d commit 76cc56c

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

CurlHttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public function request(string $method, string $url, array $options = []): Respo
269269
if ('POST' !== $method) {
270270
$curlopts[CURLOPT_UPLOAD] = true;
271271
}
272-
} elseif ('' !== $body) {
272+
} elseif ('' !== $body || 'POST' === $method) {
273273
$curlopts[CURLOPT_POSTFIELDS] = $body;
274274
}
275275

@@ -383,7 +383,7 @@ private static function handlePush($parent, $pushed, array $requestHeaders, Curl
383383
*/
384384
private static function acceptPushForRequest(string $method, array $options, PushedResponse $pushedResponse): bool
385385
{
386-
if ($options['body'] || $method !== $pushedResponse->requestHeaders[':method'][0]) {
386+
if ('' !== $options['body'] || $method !== $pushedResponse->requestHeaders[':method'][0]) {
387387
return false;
388388
}
389389

Response/CurlResponse.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,17 @@ public function __construct(CurlClientState $multi, $ch, array $options = null,
133133

134134
if (\in_array($waitFor, ['headers', 'destruct'], true)) {
135135
try {
136-
self::stream([$response])->current();
136+
foreach (self::stream([$response]) as $chunk) {
137+
if ($chunk->isFirst()) {
138+
break;
139+
}
140+
}
137141
} catch (\Throwable $e) {
138142
// Persist timeouts thrown during initialization
139143
$response->info['error'] = $e->getMessage();
140144
$response->close();
141145
throw $e;
142146
}
143-
} elseif ('content' === $waitFor && ($response->multi->handlesActivity[$response->id][0] ?? null) instanceof FirstChunk) {
144-
self::stream([$response])->current();
145147
}
146148

147149
curl_setopt($ch, CURLOPT_HEADERFUNCTION, null);

Response/NativeResponse.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ public function __construct(NativeClientState $multi, $context, string $url, $op
6767
}
6868

6969
if (null === $response->remaining) {
70-
self::stream([$response])->current();
70+
foreach (self::stream([$response]) as $chunk) {
71+
if ($chunk->isFirst()) {
72+
break;
73+
}
74+
}
7175
}
7276
};
7377
}

0 commit comments

Comments
 (0)