File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -538,9 +538,7 @@ public function wait_for_response($requestId, $timeoutMs = 0) {
538
538
// but still not get the response requested
539
539
$ startTime = microtime (true );
540
540
541
- do {
542
- $ resp = $ this ->readPacket ();
543
-
541
+ while ($ resp = $ this ->readPacket ()) {
544
542
if ($ resp ['type ' ] == self ::STDOUT || $ resp ['type ' ] == self ::STDERR ) {
545
543
if ($ resp ['type ' ] == self ::STDERR ) {
546
544
$ this ->_requests [$ resp ['requestId ' ]]['state ' ] = self ::REQ_STATE_ERR ;
@@ -549,7 +547,7 @@ public function wait_for_response($requestId, $timeoutMs = 0) {
549
547
}
550
548
if ($ resp ['type ' ] == self ::END_REQUEST ) {
551
549
$ this ->_requests [$ resp ['requestId ' ]]['state ' ] = self ::REQ_STATE_OK ;
552
- if ($ resp ['requestId ' ] == $ requestId ) {
550
+ if ($ resp ['requestId ' ] == $ requestId ) {
553
551
break ;
554
552
}
555
553
}
@@ -558,7 +556,7 @@ public function wait_for_response($requestId, $timeoutMs = 0) {
558
556
$ this ->set_ms_timeout ($ this ->_readWriteTimeout );
559
557
throw new \Exception ('Timed out ' );
560
558
}
561
- } while ( $ resp );
559
+ }
562
560
563
561
if (!is_array ($ resp )) {
564
562
$ info = stream_get_meta_data ($ this ->_sock );
You can’t perform that action at this time.
0 commit comments