* socket syntax is different in php5. make it configurable.
authorWilfried Göesgens <willi@citadel.org>
Mon, 23 Jul 2007 18:45:45 +0000 (18:45 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 23 Jul 2007 18:45:45 +0000 (18:45 +0000)
ctdlphp/config_ctdlclient.php
ctdlphp/ctdlsession.php
ctdlphp/sessionproxy.php

index 96676a622493b9aca3357bcbbdb44d1ca9c23df2..bfedf45fcb8f7e43034d3e71e5a17d2a7b67e35e 100644 (file)
@@ -9,4 +9,8 @@ define('CITADEL_TCP_PORTNO','504');
 #do you want to see the server conversation for exploring the protocol?
 define('CITADEL_DEBUG_CITPROTO',0);
 define('CITADEL_DEBUG_PROXY', FALSE);
+#switch this if you're using php5
+#define('SOCKET_PREFIX', "unix://");
+define('SOCKET_PREFIX', "");
+
 ?>
\ No newline at end of file
index 640f4ecfe14ab1e4a74b0d03e410208c8e771027..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 ;
index 681ee1af5175918db506e55df1ab1a0dd1e643e4..fdb7b699dfbfe98dd4c68dc31b1d74ca63706903 100755 (executable)
@@ -96,7 +96,7 @@ chmod($sockname, 0600);
 
 // We need to get a connection to the Citadel server going now.
 
-$ctdlsock = fsockopen(CITADEL_HOSTNAME, CITADEL_TCP_PORTNO, $errno, $errstr, 30);
+$ctdlsock = fsockopen(SOCKET_PREFIX.CITADEL_HOSTNAME, CITADEL_TCP_PORTNO, $errno, $errstr, 30);
 if (!$ctdlsock) {
        socket_close ($sock);
        system("/bin/rm -f " . $sockname);