@@ -216,7 +216,7 @@ public function UpdateStreamsAndTimeout($prefix, &$timeout, &$readfps, &$writefp
216
216
217
217
// Handle stdout and stderr.
218
218
$ streams = false ;
219
- if (isset ($ info ["pipes " ][1 ]) && $ info ["stdoutdata " ] < 65536 )
219
+ if (isset ($ info ["pipes " ][1 ]) && strlen ( $ info ["stdoutdata " ]) < 65536 )
220
220
{
221
221
$ data = fread ($ info ["pipes " ][1 ], 65536 );
222
222
if ($ data === false || ($ data === "" && feof ($ info ["pipes " ][1 ])))
@@ -234,7 +234,7 @@ public function UpdateStreamsAndTimeout($prefix, &$timeout, &$readfps, &$writefp
234
234
}
235
235
}
236
236
237
- if (isset ($ info ["pipes " ][2 ]) && $ info ["stderrdata " ] < 65536 )
237
+ if (isset ($ info ["pipes " ][2 ]) && strlen ( $ info ["stderrdata " ]) < 65536 )
238
238
{
239
239
$ data = fread ($ info ["pipes " ][2 ], 65536 );
240
240
if ($ data === false || ($ data === "" && feof ($ info ["pipes " ][2 ])))
@@ -258,8 +258,8 @@ public function UpdateStreamsAndTimeout($prefix, &$timeout, &$readfps, &$writefp
258
258
}
259
259
}
260
260
261
- if (isset ($ info ["pipes " ][1 ]) && $ info ["stdoutdata " ] < 65536 ) $ readfps [$ prefix . $ cid . "_o " ] = $ info ["pipes " ][1 ];
262
- if (isset ($ info ["pipes " ][2 ]) && $ info ["stderrdata " ] < 65536 ) $ readfps [$ prefix . $ cid . "_e " ] = $ info ["pipes " ][2 ];
261
+ if (isset ($ info ["pipes " ][1 ]) && strlen ( $ info ["stdoutdata " ]) < 65536 ) $ readfps [$ prefix . $ cid . "_o " ] = $ info ["pipes " ][1 ];
262
+ if (isset ($ info ["pipes " ][2 ]) && strlen ( $ info ["stderrdata " ]) < 65536 ) $ readfps [$ prefix . $ cid . "_e " ] = $ info ["pipes " ][2 ];
263
263
264
264
$ ws = false ;
265
265
if ($ info ["attached " ] !== false )
@@ -1177,7 +1177,7 @@ public function ServerDone()
1177
1177
// Attempt to gracefully shutdown running processes.
1178
1178
foreach ($ this ->processes as $ cid => &$ info )
1179
1179
{
1180
- if ($ info ["state " ] !== "running " ) unset($ this ->processes [$ id ]);
1180
+ if ($ info ["state " ] !== "running " ) unset($ this ->processes [$ cid ]);
1181
1181
else
1182
1182
{
1183
1183
$ info ["attached " ] = false ;
0 commit comments