File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -360,6 +360,9 @@ public function reset()
360360 curl_setopt ($ ch , \CURLOPT_VERBOSE , false );
361361 }
362362 }
363+
364+ curl_multi_close ($ this ->multi ->handle );
365+ $ this ->multi ->handle = curl_multi_init ();
363366 }
364367
365368 /**
Original file line number Diff line number Diff line change @@ -136,6 +136,18 @@ public function testTimeoutIsNotAFatalError()
136136 parent ::testTimeoutIsNotAFatalError ();
137137 }
138138
139+ public function testHandleIsReinitOnReset ()
140+ {
141+ $ httpClient = $ this ->getHttpClient (__FUNCTION__ );
142+
143+ $ r = new \ReflectionProperty ($ httpClient , 'multi ' );
144+ $ r ->setAccessible (true );
145+ $ clientState = $ r ->getValue ($ httpClient );
146+ $ initialHandleId = (int ) $ clientState ->handle ;
147+ $ httpClient ->reset ();
148+ self ::assertNotSame ($ initialHandleId , (int ) $ clientState ->handle );
149+ }
150+
139151 private function getVulcainClient (): CurlHttpClient
140152 {
141153 if (\PHP_VERSION_ID >= 70300 && \PHP_VERSION_ID < 70304 ) {
You can’t perform that action at this time.
0 commit comments