From: Wilfried Göesgens Date: Mon, 23 Jul 2007 18:45:45 +0000 (+0000) Subject: * socket syntax is different in php5. make it configurable. X-Git-Tag: v7.86~3210 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=9205901a46cffb2b291a8ec5b24e1afaed2080b9 * socket syntax is different in php5. make it configurable. --- diff --git a/ctdlphp/config_ctdlclient.php b/ctdlphp/config_ctdlclient.php index 96676a622..bfedf45fc 100644 --- a/ctdlphp/config_ctdlclient.php +++ b/ctdlphp/config_ctdlclient.php @@ -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 diff --git a/ctdlphp/ctdlsession.php b/ctdlphp/ctdlsession.php index 640f4ecfe..988839cc8 100644 --- a/ctdlphp/ctdlsession.php +++ b/ctdlphp/ctdlsession.php @@ -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 ; diff --git a/ctdlphp/sessionproxy.php b/ctdlphp/sessionproxy.php index 681ee1af5..fdb7b699d 100755 --- a/ctdlphp/sessionproxy.php +++ b/ctdlphp/sessionproxy.php @@ -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);