@@ -32,7 +32,6 @@ final class CurlResponse implements ResponseInterface, StreamableInterface
32
32
}
33
33
use TransportResponseTrait;
34
34
35
- private static bool $ performing = false ;
36
35
private CurlClientState $ multi ;
37
36
38
37
/**
@@ -182,7 +181,7 @@ public function __construct(CurlClientState $multi, \CurlHandle|string $ch, arra
182
181
unset($ multi ->pauseExpiries [$ id ], $ multi ->openHandles [$ id ], $ multi ->handlesActivity [$ id ]);
183
182
curl_setopt ($ ch , \CURLOPT_PRIVATE , '_0 ' );
184
183
185
- if (self :: $ performing ) {
184
+ if ($ multi -> performing ) {
186
185
return ;
187
186
}
188
187
@@ -234,13 +233,13 @@ public function getInfo(string $type = null): mixed
234
233
235
234
public function getContent (bool $ throw = true ): string
236
235
{
237
- $ performing = self :: $ performing ;
238
- self :: $ performing = $ performing || '_0 ' === curl_getinfo ($ this ->handle , \CURLINFO_PRIVATE );
236
+ $ performing = $ this -> multi -> performing ;
237
+ $ this -> multi -> performing = $ performing || '_0 ' === curl_getinfo ($ this ->handle , \CURLINFO_PRIVATE );
239
238
240
239
try {
241
240
return $ this ->doGetContent ($ throw );
242
241
} finally {
243
- self :: $ performing = $ performing ;
242
+ $ this -> multi -> performing = $ performing ;
244
243
}
245
244
}
246
245
@@ -279,7 +278,7 @@ private static function schedule(self $response, array &$runningResponses): void
279
278
*/
280
279
private static function perform (ClientState $ multi , array &$ responses = null ): void
281
280
{
282
- if (self :: $ performing ) {
281
+ if ($ multi -> performing ) {
283
282
if ($ responses ) {
284
283
$ response = current ($ responses );
285
284
$ multi ->handlesActivity [(int ) $ response ->handle ][] = null ;
@@ -290,7 +289,7 @@ private static function perform(ClientState $multi, array &$responses = null): v
290
289
}
291
290
292
291
try {
293
- self :: $ performing = true ;
292
+ $ multi -> performing = true ;
294
293
++$ multi ->execCounter ;
295
294
$ active = 0 ;
296
295
while (\CURLM_CALL_MULTI_PERFORM === ($ err = curl_multi_exec ($ multi ->handle , $ active ))) {
@@ -327,7 +326,7 @@ private static function perform(ClientState $multi, array &$responses = null): v
327
326
$ 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 )));
328
327
}
329
328
} finally {
330
- self :: $ performing = false ;
329
+ $ multi -> performing = false ;
331
330
}
332
331
}
333
332
0 commit comments