@@ -32,7 +32,6 @@ final class CurlResponse implements ResponseInterface, StreamableInterface
32
32
}
33
33
use TransportResponseTrait;
34
34
35
- private static $ performing = false ;
36
35
private $ multi ;
37
36
private $ debugBuffer ;
38
37
@@ -179,7 +178,7 @@ public function __construct(CurlClientState $multi, $ch, array $options = null,
179
178
unset($ multi ->pauseExpiries [$ id ], $ multi ->openHandles [$ id ], $ multi ->handlesActivity [$ id ]);
180
179
curl_setopt ($ ch , \CURLOPT_PRIVATE , '_0 ' );
181
180
182
- if (self :: $ performing ) {
181
+ if ($ multi -> performing ) {
183
182
return ;
184
183
}
185
184
@@ -237,13 +236,13 @@ public function getInfo(string $type = null)
237
236
*/
238
237
public function getContent (bool $ throw = true ): string
239
238
{
240
- $ performing = self :: $ performing ;
241
- self :: $ performing = $ performing || '_0 ' === curl_getinfo ($ this ->handle , \CURLINFO_PRIVATE );
239
+ $ performing = $ this -> multi -> performing ;
240
+ $ this -> multi -> performing = $ performing || '_0 ' === curl_getinfo ($ this ->handle , \CURLINFO_PRIVATE );
242
241
243
242
try {
244
243
return $ this ->doGetContent ($ throw );
245
244
} finally {
246
- self :: $ performing = $ performing ;
245
+ $ this -> multi -> performing = $ performing ;
247
246
}
248
247
}
249
248
@@ -287,7 +286,7 @@ private static function schedule(self $response, array &$runningResponses): void
287
286
*/
288
287
private static function perform (ClientState $ multi , array &$ responses = null ): void
289
288
{
290
- if (self :: $ performing ) {
289
+ if ($ multi -> performing ) {
291
290
if ($ responses ) {
292
291
$ response = current ($ responses );
293
292
$ multi ->handlesActivity [(int ) $ response ->handle ][] = null ;
@@ -298,7 +297,7 @@ private static function perform(ClientState $multi, array &$responses = null): v
298
297
}
299
298
300
299
try {
301
- self :: $ performing = true ;
300
+ $ multi -> performing = true ;
302
301
++$ multi ->execCounter ;
303
302
$ active = 0 ;
304
303
while (\CURLM_CALL_MULTI_PERFORM === ($ err = curl_multi_exec ($ multi ->handle , $ active ))) {
@@ -335,7 +334,7 @@ private static function perform(ClientState $multi, array &$responses = null): v
335
334
$ 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 )));
336
335
}
337
336
} finally {
338
- self :: $ performing = false ;
337
+ $ multi -> performing = false ;
339
338
}
340
339
}
341
340
0 commit comments