You can subscribe to this list here.
2005 |
Jan
|
Feb
(32) |
Mar
(56) |
Apr
(92) |
May
(39) |
Jun
(226) |
Jul
(98) |
Aug
(66) |
Sep
|
Oct
(153) |
Nov
(43) |
Dec
(42) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(97) |
Feb
(141) |
Mar
(147) |
Apr
(80) |
May
(51) |
Jun
(93) |
Jul
(88) |
Aug
(50) |
Sep
(179) |
Oct
(48) |
Nov
(82) |
Dec
(71) |
2007 |
Jan
(42) |
Feb
(46) |
Mar
(123) |
Apr
(21) |
May
(139) |
Jun
(59) |
Jul
(34) |
Aug
(57) |
Sep
(47) |
Oct
(137) |
Nov
(49) |
Dec
(12) |
2008 |
Jan
(10) |
Feb
(8) |
Mar
(63) |
Apr
(17) |
May
(34) |
Jun
(38) |
Jul
(16) |
Aug
(62) |
Sep
(9) |
Oct
(121) |
Nov
(38) |
Dec
(4) |
2009 |
Jan
|
Feb
(11) |
Mar
(9) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
(4) |
Apr
(10) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
(12) |
2012 |
Jan
(26) |
Feb
(1) |
Mar
(15) |
Apr
(1) |
May
(1) |
Jun
(7) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
(52) |
Nov
(8) |
Dec
(25) |
2013 |
Jan
(35) |
Feb
(14) |
Mar
(10) |
Apr
(10) |
May
(29) |
Jun
(16) |
Jul
(5) |
Aug
(8) |
Sep
(8) |
Oct
(6) |
Nov
(1) |
Dec
(3) |
2014 |
Jan
(16) |
Feb
(13) |
Mar
(5) |
Apr
(9) |
May
(21) |
Jun
(6) |
Jul
(5) |
Aug
(2) |
Sep
(59) |
Oct
(115) |
Nov
(122) |
Dec
(45) |
2015 |
Jan
(31) |
Feb
(32) |
Mar
(19) |
Apr
(25) |
May
(3) |
Jun
(4) |
Jul
(18) |
Aug
(3) |
Sep
(23) |
Oct
(11) |
Nov
(17) |
Dec
(12) |
2016 |
Jan
(20) |
Feb
(27) |
Mar
(20) |
Apr
(40) |
May
(35) |
Jun
(48) |
Jul
(44) |
Aug
(51) |
Sep
(18) |
Oct
(42) |
Nov
(39) |
Dec
(29) |
2017 |
Jan
(37) |
Feb
(34) |
Mar
(20) |
Apr
(37) |
May
(10) |
Jun
(2) |
Jul
(14) |
Aug
(15) |
Sep
(25) |
Oct
(29) |
Nov
(15) |
Dec
(29) |
2018 |
Jan
(5) |
Feb
(15) |
Mar
(6) |
Apr
(20) |
May
(39) |
Jun
(39) |
Jul
(17) |
Aug
(20) |
Sep
(10) |
Oct
(17) |
Nov
(20) |
Dec
(8) |
2019 |
Jan
(28) |
Feb
(21) |
Mar
(13) |
Apr
(44) |
May
(44) |
Jun
(28) |
Jul
(51) |
Aug
(30) |
Sep
(7) |
Oct
(20) |
Nov
(8) |
Dec
(21) |
2020 |
Jan
(27) |
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Vlad S. <ser...@us...> - 2005-11-12 20:50:44
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10072 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.246 retrieving revision 1.247 diff -C2 -d -r1.246 -r1.247 *** ChangeLog 12 Nov 2005 18:30:39 -0000 1.246 --- ChangeLog 12 Nov 2005 20:50:33 -0000 1.247 *************** *** 1,7 **** 2005-11-12 Vlad Seryakov <ser...@us...> * nsd/info.c: Fixed sockcallbacks as unrecognosed error * nssock/nssock.c: ! * include/ns.h: * nsd/sock.c: Moved and made as public two functions from sock driver: Ns_SockRecvBufs, Ns_SockSendBufs. for new drivers, now it --- 1,12 ---- 2005-11-12 Vlad Seryakov <ser...@us...> + * nsd.conn.c: New Ns_ConnSockPtr function * nsd/info.c: Fixed sockcallbacks as unrecognosed error * nssock/nssock.c: ! * include/ns.h: Added new DriverAccept call for drivers ! to be called after accept the connection. If request struct will ! be provided by the driver, connection will be queued immediately and ! driver will handle it completely. This is temporary until more generic ! driver support will be designed. * nsd/sock.c: Moved and made as public two functions from sock driver: Ns_SockRecvBufs, Ns_SockSendBufs. for new drivers, now it *************** *** 9,14 **** * nsd/driver.c: Split SockRead into SockRead and SockParse, ! added new SetRequest static function that allocates request struct ! for new connection socket. 2005-11-07 Zoran Vasiljevic <vas...@us...> --- 14,19 ---- * nsd/driver.c: Split SockRead into SockRead and SockParse, ! added new Ns_DriverSetRequest function that allocates request ! struct for new connection socket. 2005-11-07 Zoran Vasiljevic <vas...@us...> |
From: Vlad S. <ser...@us...> - 2005-11-12 20:50:44
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10072/include Modified Files: ns.h Log Message: Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** ns.h 12 Nov 2005 18:30:39 -0000 1.59 --- ns.h 12 Nov 2005 20:50:33 -0000 1.60 *************** *** 489,493 **** DriverSend, DriverKeep, ! DriverClose } Ns_DriverCmd; --- 489,494 ---- DriverSend, DriverKeep, ! DriverClose, ! DriverAccept } Ns_DriverCmd; *************** *** 718,721 **** --- 719,723 ---- NS_EXTERN int Ns_ConnPort(Ns_Conn *conn); NS_EXTERN int Ns_ConnSock(Ns_Conn *conn); + NS_EXTERN Ns_Sock *Ns_ConnSockPtr(Ns_Conn *conn); NS_EXTERN char *Ns_ConnDriverName(Ns_Conn *conn); NS_EXTERN void *Ns_ConnDriverContext(Ns_Conn *conn); *************** *** 843,846 **** --- 845,849 ---- NS_EXTERN int Ns_DriverInit(char *server, char *module, Ns_DriverInitData *init); + NS_EXTERN void Ns_DriverSockRequest(Ns_Sock *sock, char *reqline); /* |
From: Vlad S. <ser...@us...> - 2005-11-12 18:30:55
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14311/nsd Modified Files: driver.c info.c sock.c Log Message: Index: info.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/info.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** info.c 7 Nov 2005 14:04:01 -0000 1.9 --- info.c 12 Nov 2005 18:30:40 -0000 1.10 *************** *** 498,505 **** enum { IAddressIdx, IArgv0Idx, IBoottimeIdx, IBuilddateIdx, ICallbacksIdx, ! IConfigIdx, IHomeIdx, hostINameIdx, ILocksIdx, ILogIdx, IMajorIdx, IMinorIdx, INameIdx, INsdIdx, IPageRootIdx, IPatchLevelIdx, IPidIdx, IPlatformIdx, IPoolsIdx, IScheduledIdx, IServerIdx, IServersIdx, ! sockICallbacksIdx, ITagIdx, ITclLibIdx, IThreadsIdx, IUptimeIdx, IVersionIdx, IWinntIdx, IFiltersIdx, ITracesIdx, IRequestProcsIdx, IUrl2FileIdx --- 498,505 ---- enum { IAddressIdx, IArgv0Idx, IBoottimeIdx, IBuilddateIdx, ICallbacksIdx, ! IConfigIdx, IHomeIdx, IHostNameIdx, ILocksIdx, ILogIdx, IMajorIdx, IMinorIdx, INameIdx, INsdIdx, IPageRootIdx, IPatchLevelIdx, IPidIdx, IPlatformIdx, IPoolsIdx, IScheduledIdx, IServerIdx, IServersIdx, ! ISockCallbacksIdx, ITagIdx, ITclLibIdx, IThreadsIdx, IUptimeIdx, IVersionIdx, IWinntIdx, IFiltersIdx, ITracesIdx, IRequestProcsIdx, IUrl2FileIdx *************** *** 539,546 **** return TCL_OK; ! case sockICallbacksIdx: NsGetSockCallbacks(&ds); Tcl_DStringResult(interp, &ds); ! break; case IScheduledIdx: --- 539,546 ---- return TCL_OK; ! case ISockCallbacksIdx: NsGetSockCallbacks(&ds); Tcl_DStringResult(interp, &ds); ! return TCL_OK; case IScheduledIdx: *************** *** 575,579 **** return TCL_OK; ! case hostINameIdx: Tcl_SetResult(interp, Ns_InfoHostname(), TCL_STATIC); return TCL_OK; --- 575,579 ---- return TCL_OK; ! case IHostNameIdx: Tcl_SetResult(interp, Ns_InfoHostname(), TCL_STATIC); return TCL_OK; Index: driver.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/driver.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** driver.c 16 Oct 2005 08:52:48 -0000 1.24 --- driver.c 12 Nov 2005 18:30:40 -0000 1.25 *************** *** 89,92 **** --- 89,93 ---- static Sock *firstClosePtr; /* First conn ready for graceful close. */ static int SockRead(Sock *sockPtr); + static int SockParse(Sock *sockPtr); static void SockPoll(Sock *sockPtr, Ns_Time *timeoutPtr); static void SockTimeout(Sock *sockPtr, Ns_Time *nowPtr, int timeout); *************** *** 1084,1088 **** return 1; ! // return status; } --- 1085,1136 ---- return 1; ! } ! ! /* ! *---------------------------------------------------------------------- ! * ! * SetRequest -- ! * ! * Allocates new request struct for the given socket, if data is specified, ! * it becomes parsed request struct, i.e. should be in the form: METHOD URL PROTO ! * ! * Results: ! * None. ! * ! * Side effects: ! * None ! * ! *---------------------------------------------------------------------- ! */ ! ! static Request* ! SetRequest(Sock *sockPtr, char *data) ! { ! Request *reqPtr; ! ! Ns_MutexLock(&reqLock); ! reqPtr = firstReqPtr; ! if (reqPtr != NULL) { ! firstReqPtr = reqPtr->nextPtr; ! } ! Ns_MutexUnlock(&reqLock); ! if (reqPtr == NULL) { ! reqPtr = ns_malloc(sizeof(Request)); ! Tcl_DStringInit(&reqPtr->buffer); ! reqPtr->headers = Ns_SetCreate(NULL); ! reqPtr->request = NULL; ! reqPtr->next = reqPtr->content = NULL; ! reqPtr->length = reqPtr->avail = 0; ! reqPtr->coff = reqPtr->woff = reqPtr->roff = 0; ! reqPtr->leadblanks = 0; ! } ! sockPtr->reqPtr = reqPtr; ! reqPtr->port = ntohs(sockPtr->sa.sin_port); ! strcpy(reqPtr->peer, ns_inet_ntoa(sockPtr->sa.sin_addr)); ! ! if (data) { ! sockPtr->reqPtr->request = Ns_ParseRequest(data); ! } ! return reqPtr; } *************** *** 1365,1392 **** Request *reqPtr; Tcl_DString *bufPtr; ! char *s, *e, save, tbuf[4096]; ! int cnt, len, nread, n; reqPtr = sockPtr->reqPtr; if (reqPtr == NULL) { ! Ns_MutexLock(&reqLock); ! reqPtr = firstReqPtr; ! if (reqPtr != NULL) { ! firstReqPtr = reqPtr->nextPtr; ! } ! Ns_MutexUnlock(&reqLock); ! if (reqPtr == NULL) { ! reqPtr = ns_malloc(sizeof(Request)); ! Tcl_DStringInit(&reqPtr->buffer); ! reqPtr->headers = Ns_SetCreate(NULL); ! reqPtr->request = NULL; ! reqPtr->next = reqPtr->content = NULL; ! reqPtr->length = reqPtr->avail = 0; ! reqPtr->coff = reqPtr->woff = reqPtr->roff = 0; ! reqPtr->leadblanks = 0; ! } ! sockPtr->reqPtr = reqPtr; ! reqPtr->port = ntohs(sockPtr->sa.sin_port); ! strcpy(reqPtr->peer, ns_inet_ntoa(sockPtr->sa.sin_addr)); } --- 1413,1422 ---- Request *reqPtr; Tcl_DString *bufPtr; ! char tbuf[4096]; ! int len, nread, n; reqPtr = sockPtr->reqPtr; if (reqPtr == NULL) { ! reqPtr = SetRequest(sockPtr, 0); } *************** *** 1459,1463 **** --- 1489,1526 ---- reqPtr->woff += n; reqPtr->avail += n; + + return SockParse(sockPtr); + } + + /*---------------------------------------------------------------------- + * + * SockParse -- + * + * Construct the given conn by parsing input buffer until end of + * headers. Return NS_SOCK_READY when finnished parsing. + * + * Results: + * NS_SOCK_READY: Conn is ready for processing. + * NS_SOCK_MORE: More input is required. + * NS_SOCK_ERROR: Malformed request. + * + * Side effects: + * An Ns_Request and/or Ns_Set may be allocated. + * Ns_Conn buffer management offsets updated. + * + *---------------------------------------------------------------------- + */ + + static int + SockParse(Sock *sockPtr) + { + Request *reqPtr; + Tcl_DString *bufPtr; + char *s, *e, save; + int cnt; + reqPtr = sockPtr->reqPtr; + bufPtr = &reqPtr->buffer; + /* * Scan lines until start of content. Index: sock.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/sock.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sock.c 13 Jun 2005 06:14:26 -0000 1.4 --- sock.c 12 Nov 2005 18:30:40 -0000 1.5 *************** *** 50,53 **** --- 50,122 ---- static SOCKET SockSetup(SOCKET sock); + static int + SockRecv(SOCKET sock, struct iovec *bufs, int nbufs) + { + #ifdef _WIN32 + int n, flags; + + flags = 0; + if (WSARecv(sock, (LPWSABUF)bufs, nbufs, &n, &flags, NULL, NULL) != 0) { + n = -1; + } + return n; + #else + struct msghdr msg; + + memset(&msg, 0, sizeof(msg)); + msg.msg_iov = bufs; + msg.msg_iovlen = nbufs; + return recvmsg(sock, &msg, 0); + #endif + } + + + static int + SockSend(SOCKET sock, struct iovec *bufs, int nbufs) + { + #ifdef _WIN32 + int n; + + if (WSASend(sock, (LPWSABUF)bufs, nbufs, &n, 0, NULL, NULL) != 0) { + n = -1; + } + return n; + #else + struct msghdr msg; + + memset(&msg, 0, sizeof(msg)); + msg.msg_iov = bufs; + msg.msg_iovlen = nbufs; + return sendmsg(sock, &msg, 0); + #endif + } + + int + Ns_SockRecvBufs(SOCKET sock, struct iovec *bufs, int nbufs, int timeout) + { + int n; + + n = SockRecv(sock, bufs, nbufs); + if (n < 0 + && ns_sockerrno == EWOULDBLOCK + && Ns_SockWait(sock, NS_SOCK_READ, timeout) == NS_OK) { + n = SockRecv(sock, bufs, nbufs); + } + return n; + } + + Ns_SockSendBufs(SOCKET sock, struct iovec *bufs, int nbufs, int timeout) + { + int n; + + n = SockSend(sock, bufs, nbufs); + if (n < 0 + && ns_sockerrno == EWOULDBLOCK + && Ns_SockWait(sock, NS_SOCK_WRITE, timeout) == NS_OK) { + n = SockSend(sock, bufs, nbufs); + } + return n; + } + /* |
From: Vlad S. <ser...@us...> - 2005-11-12 18:30:55
|
Update of /cvsroot/naviserver/naviserver/nssock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14311/nssock Modified Files: nssock.c Log Message: Index: nssock.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nssock/nssock.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** nssock.c 10 Jun 2005 17:58:58 -0000 1.2 --- nssock.c 12 Nov 2005 18:30:40 -0000 1.3 *************** *** 46,51 **** static Ns_DriverProc SockProc; - static int SockRecv(SOCKET sock, struct iovec *bufs, int nbufs); - static int SockSend(SOCKET sock, struct iovec *bufs, int nbufs); --- 46,49 ---- *************** *** 114,132 **** switch (cmd) { case DriverRecv: ! n = SockRecv(sock->sock, bufs, nbufs); ! if (n < 0 ! && ns_sockerrno == EWOULDBLOCK ! && Ns_SockWait(sock->sock, NS_SOCK_READ, sock->driver->recvwait) == NS_OK) { ! n = SockRecv(sock->sock, bufs, nbufs); ! } break; case DriverSend: ! n = SockSend(sock->sock, bufs, nbufs); ! if (n < 0 ! && ns_sockerrno == EWOULDBLOCK ! && Ns_SockWait(sock->sock, NS_SOCK_WRITE, sock->driver->sendwait) == NS_OK) { ! n = SockSend(sock->sock, bufs, nbufs); ! } break; --- 112,120 ---- switch (cmd) { case DriverRecv: ! n = Ns_SockRecvBufs(sock->sock, bufs, nbufs, sock->driver->recvwait); break; case DriverSend: ! n = Ns_SockSendBufs(sock->sock, bufs, nbufs, sock->driver->sendwait); break; *************** *** 146,188 **** - static int - SockRecv(SOCKET sock, struct iovec *bufs, int nbufs) - { - #ifdef _WIN32 - int n, flags; - - flags = 0; - if (WSARecv(sock, (LPWSABUF)bufs, nbufs, &n, &flags, NULL, NULL) != 0) { - n = -1; - } - return n; - #else - struct msghdr msg; - - memset(&msg, 0, sizeof(msg)); - msg.msg_iov = bufs; - msg.msg_iovlen = nbufs; - return recvmsg(sock, &msg, 0); - #endif - } - - - static int - SockSend(SOCKET sock, struct iovec *bufs, int nbufs) - { - #ifdef _WIN32 - int n; - - if (WSASend(sock, (LPWSABUF)bufs, nbufs, &n, 0, NULL, NULL) != 0) { - n = -1; - } - return n; - #else - struct msghdr msg; - - memset(&msg, 0, sizeof(msg)); - msg.msg_iov = bufs; - msg.msg_iovlen = nbufs; - return sendmsg(sock, &msg, 0); - #endif - } --- 134,135 ---- |
From: Vlad S. <ser...@us...> - 2005-11-12 18:30:55
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14311/tests Modified Files: ns_info.test Log Message: Index: ns_info.test =================================================================== RCS file: /cvsroot/naviserver/naviserver/tests/ns_info.test,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ns_info.test 7 Nov 2005 03:17:56 -0000 1.4 --- ns_info.test 12 Nov 2005 18:30:40 -0000 1.5 *************** *** 140,144 **** test ns_info-2.28.1 {basic operation} -body { ! ns_sleep 1 expr {[ns_info uptime]>1} } -result 1 --- 140,144 ---- test ns_info-2.28.1 {basic operation} -body { ! ns_sleep 2 expr {[ns_info uptime]>1} } -result 1 |
From: Vlad S. <ser...@us...> - 2005-11-12 18:30:55
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14311 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.245 retrieving revision 1.246 diff -C2 -d -r1.245 -r1.246 *** ChangeLog 7 Nov 2005 14:09:55 -0000 1.245 --- ChangeLog 12 Nov 2005 18:30:39 -0000 1.246 *************** *** 1,2 **** --- 1,15 ---- + 2005-11-12 Vlad Seryakov <ser...@us...> + + * nsd/info.c: Fixed sockcallbacks as unrecognosed error + * nssock/nssock.c: + * include/ns.h: + * nsd/sock.c: Moved and made as public two functions from sock + driver: Ns_SockRecvBufs, Ns_SockSendBufs. for new drivers, now it + will be easy to re-use send/recv data from within driver's proc. + + * nsd/driver.c: Split SockRead into SockRead and SockParse, + added new SetRequest static function that allocates request struct + for new connection socket. + 2005-11-07 Zoran Vasiljevic <vas...@us...> |
From: Vlad S. <ser...@us...> - 2005-11-12 18:30:55
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14311/include Modified Files: ns.h Log Message: Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** ns.h 7 Nov 2005 03:17:55 -0000 1.58 --- ns.h 12 Nov 2005 18:30:39 -0000 1.59 *************** *** 1525,1528 **** --- 1525,1531 ---- NS_EXTERN int Ns_SockWait(SOCKET sock, int what, int timeout); + NS_EXTERN int Ns_SockRecvBufs(SOCKET sock, struct iovec *bufs, int nbufs, int timeout); + NS_EXTERN int Ns_SockSendBufs(SOCKET sock, struct iovec *bufs, int nbufs, int timeout); + NS_EXTERN SOCKET Ns_BindSock(struct sockaddr_in *psa) NS_GNUC_DEPRECATED; NS_EXTERN SOCKET Ns_SockBind(struct sockaddr_in *psa); |
From: Zoran V. <vas...@us...> - 2005-11-07 14:10:10
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20348 Modified Files: ChangeLog Log Message: See file Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.244 retrieving revision 1.245 diff -C2 -d -r1.244 -r1.245 *** ChangeLog 7 Nov 2005 03:17:54 -0000 1.244 --- ChangeLog 7 Nov 2005 14:09:55 -0000 1.245 *************** *** 1,2 **** --- 1,7 ---- + 2005-11-07 Zoran Vasiljevic <vas...@us...> + + * nsd/info.c: Fixed broken NsTclInfoObjCmd which failed to + properly process info options not tied to any specific server. + 2005-11-06 Stephen Deasey <sd...@us...> |
From: Zoran V. <vas...@us...> - 2005-11-07 14:04:17
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18198 Modified Files: info.c Log Message: Fixed broken NsTclInfoObjCmd which failed to properly process info option not tied to any specific server. Index: info.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/info.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** info.c 7 Nov 2005 03:17:55 -0000 1.8 --- info.c 7 Nov 2005 14:04:01 -0000 1.9 *************** *** 1,7 **** /* ! * The contents of this file are subject to the AOLserver Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at ! * http://aolserver.com/. * * Software distributed under the License is distributed on an "AS IS" --- 1,7 ---- /* ! * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at ! * http://mozilla.org/. * * Software distributed under the License is distributed on an "AS IS" *************** *** 31,35 **** * info.c -- * ! * Ns_Info* API and ns_info command support. */ --- 31,35 ---- * info.c -- * ! * Ns_Info* API and ns_info command support. */ *************** *** 54,64 **** * Ns_InfoHomePath -- * ! * Return the home dir. * * Results: ! * Home dir. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 54,64 ---- * Ns_InfoHomePath -- * ! * Return the home dir. * * Results: ! * Home dir. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 77,87 **** * Ns_InfoServerName -- * ! * Return the server name. * * Results: ! * Server name * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 77,87 ---- * Ns_InfoServerName -- * ! * Return the server name. * * Results: ! * Server name * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 100,110 **** * Ns_InfoServerVersion -- * ! * Returns the server version * * Results: ! * String server version. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 100,110 ---- * Ns_InfoServerVersion -- * ! * Returns the server version * * Results: ! * String server version. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 123,133 **** * Ns_InfoConfigFile -- * ! * Returns path to config file. * * Results: ! * Path to config file. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 123,133 ---- * Ns_InfoConfigFile -- * ! * Returns path to config file. * * Results: ! * Path to config file. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 146,156 **** * Ns_InfoPid -- * ! * Returns server's PID * * Results: ! * PID (tread like pid_t) * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 146,156 ---- * Ns_InfoPid -- * ! * Returns server's PID * * Results: ! * PID (tread like pid_t) * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 169,179 **** * Ns_InfoNameOfExecutable -- * ! * Returns the name of the nsd executable. Quirky name is from Tcl. * * Results: ! * Name of executable, string. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 169,179 ---- * Ns_InfoNameOfExecutable -- * ! * Returns the name of the nsd executable. Quirky name is from Tcl. * * Results: ! * Name of executable, string. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 190,202 **** *---------------------------------------------------------------------- * ! * -- * ! * Return platform name * * Results: ! * Platform name, string. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 190,202 ---- *---------------------------------------------------------------------- * ! * Ns_InfoPlatform -- * ! * Return platform name * * Results: ! * Platform name, string. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 246,256 **** * Ns_InfoUptime -- * ! * Returns time server has been up. * * Results: ! * Seconds server has been running. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 246,256 ---- * Ns_InfoUptime -- * ! * Returns time server has been up. * * Results: ! * Seconds server has been running. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 269,279 **** * Ns_InfoBootTime -- * ! * Returns time server started. * * Results: ! * Treat as time_t. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 269,279 ---- * Ns_InfoBootTime -- * ! * Returns time server started. * * Results: ! * Treat as time_t. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 292,302 **** * Ns_InfoHostname -- * ! * Return server hostname * * Results: ! * Hostname * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 292,302 ---- * Ns_InfoHostname -- * ! * Return server hostname * * Results: ! * Hostname * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 316,326 **** * Ns_InfoAddress -- * ! * Return server IP address * * Results: ! * Primary (first) IP address of this machine. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 316,326 ---- * Ns_InfoAddress -- * ! * Return server IP address * * Results: ! * Primary (first) IP address of this machine. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 339,349 **** * Ns_InfoBuildDate -- * ! * Returns time server was compiled. * * Results: ! * String build date and time. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 339,349 ---- * Ns_InfoBuildDate -- * ! * Returns time server was compiled. * * Results: ! * String build date and time. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 362,372 **** * Ns_InfoShutdownPending -- * ! * Boolean: is a shutdown pending? * * Results: ! * NS_TRUE: yes, NS_FALSE: no * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 362,372 ---- * Ns_InfoShutdownPending -- * ! * Boolean: is a shutdown pending? * * Results: ! * NS_TRUE: yes, NS_FALSE: no * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 381,384 **** --- 381,385 ---- stopping = nsconf.state.stopping; Ns_MutexUnlock(&nsconf.state.lock); + return stopping; } *************** *** 390,400 **** * Ns_InfoStarted -- * ! * Boolean: has the server started up all the way yet? * * Results: ! * NS_TRUE: yes, NS_FALSE: no * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 391,401 ---- * Ns_InfoStarted -- * ! * Boolean: has the server started up all the way yet? * * Results: ! * NS_TRUE: yes, NS_FALSE: no * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 409,412 **** --- 410,414 ---- started = nsconf.state.started; Ns_MutexUnlock(&nsconf.state.lock); + return started; } *************** *** 418,428 **** * Ns_InfoServersStarted -- * ! * Compatability function, same as Ns_InfoStarted * * Results: ! * See Ns_InfoStarted * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 420,430 ---- * Ns_InfoServersStarted -- * ! * Compatability function, same as Ns_InfoStarted * * Results: ! * See Ns_InfoStarted * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 441,451 **** * Ns_InfoTag -- * ! * Returns CVS tag of this build (meaningless without "cvs export"). * * Results: ! * A string version name. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 443,453 ---- * Ns_InfoTag -- * ! * Returns CVS tag of this build (meaningless without "cvs export"). * * Results: ! * A string version name. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 464,474 **** * NsTclInfoObjCmd -- * ! * Implements ns_info. * * Results: ! * Tcl result. * * Side effects: ! * See docs. * *---------------------------------------------------------------------- --- 466,476 ---- * NsTclInfoObjCmd -- * ! * Implements ns_info. * * Results: ! * Tcl result. * * Side effects: ! * See docs. * *---------------------------------------------------------------------- *************** *** 478,642 **** NsTclInfoObjCmd(ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj **objv) { ! int opt; ! NsInterp *itPtr = arg; ! char *server, *elog; Tcl_DString ds; static CONST char *opts[] = { ! "address", "argv0", "boottime", "builddate", "callbacks", ! "config", "home", "hostname", "locks", "log", ! "major", "minor", "name", "nsd", "pageroot", "patchlevel", ! "pid", "platform", "pools", "scheduled", "server", "servers", ! "sockcallbacks", "tag", "tcllib", "threads", "uptime", ! "version", "winnt", "filters", "traces", "requestprocs", ! "url2file", NULL }; enum { ! IAddressIdx, IArgv0Idx, IBoottimeIdx, IBuilddateIdx, ICallbacksIdx, ! IConfigIdx, IHomeIdx, hostINameIdx, ILocksIdx, ILogIdx, ! IMajorIdx, IMinorIdx, INameIdx, INsdIdx, IPageRootIdx, IPatchLevelIdx, ! IPidIdx, IPlatformIdx, IPoolsIdx, IScheduledIdx, IServerIdx, IServersIdx, ! sockICallbacksIdx, ITagIdx, ITclLibIdx, IThreadsIdx, IUptimeIdx, ! IVersionIdx, IWinntIdx, IFiltersIdx, ITracesIdx, IRequestProcsIdx, ! IUrl2FileIdx }; if (objc != 2) { ! Tcl_WrongNumArgs(interp, 1, objv, "option"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], opts, "option", 0, ! &opt) != TCL_OK) { ! return TCL_ERROR; } ! Tcl_DStringInit(&ds); ! switch (opt) { case IArgv0Idx: ! Tcl_SetResult(interp, nsconf.argv0, TCL_STATIC); ! break; ! case INsdIdx: ! Tcl_SetResult(interp, nsconf.nsd, TCL_STATIC); ! break; ! case INameIdx: Tcl_SetResult(interp, Ns_InfoServerName(), TCL_STATIC); ! break; ! case IConfigIdx: ! Tcl_SetResult(interp, Ns_InfoConfigFile(), TCL_STATIC); ! break; ! case ICallbacksIdx: ! NsGetCallbacks(&ds); ! Tcl_DStringResult(interp, &ds); ! break; ! case sockICallbacksIdx: ! NsGetSockCallbacks(&ds); ! Tcl_DStringResult(interp, &ds); ! break; ! case IScheduledIdx: ! NsGetScheduled(&ds); ! Tcl_DStringResult(interp, &ds); ! break; ! case ILocksIdx: ! Ns_MutexList(&ds); ! Tcl_DStringResult(interp, &ds); ! break; ! case IThreadsIdx: ! Ns_ThreadList(&ds, ThreadArgProc); ! Tcl_DStringResult(interp, &ds); ! break; ! case IPoolsIdx: #if !defined(_WIN32) && defined(USE_THREAD_ALLOC) && (STATIC_BUILD == 0) ! Tcl_GetMemoryInfo(&ds); /* As of Tcl8.4.1 this is not exported. */ ! Tcl_DStringResult(interp, &ds); #endif ! break; ! case ILogIdx: ! elog = Ns_InfoErrorLog(); ! Tcl_SetResult(interp, elog == NULL ? "STDOUT" : elog, TCL_STATIC); ! break; ! case IPlatformIdx: ! Tcl_SetResult(interp, Ns_InfoPlatform(), TCL_STATIC); ! break; ! case hostINameIdx: ! Tcl_SetResult(interp, Ns_InfoHostname(), TCL_STATIC); ! break; ! case IAddressIdx: ! Tcl_SetResult(interp, Ns_InfoAddress(), TCL_STATIC); ! break; ! case IUptimeIdx: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(Ns_InfoUptime())); ! break; ! case IBoottimeIdx: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(Ns_InfoBootTime())); ! break; ! case IPidIdx: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(Ns_InfoPid())); ! break; ! case IMajorIdx: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(NS_MAJOR_VERSION)); ! break; ! case IMinorIdx: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(NS_MINOR_VERSION)); ! break; ! case IVersionIdx: ! Tcl_SetResult(interp, NS_VERSION, TCL_STATIC); ! break; ! case IPatchLevelIdx: ! Tcl_SetResult(interp, NS_PATCH_LEVEL, TCL_STATIC); ! break; ! case IHomeIdx: ! Tcl_SetResult(interp, Ns_InfoHomePath(), TCL_STATIC); ! break; ! case IWinntIdx: #ifdef _WIN32 ! Tcl_SetResult(interp, "1", TCL_STATIC); #else ! Tcl_SetResult(interp, "0", TCL_STATIC); #endif ! break; ! case IBuilddateIdx: ! Tcl_SetResult(interp, Ns_InfoBuildDate(), TCL_STATIC); ! break; ! case ITagIdx: ! Tcl_SetResult(interp, Ns_InfoTag(), TCL_STATIC); ! break; ! case IServersIdx: ! Tcl_SetResult(interp, nsconf.servers.string, TCL_STATIC); ! break; } ! /* * The following subcommands require a virtual server. */ ! if (itPtr->servPtr == NULL) { ! Tcl_SetResult(interp, "no server", TCL_STATIC); ! return TCL_ERROR; ! } server = itPtr->servPtr->server; --- 480,648 ---- NsTclInfoObjCmd(ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj **objv) { ! int opt; ! NsInterp *itPtr = arg; ! char *server, *elog; Tcl_DString ds; + + static CONST char *opts[] = { ! "address", "argv0", "boottime", "builddate", "callbacks", ! "config", "home", "hostname", "locks", "log", ! "major", "minor", "name", "nsd", "pageroot", "patchlevel", ! "pid", "platform", "pools", "scheduled", "server", "servers", ! "sockcallbacks", "tag", "tcllib", "threads", "uptime", ! "version", "winnt", "filters", "traces", "requestprocs", ! "url2file", NULL }; + enum { ! IAddressIdx, IArgv0Idx, IBoottimeIdx, IBuilddateIdx, ICallbacksIdx, ! IConfigIdx, IHomeIdx, hostINameIdx, ILocksIdx, ILogIdx, ! IMajorIdx, IMinorIdx, INameIdx, INsdIdx, IPageRootIdx, IPatchLevelIdx, ! IPidIdx, IPlatformIdx, IPoolsIdx, IScheduledIdx, IServerIdx, IServersIdx, ! sockICallbacksIdx, ITagIdx, ITclLibIdx, IThreadsIdx, IUptimeIdx, ! IVersionIdx, IWinntIdx, IFiltersIdx, ITracesIdx, IRequestProcsIdx, ! IUrl2FileIdx }; if (objc != 2) { ! Tcl_WrongNumArgs(interp, 1, objv, "option"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], opts, "option", 0, ! &opt) != TCL_OK) { ! return TCL_ERROR; } ! Tcl_DStringInit(&ds); ! switch (opt) { case IArgv0Idx: ! Tcl_SetResult(interp, nsconf.argv0, TCL_STATIC); ! return TCL_OK; ! case INsdIdx: ! Tcl_SetResult(interp, nsconf.nsd, TCL_STATIC); ! return TCL_OK; ! case INameIdx: Tcl_SetResult(interp, Ns_InfoServerName(), TCL_STATIC); ! return TCL_OK; ! case IConfigIdx: ! Tcl_SetResult(interp, Ns_InfoConfigFile(), TCL_STATIC); ! return TCL_OK; ! case ICallbacksIdx: ! NsGetCallbacks(&ds); ! Tcl_DStringResult(interp, &ds); ! return TCL_OK; ! case sockICallbacksIdx: ! NsGetSockCallbacks(&ds); ! Tcl_DStringResult(interp, &ds); ! break; ! case IScheduledIdx: ! NsGetScheduled(&ds); ! Tcl_DStringResult(interp, &ds); ! return TCL_OK; ! case ILocksIdx: ! Ns_MutexList(&ds); ! Tcl_DStringResult(interp, &ds); ! return TCL_OK; ! case IThreadsIdx: ! Ns_ThreadList(&ds, ThreadArgProc); ! Tcl_DStringResult(interp, &ds); ! return TCL_OK; ! case IPoolsIdx: #if !defined(_WIN32) && defined(USE_THREAD_ALLOC) && (STATIC_BUILD == 0) ! Tcl_GetMemoryInfo(&ds); /* As of Tcl8.4.1 this is not exported. */ ! Tcl_DStringResult(interp, &ds); #endif ! return TCL_OK; ! case ILogIdx: ! elog = Ns_InfoErrorLog(); ! Tcl_SetResult(interp, elog == NULL ? "STDOUT" : elog, TCL_STATIC); ! return TCL_OK; ! case IPlatformIdx: ! Tcl_SetResult(interp, Ns_InfoPlatform(), TCL_STATIC); ! return TCL_OK; ! case hostINameIdx: ! Tcl_SetResult(interp, Ns_InfoHostname(), TCL_STATIC); ! return TCL_OK; ! case IAddressIdx: ! Tcl_SetResult(interp, Ns_InfoAddress(), TCL_STATIC); ! return TCL_OK; ! case IUptimeIdx: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(Ns_InfoUptime())); ! return TCL_OK; ! case IBoottimeIdx: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(Ns_InfoBootTime())); ! return TCL_OK; ! case IPidIdx: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(Ns_InfoPid())); ! return TCL_OK; ! case IMajorIdx: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(NS_MAJOR_VERSION)); ! return TCL_OK; ! case IMinorIdx: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(NS_MINOR_VERSION)); ! return TCL_OK; ! case IVersionIdx: ! Tcl_SetResult(interp, NS_VERSION, TCL_STATIC); ! return TCL_OK; ! case IPatchLevelIdx: ! Tcl_SetResult(interp, NS_PATCH_LEVEL, TCL_STATIC); ! return TCL_OK; ! case IHomeIdx: ! Tcl_SetResult(interp, Ns_InfoHomePath(), TCL_STATIC); ! return TCL_OK; ! case IWinntIdx: #ifdef _WIN32 ! Tcl_SetResult(interp, "1", TCL_STATIC); #else ! Tcl_SetResult(interp, "0", TCL_STATIC); #endif ! return TCL_OK; ! case IBuilddateIdx: ! Tcl_SetResult(interp, Ns_InfoBuildDate(), TCL_STATIC); ! return TCL_OK; ! case ITagIdx: ! Tcl_SetResult(interp, Ns_InfoTag(), TCL_STATIC); ! return TCL_OK; ! case IServersIdx: ! Tcl_SetResult(interp, nsconf.servers.string, TCL_STATIC); ! return TCL_OK; } ! /* * The following subcommands require a virtual server. */ ! if (itPtr->servPtr == NULL) { ! Tcl_SetResult(interp, "no server", TCL_STATIC); ! return TCL_ERROR; ! } ! server = itPtr->servPtr->server; *************** *** 645,680 **** NsPageRoot(&ds, itPtr->servPtr, NULL); Tcl_DStringResult(interp, &ds); ! break; case IServerIdx: Tcl_SetResult(interp, server, TCL_STATIC); ! break; case ITclLibIdx: Tcl_SetResult(interp, itPtr->servPtr->tcl.library, TCL_STATIC); ! break; case IFiltersIdx: NsGetFilters(&ds, server); Tcl_DStringResult(interp, &ds); ! break; case ITracesIdx: NsGetTraces(&ds, server); Tcl_DStringResult(interp, &ds); ! break; case IRequestProcsIdx: NsGetRequestProcs(&ds, server); Tcl_DStringResult(interp, &ds); ! break; case IUrl2FileIdx: NsGetUrl2FileProcs(&ds, server); Tcl_DStringResult(interp, &ds); ! break; } ! return TCL_OK; } --- 651,688 ---- NsPageRoot(&ds, itPtr->servPtr, NULL); Tcl_DStringResult(interp, &ds); ! return TCL_OK; case IServerIdx: Tcl_SetResult(interp, server, TCL_STATIC); ! return TCL_OK; case ITclLibIdx: Tcl_SetResult(interp, itPtr->servPtr->tcl.library, TCL_STATIC); ! return TCL_OK; case IFiltersIdx: NsGetFilters(&ds, server); Tcl_DStringResult(interp, &ds); ! return TCL_OK; case ITracesIdx: NsGetTraces(&ds, server); Tcl_DStringResult(interp, &ds); ! return TCL_OK; case IRequestProcsIdx: NsGetRequestProcs(&ds, server); Tcl_DStringResult(interp, &ds); ! return TCL_OK; case IUrl2FileIdx: NsGetUrl2FileProcs(&ds, server); Tcl_DStringResult(interp, &ds); ! return TCL_OK; } ! Tcl_SetResult(interp, "unrecognized option", TCL_STATIC); ! ! return TCL_ERROR; } *************** *** 685,695 **** * NsTclLibraryCmd -- * ! * Implements ns_library. * * Results: ! * Tcl result. * * Side effects: ! * See docs. * *---------------------------------------------------------------------- --- 693,703 ---- * NsTclLibraryCmd -- * ! * Implements ns_library. * * Results: ! * Tcl result. * * Side effects: ! * See docs. * *---------------------------------------------------------------------- *************** *** 704,719 **** if (argc != 2 && argc != 3) { ! Tcl_AppendResult(interp, "wrong # args: should be \"", ! argv[0], " library ?module?\"", NULL); ! return TCL_ERROR; } if (STREQ(argv[1], "private")) { ! lib = itPtr->servPtr->tcl.library; } else if (STREQ(argv[1], "shared")) { ! lib = nsconf.tcl.sharedlibrary; } else { ! Tcl_AppendResult(interp, "unknown library \"", ! argv[1], "\": should be private or shared", NULL); ! return TCL_ERROR; } Ns_DStringInit(&ds); --- 712,727 ---- if (argc != 2 && argc != 3) { ! Tcl_AppendResult(interp, "wrong # args: should be \"", ! argv[0], " library ?module?\"", NULL); ! return TCL_ERROR; } if (STREQ(argv[1], "private")) { ! lib = itPtr->servPtr->tcl.library; } else if (STREQ(argv[1], "shared")) { ! lib = nsconf.tcl.sharedlibrary; } else { ! Tcl_AppendResult(interp, "unknown library \"", ! argv[1], "\": should be private or shared", NULL); ! return TCL_ERROR; } Ns_DStringInit(&ds); |
From: Stephen D. <sd...@us...> - 2005-11-07 03:19:16
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23688/nsd Added Files: url2file.c Log Message: * include/ns.h: * nsd/nsd.h: * nsd/Makefile: * nsd/url2file.c: * nsd/fastpath.c: * nsd/info.c: * nsd/init.c: * nsd/proc.c: * nsd/server.c: * nsd/tclcmds.c: * nsd/tclfile.c: * tests/ns_info.test: * tests/url2file.test: Add new, flexible urlspace-based Url2File C API and matching Tcl commands. (RFE: 1333811) --- NEW FILE: url2file.c --- /* * The contents of this file are subject to the AOLserver Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://aolserver.com/. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Original Code is AOLserver Code and related documentation * distributed by AOL. * * The Initial Developer of the Original Code is America Online, * Inc. Portions created by AOL are Copyright (C) 1999 America Online, * Inc. All Rights Reserved. * * Alternatively, the contents of this file may be used under the terms * of the GNU General Public License (the "GPL"), in which case the * provisions of GPL are applicable instead of those above. If you wish * to allow use of your version of this file only under the terms of the * GPL and not to allow others to use your version of this file under the * License, indicate your decision by deleting the provisions above and * replace them with the notice and other provisions required by the GPL. * If you do not delete the provisions above, a recipient may use your * version of this file under either the License or the GPL. */ /* * url2file.c -- * * Routines to register, unregister, and run url2file callbacks. */ #include "nsd.h" NS_RCSID("@(#) $Header: /cvsroot/naviserver/naviserver/nsd/url2file.c,v 1.1 2005/11/07 03:19:05 sdeasey Exp $"); /* * The following structure defines a url2file callback including user * routine and client data. */ typedef struct { int refcnt; Ns_Url2FileProc *proc; Ns_Callback *delete; void *arg; unsigned int flags; } Url2File; /* * The following structure defines a mount point for a URL path. */ typedef struct { char *basepath; char *url; CONST char *server; } Mount; /* * Static functions defined in this file. */ static Ns_Callback FreeMount; static void FreeUrl2File(void *arg); static void Url2FileProcInfo(Ns_DString *dsPtr, void *arg); /* * Static variables defined in this file. */ static Ns_Mutex ulock; static int uid; /* *---------------------------------------------------------------------- * * NsInitUrl2File -- * * Initialize the url2file API. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ void NsInitUrl2File(void) { uid = Ns_UrlSpecificAlloc(); Ns_MutexInit(&ulock); Ns_MutexSetName(&ulock, "nsd:url2file"); } /* *---------------------------------------------------------------------- * * Ns_RegisterUrl2FileProc -- * * Register a new procedure that acts like Ns_UrlToFile to service * matching url pattern. * * Results: * None. * * Side effects: * The delete procedure of previously registered request, if any, * will be called unless NS_OP_NODELETE flag is set. * Overrides any procedure registered with Ns_SetUrlToFileProc(). * *---------------------------------------------------------------------- */ void Ns_RegisterUrl2FileProc(CONST char *server, CONST char *url, Ns_Url2FileProc *proc, Ns_Callback *delete, void *arg, int flags) { NsServer *servPtr = NsGetServer(server); Url2File *u2fPtr; servPtr->fastpath.url2file = NULL; u2fPtr = ns_malloc(sizeof(Url2File)); u2fPtr->proc = proc; u2fPtr->delete = delete; u2fPtr->arg = arg; u2fPtr->flags = flags; u2fPtr->refcnt = 1; Ns_MutexLock(&ulock); Ns_UrlSpecificSet(server, "x", url, uid, u2fPtr, flags, FreeUrl2File); Ns_MutexUnlock(&ulock); } /* *---------------------------------------------------------------------- * * Ns_UnRegisterUrl2FileProc -- * * Remove the procedure which matches the given url pattern. * * Results: * None. * * Side effects: * Registered peocedure's deleteProc may run. * *---------------------------------------------------------------------- */ void Ns_UnRegisterUrl2FileProc(CONST char *server, CONST char *url, int flags) { Ns_MutexLock(&ulock); Ns_UrlSpecificDestroy(server, "x", url, uid, flags); Ns_MutexUnlock(&ulock); } /* *---------------------------------------------------------------------- * Ns_FastUrl2FileProc -- * * Construct a path name relative to the server pages directory. * * Results: * NS_OK or NS_ERROR if the pageroot proc fails. * * Side effects: * None. * *---------------------------------------------------------------------- */ int Ns_FastUrl2FileProc(Ns_DString *dsPtr, CONST char *url, void *arg) { NsServer *servPtr = arg; if (NsPageRoot(dsPtr, servPtr, NULL) == NULL) { return NS_ERROR; } Ns_MakePath(dsPtr, url, NULL); return NS_OK; } /* *---------------------------------------------------------------------- * * Ns_UrlToFile, NsUrlToFile -- * * Construct the filename that corresponds to a URL. * * Results: * Return NS_OK on success or NS_ERROR on failure. * * Side effects: * None. * *---------------------------------------------------------------------- */ int Ns_UrlToFile(Ns_DString *dsPtr, CONST char *server, CONST char *url) { NsServer *servPtr = NsGetServer(server); return NsUrlToFile(dsPtr, servPtr, url); } int NsUrlToFile(Ns_DString *dsPtr, NsServer *servPtr, CONST char *url) { Url2File *u2fPtr; int status; if (servPtr->fastpath.url2file != NULL) { status = (*servPtr->fastpath.url2file)(dsPtr, servPtr->server, url); } else { Ns_MutexLock(&ulock); u2fPtr = Ns_UrlSpecificGet(servPtr->server, "x", url, uid); if (u2fPtr == NULL) { Ns_MutexUnlock(&ulock); Ns_Log(Error, "url2file: no proc found for url: %s", url); return NS_ERROR; } ++u2fPtr->refcnt; Ns_MutexUnlock(&ulock); status = (*u2fPtr->proc)(dsPtr, url, u2fPtr->arg); Ns_MutexLock(&ulock); FreeUrl2File(u2fPtr); Ns_MutexUnlock(&ulock); } if (status == NS_OK) { while (dsPtr->length > 0 && dsPtr->string[dsPtr->length -1] == '/') { Ns_DStringTrunc(dsPtr, dsPtr->length -1); } } return status; } /* *---------------------------------------------------------------------- * Ns_SetUrlToFileProc -- * * Set pointer to custom procedure that acts like Ns_UrlToFile(). * * Deprecated, use Ns_RegisterUrl2FileProc(). * * Results: * None. * * Side effects: * Overrides all existing procedures registered with new API. * *---------------------------------------------------------------------- */ void Ns_SetUrlToFileProc(CONST char *server, Ns_UrlToFileProc *procPtr) { NsServer *servPtr = NsGetServer(server); servPtr->fastpath.url2file = procPtr; } /* *---------------------------------------------------------------------- * * NsUrlToFileProc -- * * Default old-style url2file proc registered at server startup. * * Results: * NS_OK or NS_ERROR. * * Side effects: * None. * *---------------------------------------------------------------------- */ int NsUrlToFileProc(Ns_DString *dsPtr, CONST char *server, CONST char *url) { NsServer *servPtr = NsGetServer(server); return Ns_FastUrl2FileProc(dsPtr, url, servPtr); } /* *---------------------------------------------------------------------- * * NsTclUrl2FileObjCmd -- * * Implements ns_url2file as obj command. * * Results: * Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ int NsTclUrl2FileObjCmd(ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { NsInterp *itPtr = arg; Ns_DString ds; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "url"); return TCL_ERROR; } Ns_DStringInit(&ds); if (NsUrlToFile(&ds, itPtr->servPtr, Tcl_GetString(objv[1])) != NS_OK) { Tcl_SetResult(interp, "url2file lookup failed", TCL_STATIC); Ns_DStringFree(&ds); return TCL_ERROR; } Tcl_DStringResult(interp, &ds); Ns_DStringFree(&ds); return TCL_OK; } /* *---------------------------------------------------------------------- * * NsTclRegisterUrl2FileObjCmd -- * * Implements ns_register_url2file as obj command. * * Results: * Tcl result. * * Side effects: * See Ns_RegisterUrl2FileProc(). * *---------------------------------------------------------------------- */ int NsTclRegisterUrl2FileObjCmd(ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { NsInterp *itPtr = arg; Ns_TclCallback *cbPtr; char *url, *script, *scriptarg = NULL; int flags = 0; Ns_ObjvSpec opts[] = { {"-noinherit", Ns_ObjvBool, &flags, (void *) NS_OP_NOINHERIT}, {"--", Ns_ObjvBreak, NULL, NULL}, {NULL, NULL, NULL, NULL} }; Ns_ObjvSpec args[] = { {"url", Ns_ObjvString, &url, NULL}, {"script", Ns_ObjvString, &script, NULL}, {"?arg", Ns_ObjvString, &scriptarg, NULL}, {NULL, NULL, NULL, NULL} }; if (Ns_ParseObjv(opts, args, interp, 1, objc, objv) != NS_OK) { return TCL_ERROR; } cbPtr = Ns_TclNewCallback(interp, NsTclUrl2FileProc, script, scriptarg); Ns_RegisterUrl2FileProc(itPtr->servPtr->server, url, NsTclUrl2FileProc, Ns_TclFreeCallback, cbPtr, flags); return TCL_OK; } /* *---------------------------------------------------------------------- * * NsTclUnRegisterUrl2FileObjCmd -- * * Implements ns_unregister_url2file as obj command. * * Results: * Tcl result. * * Side effects: * See Ns_UnRegisterUrlToFileProc(). * *---------------------------------------------------------------------- */ int NsTclUnRegisterUrl2FileObjCmd(ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { NsInterp *itPtr = arg; CONST char *url; int noinherit = 0, recurse = 0; Ns_ObjvSpec opts[] = { {"-noinherit", Ns_ObjvBool, &noinherit, (void *) NS_OP_NOINHERIT}, {"-recurse", Ns_ObjvBool, &recurse, (void *) NS_OP_RECURSE}, {"--", Ns_ObjvBreak, NULL, NULL}, {NULL, NULL, NULL, NULL} }; Ns_ObjvSpec args[] = { {"url", Ns_ObjvString, &url, NULL}, {NULL, NULL, NULL, NULL} }; if (Ns_ParseObjv(opts, args, interp, 1, objc, objv) != NS_OK) { return TCL_ERROR; } Ns_UnRegisterUrl2FileProc(itPtr->servPtr->server, url, noinherit | recurse); return TCL_OK; } /* *---------------------------------------------------------------------- * * NsTclRegisterFastUrl2FileObjCmd -- * * Implements ns_register_fasturl2file. Register the default fast * url2file proc for the given URL. * * Results: * Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ int NsTclRegisterFastUrl2FileObjCmd(ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { NsInterp *itPtr = arg; Mount *mPtr; CONST char *url, *basepath = NULL; int flags = 0; Ns_ObjvSpec opts[] = { {"-noinherit", Ns_ObjvBool, &flags, (void *) NS_OP_NOINHERIT}, {"--", Ns_ObjvBreak, NULL, NULL}, {NULL, NULL, NULL, NULL} }; Ns_ObjvSpec args[] = { {"url", Ns_ObjvString, &url, NULL}, {"?basepath", Ns_ObjvString, &basepath, NULL}, {NULL, NULL, NULL, NULL} }; if (Ns_ParseObjv(opts, args, interp, 1, objc, objv) != NS_OK) { return TCL_ERROR; } if (basepath == NULL) { Ns_RegisterUrl2FileProc(itPtr->servPtr->server, url, Ns_FastUrl2FileProc, NULL, itPtr->servPtr, flags); } else { mPtr = ns_malloc(sizeof(Mount)); mPtr->basepath = ns_strdup(basepath); mPtr->url = ns_strdup(url); mPtr->server = itPtr->servPtr->server; Ns_RegisterUrl2FileProc(itPtr->servPtr->server, url, NsMountUrl2FileProc, FreeMount, mPtr, flags); } return TCL_OK; } /* *---------------------------------------------------------------------- * * NsTclUrl2FileProc -- * * Callback for Tcl url2file procs. * * Results: * NS_OK or NS_ERROR. * * Side effects: * Depends on Tcl script. * *---------------------------------------------------------------------- */ int NsTclUrl2FileProc(Ns_DString *dsPtr, CONST char *url, void *arg) { Ns_TclCallback *cbPtr = arg; if (Ns_TclEvalCallback(NULL, cbPtr, dsPtr, url, NULL) != TCL_OK) { return NS_ERROR; } return NS_OK; } /* *---------------------------------------------------------------------- * * NsMountUrl2FileProc -- * * Construct new path relative to registered basepath. * * Results: * NS_OK. * * Side effects: * None. * *---------------------------------------------------------------------- */ int NsMountUrl2FileProc(Ns_DString *dsPtr, CONST char *url, void *arg) { Mount *mPtr = arg; CONST char *u; u = mPtr->url; while (*u != '\0' && *url != '\0' && *u == *url) { ++u; ++url; } if (Ns_PathIsAbsolute(mPtr->basepath)) { Ns_MakePath(dsPtr, mPtr->basepath, url, NULL); return NS_OK; } if (Ns_PagePath(dsPtr, mPtr->server, mPtr->basepath, url, NULL) == NULL) { return NS_ERROR; } return NS_OK; } /* *---------------------------------------------------------------------- * * NsMountUrl2FileArgProc -- * * Info callback for procs which take Mount arg. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ void NsMountUrl2FileArgProc(Tcl_DString *dsPtr, void *arg) { Mount *mPtr = arg; Tcl_DStringAppendElement(dsPtr, mPtr->basepath); Tcl_DStringAppendElement(dsPtr, mPtr->url); } /* *---------------------------------------------------------------------- * * NsGetUrl2FileProcsProcs -- * * Append information about registered url2file procs to dstring. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ void NsGetUrl2FileProcs(Ns_DString *dsPtr, CONST char *server) { Ns_MutexLock(&ulock); NsUrlSpecificWalk(uid, server, Url2FileProcInfo, dsPtr); Ns_MutexUnlock(&ulock); } static void Url2FileProcInfo(Ns_DString *dsPtr, void *arg) { Url2File *u2fPtr = arg; Ns_GetProcInfo(dsPtr, u2fPtr->proc, u2fPtr->arg); } /* *---------------------------------------------------------------------- * * FreeMount -- * * Free Mount data. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void FreeMount(void *arg) { Mount *mPtr = arg; ns_free(mPtr->basepath); ns_free(mPtr->url); ns_free(mPtr); } /* *---------------------------------------------------------------------- * * FreeUrl2File -- * * Free Url2File data when reference count reaches 0. * * Results: * None. * * Side effects: * Depends on request delete procedure. * *---------------------------------------------------------------------- */ static void FreeUrl2File(void *arg) { Url2File *u2fPtr = (Url2File *) arg; if (--u2fPtr->refcnt == 0) { if (u2fPtr->delete != NULL) { (*u2fPtr->delete)(u2fPtr->arg); } ns_free(u2fPtr); } } |
From: Stephen D. <sd...@us...> - 2005-11-07 03:19:13
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23688/tests Added Files: url2file.test Log Message: * include/ns.h: * nsd/nsd.h: * nsd/Makefile: * nsd/url2file.c: * nsd/fastpath.c: * nsd/info.c: * nsd/init.c: * nsd/proc.c: * nsd/server.c: * nsd/tclcmds.c: * nsd/tclfile.c: * tests/ns_info.test: * tests/url2file.test: Add new, flexible urlspace-based Url2File C API and matching Tcl commands. (RFE: 1333811) --- NEW FILE: url2file.test --- # # $Header: /cvsroot/naviserver/naviserver/tests/url2file.test,v 1.1 2005/11/07 03:19:05 sdeasey Exp $ # package require tcltest 2.2 namespace import -force ::tcltest::* eval ::tcltest::configure $argv test url2file-1.1 {basic syntax} -body { ns_url2file } -returnCodes error -result {wrong # args: should be "ns_url2file url"} test ns_log-1.2 {basic syntax} -body { ns_register_url2file } -returnCodes error -result {wrong # args: should be "ns_register_url2file ?-noinherit? ?--? url script ?arg?"} test url2file-1.3 {basic syntax} -body { ns_register_fasturl2file } -returnCodes error -result {wrong # args: should be "ns_register_fasturl2file ?-noinherit? ?--? url ?basepath?"} test url2file-1.4 {basic syntax} -body { ns_unregister_url2file } -returnCodes error -result {wrong # args: should be "ns_unregister_url2file ?-noinherit? ?-recurse? ?--? url"} test url2file-2.1 {ns_url2file} -setup { ns_register_proc GET /url2file {ns_return 200 text/plain [ns_url2file /foo] ;#} } -body { nstest_http -getbody 1 GET /url2file } -cleanup { ns_unregister_proc GET /url2file } -result [list 200 [ns_pagepath foo]] test url2file-3.1 {ns_register_url2file} -body { ns_url2file /x/y } -result [ns_pagepath x y] test url2file-3.2 {ns_register_url2file} -setup { ns_register_url2file /x {string toupper } } -body { ns_url2file /x/y } -cleanup { ns_unregister_url2file /x } -result /X/Y test url2file-3.3 {ns_register_url2file} -setup { ns_register_url2file -noinherit /x {string toupper } } -body { ns_url2file /x/y } -cleanup { ns_unregister_url2file -noinherit /x } -result [ns_pagepath x y] test url2file-3.4 {ns_register_url2file} -setup { ns_register_url2file /x {error x} } -body { ns_logctl hold ns_url2file /x ns_logctl flush } -cleanup { ns_unregister_url2file /x } -returnCodes error -result "url2file lookup failed" test url2file-4.1 {ns_register_fasturl2file} -setup { ns_register_url2file /x {string toupper } ns_register_fasturl2file /x/y } -body { ns_url2file /x/y } -cleanup { ns_unregister_url2file /x/y ns_unregister_url2file /x } -result [ns_pagepath x y] test url2file-4.2 {ns_register_fasturl2file} -setup { ns_register_fasturl2file /x /base } -body { ns_url2file /x/y } -cleanup { ns_unregister_url2file /x } -result /base/y test url2file-4.3 {ns_register_fasturl2file} -setup { ns_register_fasturl2file /x base } -body { ns_url2file /x/y } -cleanup { ns_unregister_url2file /x } -result [ns_pagepath base y] test url2file-5.1 {ns_unregister_url2file -recurse} -setup { ns_register_url2file /x {error /x} ns_register_url2file /x/y {error /x/y} ns_unregister_url2file -recurse /x } -body { ns_url2file /x/y } -result [ns_pagepath x y] test url2file-6.1 {url2file info} -setup { ns_register_url2file /url1 script ns_register_fasturl2file /url2 /base } -body { ns_info url2file } -cleanup { ns_unregister_url2file /url1 ns_unregister_url2file /url2 } -result [list [list [ns_info server] x /url1* ns:tclurl2file script] \ [list [ns_info server] x /url2* ns:mounturl2file /base /url2] \ [list [ns_info server] x * ns:fasturl2file [ns_info server]] ] cleanupTests |
From: Stephen D. <sd...@us...> - 2005-11-07 03:18:04
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23250/nsd Modified Files: Makefile fastpath.c info.c init.c nsd.h proc.c server.c tclcmds.c tclfile.c Log Message: * include/ns.h: * nsd/nsd.h: * nsd/Makefile: * nsd/url2file.c: * nsd/fastpath.c: * nsd/info.c: * nsd/init.c: * nsd/proc.c: * nsd/server.c: * nsd/tclcmds.c: * nsd/tclfile.c: * tests/ns_info.test: * tests/url2file.test: Add new, flexible urlspace-based Url2File C API and matching Tcl commands. (RFE: 1333811) Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** fastpath.c 10 Oct 2005 13:33:23 -0000 1.24 --- fastpath.c 7 Nov 2005 03:17:55 -0000 1.25 *************** *** 192,244 **** /* *---------------------------------------------------------------------- - * Ns_SetUrlToFileProc -- - * - * Set pointer to custom routine that acts like Ns_UrlToFile(); - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - - void - Ns_SetUrlToFileProc(CONST char *server, Ns_UrlToFileProc *procPtr) - { - NsServer *servPtr = NsGetServer(server); - - servPtr->fastpath.url2file = procPtr; - } - - - /* - *---------------------------------------------------------------------- - * Ns_UrlToFile -- - * - * Construct the filename that corresponds to a URL. - * - * Results: - * Return NS_OK on success or NS_ERROR on failure. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - - - int - Ns_UrlToFile(Ns_DString *dsPtr, CONST char *server, CONST char *url) - { - NsServer *servPtr = NsGetServer(server); - - return NsUrlToFile(dsPtr, servPtr, url); - } - - - /* - *---------------------------------------------------------------------- * Ns_UrlIsFile, Ns_UrlIsDir -- * --- 192,195 ---- *************** *** 697,722 **** } - - int - NsUrlToFile(Ns_DString *dsPtr, NsServer *servPtr, CONST char *url) - { - int status; - - if (servPtr->fastpath.url2file != NULL) { - status = (*servPtr->fastpath.url2file)(dsPtr, servPtr->server, url); - } else { - NsPageRoot(dsPtr, servPtr, NULL); - Ns_MakePath(dsPtr, url, NULL); - status = NS_OK; - } - if (status == NS_OK) { - while (dsPtr->length > 0 && dsPtr->string[dsPtr->length-1] == '/') { - Ns_DStringTrunc(dsPtr, dsPtr->length-1); - } - } - - return status; - } - /* --- 648,651 ---- Index: Makefile =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile 12 Jul 2005 08:26:04 -0000 1.6 --- Makefile 7 Nov 2005 03:17:55 -0000 1.7 *************** *** 49,53 **** tclinit.o tcljob.o tclmisc.o tclobj.o tclobjv.o tclrequest.o tclresp.o \ tclsched.o tclset.o tclshare.o tclsock.o tclthread.o tcltime.o tclvar.o \ ! tclxkeylist.o unix.o url.o urlencode.o urlopen.o urlspace.o \ uuencode.o --- 49,53 ---- tclinit.o tcljob.o tclmisc.o tclobj.o tclobjv.o tclrequest.o tclresp.o \ tclsched.o tclset.o tclshare.o tclsock.o tclthread.o tcltime.o tclvar.o \ ! tclxkeylist.o unix.o url.o url2file.o urlencode.o urlopen.o urlspace.o \ uuencode.o Index: tclcmds.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclcmds.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tclcmds.c 22 Oct 2005 12:50:39 -0000 1.24 --- tclcmds.c 7 Nov 2005 03:17:55 -0000 1.25 *************** *** 126,132 **** --- 126,134 ---- NsTclRandObjCmd, NsTclRegisterAdpObjCmd, + NsTclRegisterFastUrl2FileObjCmd, NsTclRegisterFilterObjCmd, NsTclRegisterProcObjCmd, NsTclRegisterTraceObjCmd, + NsTclRegisterUrl2FileObjCmd, NsTclRequestAuthorizeObjCmd, NsTclRespondObjCmd, *************** *** 175,178 **** --- 177,181 ---- NsTclTruncateObjCmd, NsTclUnRegisterObjCmd, + NsTclUnRegisterUrl2FileObjCmd, NsTclUnscheduleObjCmd, NsTclUrl2FileObjCmd, *************** *** 385,391 **** --- 388,396 ---- {"ns_register_adp", NULL, NsTclRegisterAdpObjCmd}, {"ns_register_adptag", NsTclRegisterTagCmd, NULL}, + {"ns_register_fasturl2file", NULL, NsTclRegisterFastUrl2FileObjCmd}, {"ns_register_filter", NULL, NsTclRegisterFilterObjCmd}, {"ns_register_proc", NULL, NsTclRegisterProcObjCmd}, {"ns_register_trace", NULL, NsTclRegisterTraceObjCmd}, + {"ns_register_url2file", NULL, NsTclRegisterUrl2FileObjCmd}, {"ns_requestauthorize", NULL, NsTclRequestAuthorizeObjCmd}, {"ns_respond", NULL, NsTclRespondObjCmd}, *************** *** 409,412 **** --- 414,418 ---- {"ns_unregister_adp", NULL, NsTclUnRegisterObjCmd}, {"ns_unregister_proc", NULL, NsTclUnRegisterObjCmd}, + {"ns_unregister_url2file", NULL, NsTclUnRegisterUrl2FileObjCmd}, {"ns_url2file", NULL, NsTclUrl2FileObjCmd}, {"ns_var", NULL, NsTclVarObjCmd}, Index: init.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/init.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** init.c 8 Oct 2005 12:06:07 -0000 1.5 --- init.c 7 Nov 2005 03:17:55 -0000 1.6 *************** *** 83,86 **** --- 83,87 ---- NsInitUrlSpace(); NsInitRequests(); + NsInitUrl2File(); } } Index: server.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/server.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** server.c 9 Oct 2005 22:27:24 -0000 1.13 --- server.c 7 Nov 2005 03:17:55 -0000 1.14 *************** *** 420,423 **** --- 420,430 ---- /* + * Register the url2file procs. + */ + + Ns_RegisterUrl2FileProc(server, "/", Ns_FastUrl2FileProc, NULL, servPtr, 0); + Ns_SetUrlToFileProc(server, NsUrlToFileProc); + + /* * Initialize ADP. */ Index: nsd.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsd.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** nsd.h 16 Oct 2005 08:52:48 -0000 1.36 --- nsd.h 7 Nov 2005 03:17:55 -0000 1.37 *************** *** 840,843 **** --- 840,844 ---- extern void NsInitUrlSpace(void); extern void NsInitRequests(void); + extern void NsInitUrl2File(void); extern void NsConfigLog(void); *************** *** 885,888 **** --- 886,893 ---- extern Ns_ArgProc NsTclRequestArgProc; extern Ns_TclTraceProc NsTclTraceProc; + extern Ns_UrlToFileProc NsUrlToFileProc; + extern Ns_Url2FileProc NsTclUrl2FileProc; + extern Ns_Url2FileProc NsMountUrl2FileProc; + extern Ns_ArgProc NsMountUrl2FileArgProc; extern void NsGetCallbacks(Tcl_DString *dsPtr); *************** *** 892,895 **** --- 897,901 ---- extern void NsGetFilters(Tcl_DString *dsPtr, char *server); extern void NsGetRequestProcs(Tcl_DString *dsPtr, CONST char *server); + extern void NsGetUrl2FileProcs(Ns_DString *dsPtr, CONST char *server); #ifdef _WIN32 Index: tclfile.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclfile.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tclfile.c 21 Oct 2005 10:07:26 -0000 1.9 --- tclfile.c 7 Nov 2005 03:17:55 -0000 1.10 *************** *** 276,316 **** *---------------------------------------------------------------------- * - * NsTclUrl2FileObjCmd -- - * - * Implements ns_url2file as obj command. - * - * Results: - * Tcl result. - * - * Side effects: - * See docs. - * - *---------------------------------------------------------------------- - */ - - int - NsTclUrl2FileObjCmd(ClientData arg, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) - { - NsInterp *itPtr = arg; - Ns_DString ds; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "url"); - return TCL_ERROR; - } - - Ns_DStringInit(&ds); - NsUrlToFile(&ds, itPtr->servPtr, Tcl_GetString(objv[1])); - Tcl_SetResult(interp, ds.string, TCL_VOLATILE); - Ns_DStringFree(&ds); - - return TCL_OK; - } - - - /* - *---------------------------------------------------------------------- - * * NsTclKillObjCmd -- * --- 276,279 ---- Index: info.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/info.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** info.c 12 Jun 2005 14:42:44 -0000 1.7 --- info.c 7 Nov 2005 03:17:55 -0000 1.8 *************** *** 480,484 **** int opt; NsInterp *itPtr = arg; ! char *elog; Tcl_DString ds; static CONST char *opts[] = { --- 480,484 ---- int opt; NsInterp *itPtr = arg; ! char *server, *elog; Tcl_DString ds; static CONST char *opts[] = { *************** *** 488,492 **** "pid", "platform", "pools", "scheduled", "server", "servers", "sockcallbacks", "tag", "tcllib", "threads", "uptime", ! "version", "winnt", "filters", "traces", "requestprocs", NULL }; enum { --- 488,493 ---- "pid", "platform", "pools", "scheduled", "server", "servers", "sockcallbacks", "tag", "tcllib", "threads", "uptime", ! "version", "winnt", "filters", "traces", "requestprocs", ! "url2file", NULL }; enum { *************** *** 497,500 **** --- 498,502 ---- sockICallbacksIdx, ITagIdx, ITclLibIdx, IThreadsIdx, IUptimeIdx, IVersionIdx, IWinntIdx, IFiltersIdx, ITracesIdx, IRequestProcsIdx, + IUrl2FileIdx }; *************** *** 509,512 **** --- 511,515 ---- Tcl_DStringInit(&ds); + switch (opt) { case IArgv0Idx: *************** *** 541,559 **** break; - case IFiltersIdx: - NsGetFilters(&ds, itPtr->servPtr ? itPtr->servPtr->server : 0); - Tcl_DStringResult(interp, &ds); - break; - - case ITracesIdx: - NsGetTraces(&ds, itPtr->servPtr ? itPtr->servPtr->server : 0); - Tcl_DStringResult(interp, &ds); - break; - - case IRequestProcsIdx: - NsGetRequestProcs(&ds, itPtr->servPtr ? itPtr->servPtr->server : 0); - Tcl_DStringResult(interp, &ds); - break; - case ILocksIdx: Ns_MutexList(&ds); --- 544,547 ---- *************** *** 641,661 **** Tcl_SetResult(interp, nsconf.servers.string, TCL_STATIC); break; - case ITclLibIdx: - case IPageRootIdx: - case IServerIdx: if (itPtr->servPtr == NULL) { Tcl_SetResult(interp, "no server", TCL_STATIC); return TCL_ERROR; } ! if (opt == IServerIdx) { ! Tcl_SetResult(interp, itPtr->servPtr->server, TCL_STATIC); ! } else if (opt == ITclLibIdx) { ! Tcl_SetResult(interp, itPtr->servPtr->tcl.library, TCL_STATIC); ! } else { NsPageRoot(&ds, itPtr->servPtr, NULL); Tcl_DStringResult(interp, &ds); ! } } return TCL_OK; } --- 629,679 ---- Tcl_SetResult(interp, nsconf.servers.string, TCL_STATIC); break; + } + + /* + * The following subcommands require a virtual server. + */ if (itPtr->servPtr == NULL) { Tcl_SetResult(interp, "no server", TCL_STATIC); return TCL_ERROR; } ! server = itPtr->servPtr->server; ! ! switch (opt) { ! case IPageRootIdx: NsPageRoot(&ds, itPtr->servPtr, NULL); Tcl_DStringResult(interp, &ds); ! break; ! ! case IServerIdx: ! Tcl_SetResult(interp, server, TCL_STATIC); ! break; ! ! case ITclLibIdx: ! Tcl_SetResult(interp, itPtr->servPtr->tcl.library, TCL_STATIC); ! break; ! ! case IFiltersIdx: ! NsGetFilters(&ds, server); ! Tcl_DStringResult(interp, &ds); ! break; ! ! case ITracesIdx: ! NsGetTraces(&ds, server); ! Tcl_DStringResult(interp, &ds); ! break; ! ! case IRequestProcsIdx: ! NsGetRequestProcs(&ds, server); ! Tcl_DStringResult(interp, &ds); ! break; ! ! case IUrl2FileIdx: ! NsGetUrl2FileProcs(&ds, server); ! Tcl_DStringResult(interp, &ds); ! break; } + return TCL_OK; } Index: proc.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/proc.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** proc.c 12 Jul 2005 11:19:22 -0000 1.8 --- proc.c 7 Nov 2005 03:17:55 -0000 1.9 *************** *** 82,85 **** --- 82,88 ---- {(void *) NsFastGet, "ns:fastget", ServerArgProc}, {(void *) NsTclTraceProc, "ns:tcltrace", Ns_TclCallbackArgProc}, + {(void *) NsTclUrl2FileProc, "ns:tclurl2file", Ns_TclCallbackArgProc}, + {(void *) NsMountUrl2FileProc, "ns:mounturl2file", NsMountUrl2FileArgProc}, + {(void *) Ns_FastUrl2FileProc, "ns:fasturl2file", ServerArgProc}, {NULL, NULL, NULL} }; |
From: Stephen D. <sd...@us...> - 2005-11-07 03:18:03
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23250/tests Modified Files: ns_info.test Log Message: * include/ns.h: * nsd/nsd.h: * nsd/Makefile: * nsd/url2file.c: * nsd/fastpath.c: * nsd/info.c: * nsd/init.c: * nsd/proc.c: * nsd/server.c: * nsd/tclcmds.c: * nsd/tclfile.c: * tests/ns_info.test: * tests/url2file.test: Add new, flexible urlspace-based Url2File C API and matching Tcl commands. (RFE: 1333811) Index: ns_info.test =================================================================== RCS file: /cvsroot/naviserver/naviserver/tests/ns_info.test,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ns_info.test 2 Nov 2005 20:19:24 -0000 1.3 --- ns_info.test 7 Nov 2005 03:17:56 -0000 1.4 *************** *** 14,18 **** test ns_info-1.2 {basic syntax: wrong argument} -body { ns_info 123 ! } -returnCodes error -result {bad option "123": must be address, argv0, boottime, builddate, callbacks, config, home, hostname, locks, log, major, minor, name, nsd, pageroot, patchlevel, pid, platform, pools, scheduled, server, servers, sockcallbacks, tag, tcllib, threads, uptime, version, winnt, filters, traces, or requestprocs} test ns_info-2.1.1 {basic operation} -body { --- 14,18 ---- test ns_info-1.2 {basic syntax: wrong argument} -body { ns_info 123 ! } -returnCodes error -result {bad option "123": must be address, argv0, boottime, builddate, callbacks, config, home, hostname, locks, log, major, minor, name, nsd, pageroot, patchlevel, pid, platform, pools, scheduled, server, servers, sockcallbacks, tag, tcllib, threads, uptime, version, winnt, filters, traces, requestprocs, or url2file} test ns_info-2.1.1 {basic operation} -body { |
From: Stephen D. <sd...@us...> - 2005-11-07 03:18:03
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23250/include Modified Files: ns.h Log Message: * include/ns.h: * nsd/nsd.h: * nsd/Makefile: * nsd/url2file.c: * nsd/fastpath.c: * nsd/info.c: * nsd/init.c: * nsd/proc.c: * nsd/server.c: * nsd/tclcmds.c: * nsd/tclfile.c: * tests/ns_info.test: * tests/url2file.test: Add new, flexible urlspace-based Url2File C API and matching Tcl commands. (RFE: 1333811) Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** ns.h 2 Nov 2005 21:18:20 -0000 1.57 --- ns.h 7 Nov 2005 03:17:55 -0000 1.58 *************** *** 523,526 **** --- 523,527 ---- typedef int (Ns_FilterProc) (void *arg, Ns_Conn *conn, int why); typedef int (Ns_UrlToFileProc) (Ns_DString *dsPtr, CONST char *server, CONST char *url); + typedef int (Ns_Url2FileProc) (Ns_DString *dsPtr, CONST char *url, void *arg); typedef char *(Ns_ServerRootProc) (Ns_DString *dest, CONST char *host, void *arg); typedef char *(Ns_ConnLocationProc) (Ns_Conn *conn, Ns_DString *dest, void *arg); *************** *** 909,918 **** NS_GNUC_DEPRECATED; - NS_EXTERN void - Ns_SetUrlToFileProc(CONST char *server, Ns_UrlToFileProc *procPtr); - - NS_EXTERN int - Ns_UrlToFile(Ns_DString *dsPtr, CONST char *server, CONST char *url); - NS_EXTERN int Ns_UrlIsFile(CONST char *server, CONST char *url); --- 910,913 ---- *************** *** 1783,1786 **** --- 1778,1807 ---- /* + * url2file.c: + */ + + NS_EXTERN void + Ns_RegisterUrl2FileProc(CONST char *server, CONST char *url, + Ns_Url2FileProc *proc, Ns_Callback *delete, + void *arg, int flags) + NS_GNUC_NONNULL(1) NS_GNUC_NONNULL(2) NS_GNUC_NONNULL(3); + + NS_EXTERN void + Ns_UnRegisterUrl2FileProc(CONST char *server, CONST char *url, int inherit) + NS_GNUC_NONNULL(1) NS_GNUC_NONNULL(2); + + NS_EXTERN int + Ns_UrlToFile(Ns_DString *dsPtr, CONST char *server, CONST char *url) + NS_GNUC_NONNULL(1) NS_GNUC_NONNULL(2) NS_GNUC_NONNULL(3); + + NS_EXTERN void + Ns_SetUrlToFileProc(CONST char *server, Ns_UrlToFileProc *procPtr) + NS_GNUC_NONNULL(1) NS_GNUC_NONNULL(2); + + + NS_EXTERN Ns_Url2FileProc Ns_FastUrl2FileProc; + + + /* * urlencode.c: */ |
From: Stephen D. <sd...@us...> - 2005-11-07 03:18:03
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23250 Modified Files: ChangeLog Log Message: * include/ns.h: * nsd/nsd.h: * nsd/Makefile: * nsd/url2file.c: * nsd/fastpath.c: * nsd/info.c: * nsd/init.c: * nsd/proc.c: * nsd/server.c: * nsd/tclcmds.c: * nsd/tclfile.c: * tests/ns_info.test: * tests/url2file.test: Add new, flexible urlspace-based Url2File C API and matching Tcl commands. (RFE: 1333811) Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.243 retrieving revision 1.244 diff -C2 -d -r1.243 -r1.244 *** ChangeLog 3 Nov 2005 16:17:45 -0000 1.243 --- ChangeLog 7 Nov 2005 03:17:54 -0000 1.244 *************** *** 1,2 **** --- 1,19 ---- + 2005-11-06 Stephen Deasey <sd...@us...> + + * include/ns.h: + * nsd/nsd.h: + * nsd/Makefile: + * nsd/url2file.c: + * nsd/fastpath.c: + * nsd/info.c: + * nsd/init.c: + * nsd/proc.c: + * nsd/server.c: + * nsd/tclcmds.c: + * nsd/tclfile.c: + * tests/ns_info.test: + * tests/url2file.test: Add new, flexible urlspace-based Url2File C + API and matching Tcl commands. (RFE: 1333811) + 2005-11-02 Vlad Seryakov <ser...@us...> |
From: Vlad S. <ser...@us...> - 2005-11-03 16:17:56
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1156 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.242 retrieving revision 1.243 diff -C2 -d -r1.242 -r1.243 *** ChangeLog 2 Nov 2005 21:18:20 -0000 1.242 --- ChangeLog 3 Nov 2005 16:17:45 -0000 1.243 *************** *** 1,4 **** --- 1,9 ---- 2005-11-02 Vlad Seryakov <ser...@us...> + * nsd/binder.c: All Ns_SockListen routines support + forked binder now if direct socket allocation failed + + 2005-11-02 Vlad Seryakov <ser...@us...> + * tests/ns_info.test: added 1 second delay to make ns_info uptime report uptime > 0 successfuly |
From: Vlad S. <ser...@us...> - 2005-11-03 16:17:56
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1156/nsd Modified Files: binder.c Log Message: Index: binder.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/binder.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** binder.c 3 Nov 2005 07:15:09 -0000 1.16 --- binder.c 3 Nov 2005 16:17:46 -0000 1.17 *************** *** 132,135 **** --- 132,144 ---- } + /* + * If forked binder is running and we could not allocate socket + * directly, try to do it through the binder + */ + + if (sock == -1 && binderRunning) { + sock = Ns_SockBinderListen('T', address, port, backlog); + } + return (SOCKET)sock; } *************** *** 173,176 **** --- 182,193 ---- } + /* + * If forked binder is running and we could not allocate socket + * directly, try to do it through the binder + */ + + if (sock == -1 && binderRunning) { + sock = Ns_SockBinderListen('U', address, port, 0); + } return (SOCKET)sock; } *************** *** 216,219 **** --- 233,245 ---- } + /* + * If forked binder is running and we could not allocate socket + * directly, try to do it through the binder + */ + + if (sock == -1 && binderRunning) { + sock = Ns_SockBinderListen('R', 0, proto, proto); + } + return (SOCKET)sock; } *************** *** 267,270 **** --- 293,305 ---- Ns_SetSockErrno(err); } + + /* + * If forked binder is running and we could not allocate socket + * directly, try to do it through the binder + */ + + if (sock == -1 && binderRunning) { + sock = Ns_SockBinderListen('D', path, 0, backlog); + } #endif *************** *** 440,444 **** Tcl_Channel chan = Tcl_OpenFileChannel(NULL, file, "r", 0); if (chan == NULL) { ! Ns_Log(Error, "binder: can't open file '%s': '%s'", file, strerror(Tcl_GetErrno())); } else { --- 475,479 ---- Tcl_Channel chan = Tcl_OpenFileChannel(NULL, file, "r", 0); if (chan == NULL) { ! Ns_Log(Error, "NsPreBind: can't open file '%s': '%s'", file, strerror(Tcl_GetErrno())); } else { *************** *** 807,813 **** sock = -1; } - if (address == NULL) { - address = "0.0.0.0"; - } if (err == 0) { Ns_Log(Notice, "Ns_SockBinderListen: listen(%s,%d) = %d", --- 842,845 ---- *************** *** 853,857 **** if (ns_sockpair(binderRequest) != 0 || ns_sockpair(binderResponse) != 0) { ! Ns_Fatal("binder: ns_sockpair() failed: '%s'", strerror(errno)); } --- 885,889 ---- if (ns_sockpair(binderRequest) != 0 || ns_sockpair(binderResponse) != 0) { ! Ns_Fatal("NsForkBinder: ns_sockpair() failed: '%s'", strerror(errno)); } *************** *** 866,874 **** pid = ns_fork(); if (pid < 0) { ! Ns_Fatal("binder: fork() failed: '%s'", strerror(errno)); } else if (pid == 0) { pid = ns_fork(); if (pid < 0) { ! Ns_Fatal("binder: fork() failed: '%s'", strerror(errno)); } else if (pid == 0) { close(binderRequest[1]); --- 898,906 ---- pid = ns_fork(); if (pid < 0) { ! Ns_Fatal("NsForkBinder: fork() failed: '%s'", strerror(errno)); } else if (pid == 0) { pid = ns_fork(); if (pid < 0) { ! Ns_Fatal("NsForkBinder: fork() failed: '%s'", strerror(errno)); } else if (pid == 0) { close(binderRequest[1]); *************** *** 879,886 **** } if (Ns_WaitForProcess(pid, &status) != NS_OK) { ! Ns_Fatal("binder: Ns_WaitForProcess(%d) failed: '%s'", pid, strerror(errno)); } else if (status != 0) { ! Ns_Fatal("binder: process %d exited with non-zero status: %d", pid, status); } --- 911,918 ---- } if (Ns_WaitForProcess(pid, &status) != NS_OK) { ! Ns_Fatal("NsForkBinder: Ns_WaitForProcess(%d) failed: '%s'", pid, strerror(errno)); } else if (status != 0) { ! Ns_Fatal("NsForkBinder: process %d exited with non-zero status: %d", pid, status); } *************** *** 948,951 **** --- 980,985 ---- #endif + Ns_Log(Notice, "binder: started"); + /* * Endlessly listen for socket bind requests. *************** *** 1036,1038 **** --- 1070,1073 ---- } } + Ns_Log(Notice, "binder: stopped"); } |
From: Vlad S. <ser...@us...> - 2005-11-03 14:46:14
|
Update of /cvsroot/naviserver/modules/nsdns In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13618 Modified Files: nsdns.c Log Message: Index: nsdns.c =================================================================== RCS file: /cvsroot/naviserver/modules/nsdns/nsdns.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** nsdns.c 2 Nov 2005 21:18:20 -0000 1.18 --- nsdns.c 3 Nov 2005 14:46:01 -0000 1.19 *************** *** 151,162 **** if(dnsPort > 0) { // UDP socket ! if((dnsUdpSock = Ns_SockListenUdp(address,dnsPort)) == -1 && ! (dnsUdpSock = Ns_SockBinderListen('U',address,dnsPort,0)) == -1) { Ns_Log(Error,"nsdns: udp: %s:%d: couldn't create socket: %s",address,dnsPort,strerror(errno)); return NS_ERROR; } // TCP socket ! if((dnsTcpSock = Ns_SockListen(address,dnsPort)) == -1 && ! (dnsTcpSock = Ns_SockBinderListen('T',address,dnsPort,32)) == -1) { Ns_Log(Error,"nsdns: tcp: %s:%d: couldn't create socket: %s",address,dnsPort,strerror(errno)); return NS_ERROR; --- 151,160 ---- if(dnsPort > 0) { // UDP socket ! if((dnsUdpSock = Ns_SockListenUdp(address,dnsPort)) == -1) { Ns_Log(Error,"nsdns: udp: %s:%d: couldn't create socket: %s",address,dnsPort,strerror(errno)); return NS_ERROR; } // TCP socket ! if((dnsTcpSock = Ns_SockListen(address,dnsPort)) == -1) { Ns_Log(Error,"nsdns: tcp: %s:%d: couldn't create socket: %s",address,dnsPort,strerror(errno)); return NS_ERROR; |
From: Zoran V. <vas...@us...> - 2005-11-03 07:15:17
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20519/nsd Modified Files: binder.c Log Message: Untabify, reindent Index: binder.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/binder.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** binder.c 2 Nov 2005 23:07:15 -0000 1.15 --- binder.c 3 Nov 2005 07:15:09 -0000 1.16 *************** *** 51,58 **** typedef struct CMsg { ! unsigned int len; ! int level; ! int type; ! int fds[1]; } CMsg; --- 51,58 ---- typedef struct CMsg { ! unsigned int len; ! int level; ! int type; ! int fds[1]; } CMsg; *************** *** 66,70 **** */ ! static Ns_Mutex lock; static Tcl_HashTable preboundTcp; static Tcl_HashTable preboundUdp; --- 66,70 ---- */ ! static Ns_Mutex lock; static Tcl_HashTable preboundTcp; static Tcl_HashTable preboundUdp; *************** *** 106,110 **** Ns_SockListenEx(char *address, int port, int backlog) { ! int sock = -1; struct sockaddr_in sa; --- 106,110 ---- Ns_SockListenEx(char *address, int port, int backlog) { ! int sock = -1; struct sockaddr_in sa; *************** *** 155,159 **** Ns_SockListenUdp(char *address, int port) { ! int sock = -1; struct sockaddr_in sa; --- 155,159 ---- Ns_SockListenUdp(char *address, int port) { ! int sock = -1; struct sockaddr_in sa; *************** *** 196,201 **** Ns_SockListenRaw(int proto) { ! int sock = -1; ! Tcl_HashEntry *hPtr; Tcl_HashSearch search; --- 196,201 ---- Ns_SockListenRaw(int proto) { ! int sock = -1; ! Tcl_HashEntry *hPtr; Tcl_HashSearch search; *************** *** 239,244 **** Ns_SockListenUnix(char *path, int backlog) { ! int sock = -1; ! Tcl_HashEntry *hPtr; Tcl_HashSearch search; --- 239,244 ---- Ns_SockListenUnix(char *path, int backlog) { ! int sock = -1; ! Tcl_HashEntry *hPtr; Tcl_HashSearch search; *************** *** 292,309 **** Ns_SockBindUdp(struct sockaddr_in *saPtr) { ! int sock = -1, n = 1; ! sock = socket(AF_INET,SOCK_DGRAM, 0); ! if (sock == -1 ! || setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*)&n,sizeof(n)) == -1 ! || bind(sock,(struct sockaddr*)saPtr,sizeof(struct sockaddr_in)) == -1) { ! int err = errno; ! close(sock); ! sock = -1; ! Ns_SetSockErrno(err); ! } ! return (SOCKET)sock; } --- 292,309 ---- Ns_SockBindUdp(struct sockaddr_in *saPtr) { ! int sock = -1, n = 1; ! sock = socket(AF_INET,SOCK_DGRAM, 0); ! if (sock == -1 ! || setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*)&n,sizeof(n)) == -1 ! || bind(sock,(struct sockaddr*)saPtr,sizeof(struct sockaddr_in)) == -1) { ! int err = errno; ! close(sock); ! sock = -1; ! Ns_SetSockErrno(err); ! } ! return (SOCKET)sock; } *************** *** 329,333 **** Ns_SockBindUnix(char *path) { ! int sock = -1; struct sockaddr_un addr; --- 329,333 ---- Ns_SockBindUnix(char *path) { ! int sock = -1; struct sockaddr_un addr; *************** *** 374,388 **** Ns_SockBindRaw(int proto) { ! int sock = -1; ! sock = socket(AF_INET,SOCK_RAW, proto); ! if (sock == -1) { ! int err = errno; ! close(sock); ! Ns_SetSockErrno(err); ! } ! return (SOCKET)sock; } --- 374,388 ---- Ns_SockBindRaw(int proto) { ! int sock = -1; ! sock = socket(AF_INET,SOCK_RAW, proto); ! if (sock == -1) { ! int err = errno; ! close(sock); ! Ns_SetSockErrno(err); ! } ! return (SOCKET)sock; } *************** *** 481,488 **** return; #else ! Tcl_HashEntry *hPtr; ! Tcl_HashSearch search; ! char *addr; ! int port, sock; struct sockaddr_in *saPtr; --- 481,488 ---- return; #else ! Tcl_HashEntry *hPtr; ! Tcl_HashSearch search; ! char *addr; ! int port, sock; struct sockaddr_in *saPtr; *************** *** 594,601 **** return; #else ! Tcl_HashEntry *hPtr; ! int new, sock, port; struct sockaddr_in sa; - char *next, *str, *addr, *proto; for (;line != NULL; line = next) { --- 594,601 ---- return; #else ! Tcl_HashEntry *hPtr; ! int new, sock, port; ! char *next, *str, *addr, *proto; struct sockaddr_in sa; for (;line != NULL; line = next) { *************** *** 712,722 **** } /* *---------------------------------------------------------------------- * ! * Ns_SockBinder -- * ! * Create a new TCP/UDP/Unix socket bound to the specified port and ! * listening for new connections. * * The following types are defined: --- 712,723 ---- } + /* *---------------------------------------------------------------------- * ! * Ns_SockBinderListen -- * ! * Create a new TCP/UDP/Unix socket bound to the specified port ! * and listening for new connections. * * The following types are defined: *************** *** 727,734 **** * * Results: ! * Socket descriptor or -1 on error. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 728,735 ---- * * Results: ! * Socket descriptor or -1 on error. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 738,746 **** Ns_SockBinderListen(int type, char *address, int port, int options) { ! int err; ! SOCKET sock; ! char data[64]; struct msghdr msg; ! struct iovec iov[4]; #ifdef HAVE_CMMSG CMsg cm; --- 739,748 ---- Ns_SockBinderListen(int type, char *address, int port, int options) { ! int err; ! SOCKET sock; ! char data[64]; struct msghdr msg; ! struct iovec iov[4]; ! #ifdef HAVE_CMMSG CMsg cm; *************** *** 764,768 **** msg.msg_iovlen = 4; if (sendmsg(binderRequest[1], (struct msghdr *) &msg, 0) != REQUEST_SIZE) { ! Ns_Log(Error, "Ns_SockBinderListen: sendmsg() failed: '%s'", strerror(errno)); return -1; } --- 766,771 ---- msg.msg_iovlen = 4; if (sendmsg(binderRequest[1], (struct msghdr *) &msg, 0) != REQUEST_SIZE) { ! Ns_Log(Error, "Ns_SockBinderListen: sendmsg() failed: '%s'", ! strerror(errno)); return -1; } *************** *** 785,791 **** #endif if (recvmsg(binderResponse[0], (struct msghdr *) &msg, 0) != RESPONSE_SIZE) { ! Ns_Log(Error, "Ns_SockBinderListen: recvmsg() failed: '%s'", strerror(errno)); return -1; } #ifdef HAVE_CMMSG sock = cm.fds[0]; --- 788,796 ---- #endif if (recvmsg(binderResponse[0], (struct msghdr *) &msg, 0) != RESPONSE_SIZE) { ! Ns_Log(Error, "Ns_SockBinderListen: recvmsg() failed: '%s'", ! strerror(errno)); return -1; } + #ifdef HAVE_CMMSG sock = cm.fds[0]; *************** *** 806,819 **** } if (err == 0) { ! Ns_Log(Notice, "Ns_SockBinderListen: listen(%s,%d) = %d", address, port, sock); } else { Ns_SetSockErrno(err); sock = -1; Ns_Log(Error, "Ns_SockBinderListen: listen(%s,%d) failed: '%s'", ! address, port, ns_sockstrerror(ns_sockerrno)); } return sock; } /* *---------------------------------------------------------------------- --- 811,827 ---- } if (err == 0) { ! Ns_Log(Notice, "Ns_SockBinderListen: listen(%s,%d) = %d", ! address, port, sock); } else { Ns_SetSockErrno(err); sock = -1; Ns_Log(Error, "Ns_SockBinderListen: listen(%s,%d) failed: '%s'", ! address, port, ns_sockstrerror(ns_sockerrno)); } + return sock; } + /* *---------------------------------------------------------------------- *************** *** 821,833 **** * NsForkBinder -- * ! * Fork of the slave bind/listen process. This routine is called ! * by main() when the server starts as root. * * Results: ! * None. * * Side effects: ! * The binderRunning, binderRequest, binderResponse static variables ! * are updated. * *---------------------------------------------------------------------- --- 829,841 ---- * NsForkBinder -- * ! * Fork of the slave bind/listen process. This routine is called ! * by main() when the server starts as root. * * Results: ! * None. * * Side effects: ! * The binderRunning, binderRequest, binderResponse static variables ! * are updated. * *---------------------------------------------------------------------- *************** *** 845,849 **** if (ns_sockpair(binderRequest) != 0 || ns_sockpair(binderResponse) != 0) { ! Ns_Fatal("binder: ns_sockpair() failed: '%s'", strerror(errno)); } --- 853,857 ---- if (ns_sockpair(binderRequest) != 0 || ns_sockpair(binderResponse) != 0) { ! Ns_Fatal("binder: ns_sockpair() failed: '%s'", strerror(errno)); } *************** *** 858,879 **** pid = ns_fork(); if (pid < 0) { ! Ns_Fatal("binder: fork() failed: '%s'", strerror(errno)); } else if (pid == 0) { ! pid = ns_fork(); ! if (pid < 0) { ! Ns_Fatal("binder: fork() failed: '%s'", strerror(errno)); ! } else if (pid == 0) { ! close(binderRequest[1]); ! close(binderResponse[0]); ! Binder(); ! } ! exit(0); } if (Ns_WaitForProcess(pid, &status) != NS_OK) { ! Ns_Fatal("binder: Ns_WaitForProcess(%d) failed: '%s'", ! pid, strerror(errno)); } else if (status != 0) { ! Ns_Fatal("binder: process %d exited with non-zero status: %d", ! pid, status); } binderRunning = 1; --- 866,887 ---- pid = ns_fork(); if (pid < 0) { ! Ns_Fatal("binder: fork() failed: '%s'", strerror(errno)); } else if (pid == 0) { ! pid = ns_fork(); ! if (pid < 0) { ! Ns_Fatal("binder: fork() failed: '%s'", strerror(errno)); ! } else if (pid == 0) { ! close(binderRequest[1]); ! close(binderResponse[0]); ! Binder(); ! } ! exit(0); } if (Ns_WaitForProcess(pid, &status) != NS_OK) { ! Ns_Fatal("binder: Ns_WaitForProcess(%d) failed: '%s'", ! pid, strerror(errno)); } else if (status != 0) { ! Ns_Fatal("binder: process %d exited with non-zero status: %d", ! pid, status); } binderRunning = 1; *************** *** 886,898 **** * NsStopBinder -- * ! * Close the socket to the binder after startup. This is done ! * to avoid a possible security risk of binding to privileged ! * ports after startup. * * Results: ! * None. * * Side effects: ! * Binder process will exit. * *---------------------------------------------------------------------- --- 894,906 ---- * NsStopBinder -- * ! * Close the socket to the binder after startup. This is done ! * to avoid a possible security risk of binding to privileged ! * ports after startup. * * Results: ! * None. * * Side effects: ! * Binder process will exit. * *---------------------------------------------------------------------- *************** *** 903,914 **** { if (binderRunning) { ! close(binderRequest[1]); ! close(binderResponse[0]); ! close(binderRequest[0]); ! close(binderResponse[1]); ! binderRunning = 0; } } /* *---------------------------------------------------------------------- --- 911,923 ---- { if (binderRunning) { ! close(binderRequest[1]); ! close(binderResponse[0]); ! close(binderRequest[0]); ! close(binderResponse[1]); ! binderRunning = 0; } } + /* *---------------------------------------------------------------------- *************** *** 916,926 **** * Binder -- * ! * Slave process bind/listen loop. * * Results: ! * None. * * Side effects: ! * Sockets are created and sent to the parent on request. * *---------------------------------------------------------------------- --- 925,935 ---- * Binder -- * ! * Slave process bind/listen loop. * * Results: ! * None. * * Side effects: ! * Sockets are created and sent to the parent on request. * *---------------------------------------------------------------------- *************** *** 930,938 **** Binder(void) { ! int n, err, fd; ! char address[64]; struct msghdr msg; ! struct iovec iov[4]; ! int options, type, port; #ifdef HAVE_CMMSG CMsg cm; --- 939,947 ---- Binder(void) { ! int options, type, port, n, err, fd; ! char address[64]; struct msghdr msg; ! struct iovec iov[4]; ! #ifdef HAVE_CMMSG CMsg cm; *************** *** 952,956 **** iov[3].iov_base = (caddr_t) address; iov[3].iov_len = sizeof(address); ! memset(&msg, 0, sizeof(msg)); msg.msg_iov = iov; msg.msg_iovlen = 4; --- 961,965 ---- iov[3].iov_base = (caddr_t) address; iov[3].iov_len = sizeof(address); ! memset(&msg, 0, sizeof(msg)); msg.msg_iov = iov; msg.msg_iovlen = 4; *************** *** 961,1007 **** } while (n == -1 && errno == EINTR); if (n == 0) { ! break; ! } if (n != REQUEST_SIZE) { Ns_Fatal("binder: recvmsg() failed: '%s'", strerror(errno)); } ! /* ! * NB: Due to a bug in Solaris the slave process must ! * call both bind() and listen() before returning the ! * socket. All other Unix versions would actually allow ! * just performing the bind() in the slave and allowing ! * the parent to perform the listen(). ! */ switch (type) { ! case 'U': fd = Ns_SockListenUdp(address, port); break; ! case 'D': fd = Ns_SockListenUnix(address, options); break; ! case 'R': fd = Ns_SockListenRaw(options); break; ! case 'T': ! default: fd = Ns_SockListenEx(address, port, options); } ! if (fd < 0) err = errno; iov[0].iov_base = (caddr_t) &err; iov[0].iov_len = sizeof(err); ! memset(&msg, 0, sizeof(msg)); msg.msg_iov = iov; msg.msg_iovlen = 1; if (fd != -1) { #ifdef HAVE_CMMSG ! cm.len = sizeof(cm); ! cm.level = SOL_SOCKET; ! cm.type = SCM_RIGHTS; ! cm.fds[0] = fd; ! msg.msg_control = (void *) &cm; ! msg.msg_controllen = cm.len; ! msg.msg_flags = 0; #else msg.msg_accrights = (caddr_t) &fd; --- 970,1019 ---- } while (n == -1 && errno == EINTR); if (n == 0) { ! break; ! } if (n != REQUEST_SIZE) { Ns_Fatal("binder: recvmsg() failed: '%s'", strerror(errno)); } ! /* ! * NB: Due to a bug in Solaris the slave process must ! * call both bind() and listen() before returning the ! * socket. All other Unix versions would actually allow ! * just performing the bind() in the slave and allowing ! * the parent to perform the listen(). ! */ switch (type) { ! case 'U': fd = Ns_SockListenUdp(address, port); break; ! case 'D': fd = Ns_SockListenUnix(address, options); break; ! case 'R': fd = Ns_SockListenRaw(options); break; ! case 'T': ! default: fd = Ns_SockListenEx(address, port, options); } ! ! if (fd < 0) { ! err = errno; ! } iov[0].iov_base = (caddr_t) &err; iov[0].iov_len = sizeof(err); ! memset(&msg, 0, sizeof(msg)); msg.msg_iov = iov; msg.msg_iovlen = 1; if (fd != -1) { #ifdef HAVE_CMMSG ! cm.len = sizeof(cm); ! cm.level = SOL_SOCKET; ! cm.type = SCM_RIGHTS; ! cm.fds[0] = fd; ! msg.msg_control = (void *) &cm; ! msg.msg_controllen = cm.len; ! msg.msg_flags = 0; #else msg.msg_accrights = (caddr_t) &fd; *************** *** 1016,1023 **** } if (fd != -1) { ! ! /* ! * Close the socket as it won't be needed in the slave. ! */ close(fd); --- 1028,1035 ---- } if (fd != -1) { ! ! /* ! * Close the socket as it won't be needed in the slave. ! */ close(fd); |
From: Vlad S. <ser...@us...> - 2005-11-02 23:20:18
|
Update of /cvsroot/naviserver/naviserver/m4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12272 Added Files: cmmsg.m4 Log Message: --- NEW FILE: cmmsg.m4 --- # # The contents of this file are subject to the AOLserver Public License # Version 1.1 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://aolserver.com/. # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. # # The Original Code is AOLserver Code and related documentation # distributed by AOL. # # The Initial Developer of the Original Code is America Online, # Inc. Portions created by AOL are Copyright (C) 1999 America Online, # Inc. All Rights Reserved. # # Alternatively, the contents of this file may be used under the terms # of the GNU General Public License (the "GPL"), in which case the # provisions of GPL are applicable instead of those above. If you wish # to allow use of your version of this file only under the terms of the # GPL and not to allow others to use your version of this file under the # License, indicate your decision by deleting the provisions above and # replace them with the notice and other provisions required by the GPL. # If you do not delete the provisions above, a recipient may use your # version of this file under either the License or the GPL. # # # $Header: /cvsroot/naviserver/naviserver/m4/cmmsg.m4,v 1.1 2005/11/02 23:20:07 seryakov Exp $ # dnl dnl Check to see if msghdr structure can support BSD4.4 style message passing. dnl Defines HAVE_CMMSG. dnl AC_DEFUN([AC_HAVE_CMMSG], [ AC_CACHE_CHECK([for cmmsg], ac_cmmsg, [AC_TRY_COMPILE( [ #include <sys/types.h> #include <sys/socket.h> ], [ struct msghdr msg; msg.msg_control = 0; ], ac_cmmsg=yes, ac_cmmsg=no)]) if test $ac_cmmsg = yes; then AC_DEFINE_UNQUOTED(HAVE_CMMSG, 1, [Define if you have support for BSD4.4 style msg passing.]) fi ]) |
From: Vlad S. <ser...@us...> - 2005-11-02 23:07:29
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8198 Modified Files: configure.in Log Message: Minor fixes regarding new binder support Index: configure.in =================================================================== RCS file: /cvsroot/naviserver/naviserver/configure.in,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** configure.in 2 Nov 2005 21:18:20 -0000 1.17 --- configure.in 2 Nov 2005 23:07:15 -0000 1.18 *************** *** 79,83 **** TEA_ENABLE_SYMBOLS TEA_TIME_HANDLER - AC_HAVE_CMMSG # --- 79,82 ---- *************** *** 252,255 **** --- 251,255 ---- #include <netinet/in.h>]) + AC_HAVE_CMMSG # |
From: Vlad S. <ser...@us...> - 2005-11-02 23:07:29
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8198/nsd Modified Files: binder.c Log Message: Minor fixes regarding new binder support Index: binder.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/binder.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** binder.c 2 Nov 2005 21:18:20 -0000 1.14 --- binder.c 2 Nov 2005 23:07:15 -0000 1.15 *************** *** 72,78 **** static Tcl_HashTable preboundUnix; ! static int binderRunning; ! static int binderRequest[2]; ! static int binderResponse[2]; /* --- 72,78 ---- static Tcl_HashTable preboundUnix; ! static int binderRunning = 0; ! static int binderRequest[2] = { -1, -1 }; ! static int binderResponse[2] = { -1, -1 }; /* *************** *** 877,883 **** pid, status); } - Ns_MutexLock(&lock); binderRunning = 1; - Ns_MutexUnlock(&lock); } --- 877,881 ---- |
From: Vlad S. <ser...@us...> - 2005-11-02 21:18:30
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15489 Modified Files: ChangeLog configure.in Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.241 retrieving revision 1.242 diff -C2 -d -r1.241 -r1.242 *** ChangeLog 2 Nov 2005 20:20:22 -0000 1.241 --- ChangeLog 2 Nov 2005 21:18:20 -0000 1.242 *************** *** 2,6 **** * tests/ns_info.test: added 1 second delay to make ns_info ! uptime report uptie > 0 2005-10-28 Bernd Eidenschink <ei...@us...> --- 2,18 ---- * tests/ns_info.test: added 1 second delay to make ns_info ! uptime report uptime > 0 successfuly ! ! * configure.in: ! * m4/cmmsg.m4: ! * include/ns.h: ! * nsd/binder.c: ! * nsd/nsmain.c: Added support of binder as a separate process ! forked before switching off root priviliges and provided ! new API function Ns_SockListenBinder for creating ! sockets. In this mode, no need to specify all ports in the command line ! parameter -b. For now all modules have to call new API function in order ! to create sockets if they are not specified using -b command line ! paramater. 2005-10-28 Bernd Eidenschink <ei...@us...> Index: configure.in =================================================================== RCS file: /cvsroot/naviserver/naviserver/configure.in,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** configure.in 22 Oct 2005 09:32:52 -0000 1.16 --- configure.in 2 Nov 2005 21:18:20 -0000 1.17 *************** *** 79,83 **** TEA_ENABLE_SYMBOLS TEA_TIME_HANDLER ! # --- 79,83 ---- TEA_ENABLE_SYMBOLS TEA_TIME_HANDLER ! AC_HAVE_CMMSG # |
From: Vlad S. <ser...@us...> - 2005-11-02 21:18:30
|
Update of /cvsroot/naviserver/modules/nsdns In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15489/modules/nsdns Modified Files: nsdns.c Log Message: Index: nsdns.c =================================================================== RCS file: /cvsroot/naviserver/modules/nsdns/nsdns.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** nsdns.c 1 Aug 2005 20:38:15 -0000 1.17 --- nsdns.c 2 Nov 2005 21:18:20 -0000 1.18 *************** *** 151,160 **** if(dnsPort > 0) { // UDP socket ! if((dnsUdpSock = Ns_SockListenUdp(address,dnsPort)) == -1) { Ns_Log(Error,"nsdns: udp: %s:%d: couldn't create socket: %s",address,dnsPort,strerror(errno)); return NS_ERROR; } // TCP socket ! if((dnsTcpSock = Ns_SockListen(address,dnsPort)) == -1) { Ns_Log(Error,"nsdns: tcp: %s:%d: couldn't create socket: %s",address,dnsPort,strerror(errno)); return NS_ERROR; --- 151,162 ---- if(dnsPort > 0) { // UDP socket ! if((dnsUdpSock = Ns_SockListenUdp(address,dnsPort)) == -1 && ! (dnsUdpSock = Ns_SockBinderListen('U',address,dnsPort,0)) == -1) { Ns_Log(Error,"nsdns: udp: %s:%d: couldn't create socket: %s",address,dnsPort,strerror(errno)); return NS_ERROR; } // TCP socket ! if((dnsTcpSock = Ns_SockListen(address,dnsPort)) == -1 && ! (dnsTcpSock = Ns_SockBinderListen('T',address,dnsPort,32)) == -1) { Ns_Log(Error,"nsdns: tcp: %s:%d: couldn't create socket: %s",address,dnsPort,strerror(errno)); return NS_ERROR; |
From: Vlad S. <ser...@us...> - 2005-11-02 21:18:30
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15489/include Modified Files: ns.h Log Message: Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** ns.h 27 Oct 2005 10:34:27 -0000 1.56 --- ns.h 2 Nov 2005 21:18:20 -0000 1.57 *************** *** 1518,1521 **** --- 1518,1525 ---- NS_EXTERN SOCKET Ns_SockBindUnix(char *path); + NS_EXTERN void NsForkBinder(void); + NS_EXTERN void NsStopBinder(void); + NS_EXTERN SOCKET Ns_SockBinderListen(int type, char *address, int port, int options); + /* * sock.c: |