]> code.citadel.org Git - citadel.git/blobdiff - ctdlphp/ctdlsession.php
* socket syntax is different in php5. make it configurable.
[citadel.git] / ctdlphp / ctdlsession.php
index 3ee4984311e9443a14632ff1b1db9a099fac3d5c..988839cc885286be72454637a97b9aa0c5a416f7 100644 (file)
@@ -35,7 +35,7 @@ function establish_citadel_session() {
 
        $sockname = "/tmp/" . $session . ".socket" ;
 
-       $clientsocket = fsockopen($sockname, 0, $errno, $errstr, 5);
+       $clientsocket = fsockopen(SOCKET_PREFIX.$sockname, 0, $errno, $errstr, 5);
        if (!$clientsocket) {
                // It ain't there, dude.  Open up the proxy. (C version)
                //$cmd = "./sessionproxy " . $sockname ;
@@ -43,16 +43,17 @@ function establish_citadel_session() {
 
                // It ain't there, dude.  Open up the proxy.  (PHP version)
                if (CITADEL_DEBUG_PROXY){
-                       $stdout = '>>/tmp/sessionproxyout.txt';
+                       $stdout = '>>/tmp/sessionproxyout.txt ';
                }
                else{
-                       $stdout = '>/dev/null';
+                       $stdout = '>/dev/null ';
                }
 
                $cmd = "./sessionproxy.php " . $sockname .
                        " </dev/null ".$stdout."2>&1 " .
                        " 3>&1 4>&1 5>&1 6>&1 7>&1 8>&1 & " ;
                exec($cmd);
+               sleep(1);
 
                // Keep attempting connections 10 times per second up to 100 times
                $attempts = 0;