From: Vlad S. <ser...@us...> - 2005-06-10 17:23:31
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8742/nsd Modified Files: binder.c driver.c Log Message: Use Ns_PathIsAbsolute for determining valid pathname Index: driver.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/driver.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** driver.c 21 May 2005 14:17:05 -0000 1.7 --- driver.c 10 Jun 2005 17:23:21 -0000 1.8 *************** *** 336,345 **** /* * Determine the port and then set the HTTP location string either * as specified in the config file or constructed from the * hostname and port. */ - - drvPtr->bindaddr = bindaddr; drvPtr->address = ns_strdup(address); if (!Ns_ConfigGetInt(path, "port", &drvPtr->port)) { --- 336,352 ---- /* + * Check if bind address represent valid pathname and if so + * switch driver to Unix domain sockets mode + */ + drvPtr->bindaddr = bindaddr; + if (drvPtr->bindaddr && Ns_PathIsAbsolute(drvPtr->bindaddr)) { + drvPtr->opts |= NS_DRIVER_UNIX; + } + + /* * Determine the port and then set the HTTP location string either * as specified in the config file or constructed from the * hostname and port. */ drvPtr->address = ns_strdup(address); if (!Ns_ConfigGetInt(path, "port", &drvPtr->port)) { *************** *** 434,440 **** drvPtr = firstDrvPtr; while (drvPtr != NULL) { - if (drvPtr->bindaddr && drvPtr->bindaddr[0] == '/') { - drvPtr->opts |= NS_DRIVER_UNIX; - } if (drvPtr->opts & NS_DRIVER_UDP) { drvPtr->sock = Ns_SockListenUdp(drvPtr->bindaddr, drvPtr->port); --- 441,444 ---- Index: binder.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/binder.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** binder.c 10 Jun 2005 14:39:26 -0000 1.6 --- binder.c 10 Jun 2005 17:23:21 -0000 1.7 *************** *** 637,641 **** } ! if (*line == '/') { hPtr = Tcl_CreateHashEntry(&preboundUnix, (char *) line, &new); if (!new) { --- 637,641 ---- } ! if (Ns_PathIsAbsolute(line)) { hPtr = Tcl_CreateHashEntry(&preboundUnix, (char *) line, &new); if (!new) { |