<?PHP
-#could be: "uncensored.citadel.org"
-# or the path of the unix domain socket: /var/run/citadel/citadel.sock
-define('CITADEL_HOSTNAME',"127.0.0.1");
-#make it 0 to use unix domain sockets
-define('CITADEL_TCP_PORTNO','504');
+// Please override these defaults in config_ctdlclient_local.php, not here.
-#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', "");
+include "config_ctdlclient_local.php";
-?>
\ No newline at end of file
+// Examples:
+//
+// On the same host:
+// unix:///var/run/citadel/citadel.sock
+//
+// On a different host (or via loopback):
+// tcp://citserver.example.com
+// tcp://127.0.0.1
+
+if (!defined('CITADEL_HOSTNAME')) {
+ define('CITADEL_HOSTNAME',"tcp://127.0.0.1");
+}
+
+// make it 0 to use unix domain sockets
+if (!defined('CITADEL_TCP_PORTNO')) {
+ define('CITADEL_TCP_PORTNO','504');
+}
+
+// do you want to see the server conversation for exploring the protocol?
+if (!defined('CITADEL_DEBUG_CITPROTO')) {
+ define('CITADEL_DEBUG_CITPROTO',0);
+}
+if (!defined('CITADEL_DEBUG_PROXY')) {
+ define('CITADEL_DEBUG_PROXY', FALSE);
+}
+
+?>
$sockname = "/tmp/" . $session . ".socket" ;
- $clientsocket = fsockopen(SOCKET_PREFIX.$sockname, 0, $errno, $errstr, 5);
+ $clientsocket = fsockopen('unix://' . $sockname, 0, $errno, $errstr, 5);
if (!$clientsocket) {
// It ain't there, dude. Open up the proxy. (C version)
//$cmd = "./sessionproxy " . $sockname ;
// Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
// This program is released under the terms of the GNU General Public License.
+global $msgsock;
// sock_gets() -- reads one line of text from a socket
//
-$msgsock;
if (CITADEL_DEBUG_PROXY)
{
define_syslog_variables();
// We need to get a connection to the Citadel server going now.
-$ctdlsock = fsockopen(SOCKET_PREFIX.CITADEL_HOSTNAME, CITADEL_TCP_PORTNO, $errno, $errstr, 30);
+$ctdlsock = fsockopen(CITADEL_HOSTNAME, CITADEL_TCP_PORTNO, $errno, $errstr, 30);
if (!$ctdlsock) {
socket_close ($sock);
system("/bin/rm -f " . $sockname);