fix calculation of timeout

This commit is contained in:
Uwe Steinmann 2016-07-04 20:51:17 +02:00
parent d7898f972e
commit 5bd85e50f6

View File

@ -72,16 +72,17 @@ class SeedDMS_Preview_Previewer {
} }
$output = ''; $output = '';
$timeleft = $timeout - time();
$read = array($pipes[1]);
$write = NULL;
$exeptions = NULL;
do { do {
$timeleft = $timeout - time();
$read = array($pipes[1]);
$write = NULL;
$exeptions = NULL;
stream_select($read, $write, $exeptions, $timeleft, 200000); stream_select($read, $write, $exeptions, $timeleft, 200000);
if (!empty($read)) { if (!empty($read)) {
$output .= fread($pipes[1], 8192); $output .= fread($pipes[1], 8192);
} }
$timeleft = $timeout - time();
} while (!feof($pipes[1]) && $timeleft > 0); } while (!feof($pipes[1]) && $timeleft > 0);
if ($timeleft <= 0) { if ($timeleft <= 0) {