Skip to content

Commit c32cff9

Browse files
committed
Fixed size check issue.
1 parent 90da15f commit c32cff9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

extensions/50_run_process.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function UpdateStreamsAndTimeout($prefix, &$timeout, &$readfps, &$writefp
216216

217217
// Handle stdout and stderr.
218218
$streams = false;
219-
if (isset($info["pipes"][1]) && $info["stdoutdata"] < 65536)
219+
if (isset($info["pipes"][1]) && strlen($info["stdoutdata"]) < 65536)
220220
{
221221
$data = fread($info["pipes"][1], 65536);
222222
if ($data === false || ($data === "" && feof($info["pipes"][1])))
@@ -234,7 +234,7 @@ public function UpdateStreamsAndTimeout($prefix, &$timeout, &$readfps, &$writefp
234234
}
235235
}
236236

237-
if (isset($info["pipes"][2]) && $info["stderrdata"] < 65536)
237+
if (isset($info["pipes"][2]) && strlen($info["stderrdata"]) < 65536)
238238
{
239239
$data = fread($info["pipes"][2], 65536);
240240
if ($data === false || ($data === "" && feof($info["pipes"][2])))
@@ -258,8 +258,8 @@ public function UpdateStreamsAndTimeout($prefix, &$timeout, &$readfps, &$writefp
258258
}
259259
}
260260

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];
263263

264264
$ws = false;
265265
if ($info["attached"] !== false)
@@ -1177,7 +1177,7 @@ public function ServerDone()
11771177
// Attempt to gracefully shutdown running processes.
11781178
foreach ($this->processes as $cid => &$info)
11791179
{
1180-
if ($info["state"] !== "running") unset($this->processes[$id]);
1180+
if ($info["state"] !== "running") unset($this->processes[$cid]);
11811181
else
11821182
{
11831183
$info["attached"] = false;

0 commit comments

Comments
 (0)