From e3111d568164aa1f0d3bd303e3b80dcb6f375047 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Sat, 27 Feb 2010 19:55:26 +0100 Subject: Fixed status --- streamstatus.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/streamstatus.php b/streamstatus.php index cbcf396..dc05bc3 100755 --- a/streamstatus.php +++ b/streamstatus.php @@ -12,14 +12,22 @@ echo "\n"; echo "\n"; +$session = $_REQUEST['session']; + +exec('echo ' .$session .' >/tmp/aa'); + // First check that we are allowed to create a new encoding process -$nbencprocess = exec("find ram/ -name segmenter.pid | wc | awk '{ print $1 }'"); -if ($nbencprocess >= $maxencodingprocesses) - echo "errorError: maximun number of sessions reached\n"; -else +if (($session == "") || !count(glob('ram/' .$session))) { - $session = $_REQUEST['session']; + $nbencprocess = exec("find ram/ -name segmenter.pid | wc | awk '{ print $1 }'"); + if ($nbencprocess >= $maxencodingprocesses) + echo "errorError: maximun number of sessions reached\n"; + else + echo "errorError: cannot create session\n"; +} +else +{ $cnt = 0; while ( ( count(glob('ram/' .$session . '/*.ts')) < 2 ) && ( $cnt < 25 ) ) { -- cgit v1.2.3