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: Stephen D. <sd...@us...> - 2005-07-30 04:27:49
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6696 Modified Files: ChangeLog Log Message: Fix use of ex-compat macro Ns_ConfigGet. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.176 retrieving revision 1.177 diff -C2 -d -r1.176 -r1.177 *** ChangeLog 30 Jul 2005 04:24:34 -0000 1.176 --- ChangeLog 30 Jul 2005 04:27:41 -0000 1.177 *************** *** 1,4 **** --- 1,6 ---- 2005-07-29 Stephen Deasey <sd...@us...> + * nslog/nslog.c: Fix use of ex-compat macro Ns_ConfigGet. + * include/nsthread.h: * nsthread/memory.c: Ensure callers of ns_realloc check the |
From: Stephen D. <sd...@us...> - 2005-07-30 04:24:44
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6355/include Modified Files: nsthread.h Log Message: * include/nsthread.h: * nsthread/memory.c: Ensure callers of ns_realloc check the rerturn value. Use ckalloc etc. macros consistently for debugging. Index: nsthread.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/nsthread.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** nsthread.h 30 Jul 2005 04:06:01 -0000 1.8 --- nsthread.h 30 Jul 2005 04:24:34 -0000 1.9 *************** *** 201,205 **** NS_EXTERN void *ns_calloc(size_t num, size_t size) NS_GNUC_MALLOC; NS_EXTERN void ns_free(void *buf); ! NS_EXTERN void *ns_realloc(void *buf, size_t size); NS_EXTERN char *ns_strdup(const char *string) NS_GNUC_MALLOC; NS_EXTERN char *ns_strcopy(const char *string) NS_GNUC_MALLOC; --- 201,205 ---- NS_EXTERN void *ns_calloc(size_t num, size_t size) NS_GNUC_MALLOC; NS_EXTERN void ns_free(void *buf); ! NS_EXTERN void *ns_realloc(void *buf, size_t size) NS_GNUC_WARN_UNUSED_RESULT; NS_EXTERN char *ns_strdup(const char *string) NS_GNUC_MALLOC; NS_EXTERN char *ns_strcopy(const char *string) NS_GNUC_MALLOC; |
From: Stephen D. <sd...@us...> - 2005-07-30 04:24:43
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6355 Modified Files: ChangeLog Log Message: * include/nsthread.h: * nsthread/memory.c: Ensure callers of ns_realloc check the rerturn value. Use ckalloc etc. macros consistently for debugging. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.175 retrieving revision 1.176 diff -C2 -d -r1.175 -r1.176 *** ChangeLog 30 Jul 2005 04:06:01 -0000 1.175 --- ChangeLog 30 Jul 2005 04:24:34 -0000 1.176 *************** *** 1,4 **** --- 1,9 ---- 2005-07-29 Stephen Deasey <sd...@us...> + * include/nsthread.h: + * nsthread/memory.c: Ensure callers of ns_realloc check the + rerturn value. Use ckalloc etc. macros consistently for + debugging. + * include/ns.h: * include/nsthread.h: |
From: Stephen D. <sd...@us...> - 2005-07-30 04:24:43
|
Update of /cvsroot/naviserver/naviserver/nsthread In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6355/nsthread Modified Files: memory.c Log Message: * include/nsthread.h: * nsthread/memory.c: Ensure callers of ns_realloc check the rerturn value. Use ckalloc etc. macros consistently for debugging. Index: memory.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsthread/memory.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** memory.c 10 Jun 2005 17:58:59 -0000 1.2 --- memory.c 30 Jul 2005 04:24:34 -0000 1.3 *************** *** 59,63 **** ns_realloc(void *ptr, size_t size) { ! return (ptr ? Tcl_Realloc(ptr, size) : Tcl_Alloc(size)); } --- 59,63 ---- ns_realloc(void *ptr, size_t size) { ! return (ptr ? ckrealloc(ptr, size) : ckalloc(size)); } *************** *** 65,69 **** ns_malloc(size_t size) { ! return Tcl_Alloc(size); } --- 65,69 ---- ns_malloc(size_t size) { ! return ckalloc(size); } *************** *** 72,76 **** { if (ptr != NULL) { ! Tcl_Free(ptr); } } --- 72,76 ---- { if (ptr != NULL) { ! ckfree(ptr); } } |
From: Stephen D. <sd...@us...> - 2005-07-30 04:06:21
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3800/nsd Modified Files: tclfile.c tclthread.c Log Message: * include/ns.h: * include/nsthread.h: * nsd/tclthread.c: * nsd/tclfile.c: * nsthread/Makefile: * nsthread/compat: * nscgi/nscgi.c: Remove a bunch of truly ancient compatibility macros and functions. Index: tclfile.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclfile.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tclfile.c 12 Jun 2005 14:42:44 -0000 1.4 --- tclfile.c 30 Jul 2005 04:06:02 -0000 1.5 *************** *** 1068,1073 **** hPtr = Tcl_CreateHashEntry(&servPtr->chans.table, name, &new); if (new) { ! regChan = Ns_Malloc(sizeof(NsRegChan)); ! regChan->name = Ns_Malloc(strlen(chanName)+1); regChan->chan = chan; strcpy(regChan->name, chanName); --- 1068,1073 ---- hPtr = Tcl_CreateHashEntry(&servPtr->chans.table, name, &new); if (new) { ! regChan = ns_malloc(sizeof(NsRegChan)); ! regChan->name = ns_malloc(strlen(chanName)+1); regChan->chan = chan; strcpy(regChan->name, chanName); *************** *** 1180,1185 **** Tcl_UnregisterChannel(interp, regChan->chan); } ! Ns_Free(regChan->name); ! Ns_Free(regChan); Tcl_DeleteHashEntry(hPtr); hPtr = Tcl_NextHashEntry(&search); --- 1180,1185 ---- Tcl_UnregisterChannel(interp, regChan->chan); } ! ns_free(regChan->name); ! ns_free(regChan); Tcl_DeleteHashEntry(hPtr); hPtr = Tcl_NextHashEntry(&search); Index: tclthread.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclthread.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tclthread.c 12 Jul 2005 07:31:39 -0000 1.4 --- tclthread.c 30 Jul 2005 04:06:02 -0000 1.5 *************** *** 35,41 **** */ - #ifdef NS_NOCOMPAT - #undef NS_NOCOMPAT - #endif #include "nsd.h" --- 35,38 ---- *************** *** 303,311 **** static CONST char *opts[] = { "abswait", "broadcast", "create", "destroy", "set", ! "signal", "timedwait", "wait", NULL }; enum { EAbsWaitIdx, EBroadcastIdx, ECreateIdx, EDestroyIdx, ESetIdx, ! ESignalIdx, ETimedWaitIdx, EWaitIdx }; --- 300,308 ---- static CONST char *opts[] = { "abswait", "broadcast", "create", "destroy", "set", ! "signal", "wait", NULL }; enum { EAbsWaitIdx, EBroadcastIdx, ECreateIdx, EDestroyIdx, ESetIdx, ! ESignalIdx, EWaitIdx }; *************** *** 320,324 **** break; case EAbsWaitIdx: - case ETimedWaitIdx: case EWaitIdx: if (objc < 4) { --- 317,320 ---- *************** *** 337,343 **** if (opt == EAbsWaitIdx) { result = Ns_CondTimedWait(condPtr, lock, &timeout); - } else if (opt == ETimedWaitIdx) { - Ns_Event *eventPtr = (Ns_Event *) condPtr; - result = Ns_TimedWaitForEvent(eventPtr, lock, timeout.sec); } else { if (objc < 5 || (timeout.sec == 0 && timeout.usec == 0)) { --- 333,336 ---- |
From: Stephen D. <sd...@us...> - 2005-07-30 04:06:21
|
Update of /cvsroot/naviserver/naviserver/nscgi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3800/nscgi Modified Files: nscgi.c Log Message: * include/ns.h: * include/nsthread.h: * nsd/tclthread.c: * nsd/tclfile.c: * nsthread/Makefile: * nsthread/compat: * nscgi/nscgi.c: Remove a bunch of truly ancient compatibility macros and functions. Index: nscgi.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nscgi/nscgi.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nscgi.c 13 Jun 2005 01:58:16 -0000 1.3 --- nscgi.c 30 Jul 2005 04:06:01 -0000 1.4 *************** *** 292,299 **** if (modPtr->maxInput > 0 && conn->contentLength > modPtr->maxInput) { ! return Ns_ReturnBadRequest(conn, "Exceeded maximum CGI input size"); } if (CgiInit(&cgi, mapPtr, conn) != NS_OK) { ! return Ns_ReturnNotFound(conn); } else if (cgi.interp == NULL && access(cgi.exec, X_OK) != 0) { if (STREQ(conn->request->method, "GET") || --- 292,299 ---- if (modPtr->maxInput > 0 && conn->contentLength > modPtr->maxInput) { ! return Ns_ConnReturnBadRequest(conn, "Exceeded maximum CGI input size"); } if (CgiInit(&cgi, mapPtr, conn) != NS_OK) { ! return Ns_ConnReturnNotFound(conn); } else if (cgi.interp == NULL && access(cgi.exec, X_OK) != 0) { if (STREQ(conn->request->method, "GET") || *************** *** 308,312 **** status = Ns_ConnReturnFile(conn, 200, NULL, cgi.exec); } else { ! status = Ns_ReturnNotFound(conn); } goto done; --- 308,312 ---- status = Ns_ConnReturnFile(conn, 200, NULL, cgi.exec); } else { ! status = Ns_ConnReturnNotFound(conn); } goto done; *************** *** 793,797 **** } SetUpdate(cgiPtr->env, "GATEWAY_INTERFACE", "CGI/1.1"); ! Ns_DStringVarAppend(dsPtr, Ns_InfoServer(), "/", Ns_InfoVersion(), NULL); SetUpdate(cgiPtr->env, "SERVER_SOFTWARE", dsPtr->string); Ns_DStringTrunc(dsPtr, 0); --- 793,797 ---- } SetUpdate(cgiPtr->env, "GATEWAY_INTERFACE", "CGI/1.1"); ! Ns_DStringVarAppend(dsPtr, Ns_InfoServerName(), "/", Ns_InfoServerVersion(), NULL); SetUpdate(cgiPtr->env, "SERVER_SOFTWARE", dsPtr->string); Ns_DStringTrunc(dsPtr, 0); |
From: Stephen D. <sd...@us...> - 2005-07-30 04:06:21
|
Update of /cvsroot/naviserver/naviserver/nsthread In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3800/nsthread Modified Files: Makefile Removed Files: compat.c Log Message: * include/ns.h: * include/nsthread.h: * nsd/tclthread.c: * nsd/tclfile.c: * nsthread/Makefile: * nsthread/compat: * nscgi/nscgi.c: Remove a bunch of truly ancient compatibility macros and functions. Index: Makefile =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsthread/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 16 Feb 2005 08:41:10 -0000 1.1.1.1 --- Makefile 30 Jul 2005 04:06:02 -0000 1.2 *************** *** 39,43 **** error.o master.o memory.o mutex.o cslock.o \ rwlock.o reentrant.o sema.o thread.o tls.o signal.o \ ! compat.o time.o fork.o pthread.o include ../include/Makefile.build --- 39,43 ---- error.o master.o memory.o mutex.o cslock.o \ rwlock.o reentrant.o sema.o thread.o tls.o signal.o \ ! time.o fork.o pthread.o include ../include/Makefile.build --- compat.c DELETED --- |
From: Stephen D. <sd...@us...> - 2005-07-30 04:06:15
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3800/include Modified Files: ns.h nsthread.h Log Message: * include/ns.h: * include/nsthread.h: * nsd/tclthread.c: * nsd/tclfile.c: * nsthread/Makefile: * nsthread/compat: * nscgi/nscgi.c: Remove a bunch of truly ancient compatibility macros and functions. Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ns.h 30 Jul 2005 03:17:50 -0000 1.39 --- ns.h 30 Jul 2005 04:06:01 -0000 1.40 *************** *** 1480,1527 **** */ ! #ifndef NS_NOCOMPAT ! #define DllExport NS_EXPORT ! #define Ns_Select select ! #define Ns_InfoHome() Ns_InfoHomePath() ! #define Ns_InfoServer() Ns_InfoServerName() ! #define Ns_InfoVersion() Ns_InfoServerVersion() ! #define Ns_RequestAuthorize(s,m,u,au,ap,p) Ns_AuthorizeRequest(s,m,u,au,ap,p) ! #define Ns_RequestFree(r) Ns_FreeRequest(r) ! #define Ns_ResetReturn(c) Ns_ConnResetReturn(c) ! #define Ns_PutsConn(c,s) Ns_ConnPuts(c,s) ! #define Ns_ExpiresHeader(c,h) Ns_ConnSetExpiresHeader(c,h) ! #define Ns_ReturnHtml(c,s,h,l) Ns_ConnReturnHtml(c,s,h,l) ! #define Ns_ReturnOk(c) Ns_ConnReturnOk(c) ! #define Ns_ReturnNoResponse(c) Ns_ConnReturnNoResponse(c) ! #define Ns_ReturnRedirect(c,l) Ns_ConnReturnRedirect(c,l) ! #define Ns_ReturnNotModified(c) Ns_ConnReturnNotModified(c) ! #define Ns_ReturnBadRequest(c,r) Ns_ConnReturnBadRequest(c,r) ! #define Ns_ReturnUnauthorized(c) Ns_ConnReturnUnauthorized(c) ! #define Ns_ReturnForbidden(c) Ns_ConnReturnForbidden(c) ! #define Ns_ReturnNotFound(c) Ns_ConnReturnNotFound(c) ! #define Ns_ReturnInternalError(c) Ns_ConnReturnInternalError(c) ! #define Ns_ReturnNotImplemented(c) Ns_ConnReturnNotImplemented(c) ! #define Ns_ReturnStatus(c,s) Ns_ConnReturnStatus(c,s) ! #define Ns_TypeHeader(c,t) Ns_ConnSetTypeHeader(c,t) ! #define Ns_LengthHeader(c,l) Ns_ConnSetLengthHeader(c,l) ! #define Ns_LastModifiedHeader(c,w) Ns_ConnSetLastModifiedHeader(c,w) ! #define Ns_ReturnFile(c,s,t,f) Ns_ConnReturnFile(c,s,t,f) ! #define Ns_ReturnOpenFile(c,s,t,f,l) Ns_ConnReturnOpenFile(c,s,t,f,l) ! #define Ns_ReturnNotice(c,s,t,m) Ns_ConnReturnNotice(c,s,t,m) ! #define Ns_ReturnAdminNotice(c,s,t,m) Ns_ConnReturnAdminNotice(c,s,t,m) ! #define Ns_HeadersFlush(c,s) Ns_ConnFlushHeaders(c,s) ! #define Ns_HeadersPut(Nc,f,v) Ns_ConnSetHeaders(Nc,f,v) ! #define Ns_HeadersCondPut(c,f,v) Ns_ConnCondSetHeaders(c,f,v) ! #define Ns_HeadersReplace(c,n) Ns_ConnReplaceHeaders(c,n) ! #define Ns_HeadersRequired(c,t,l) Ns_ConnSetRequiredHeaders(c,t,l) ! #define Ns_ConfigPath Ns_ConfigGetPath ! #define Ns_ConfigSection(s) Ns_ConfigGetSection(s) ! #define Ns_ConfigSections() Ns_ConfigGetSections() ! #define Ns_ConfigGet(s,k) Ns_ConfigGetValue(s,k) ! #define Ns_ConfigGetExact(s,k) Ns_ConfigGetValueExact(s,k) ! #define Ns_UrlEncode(p,u) Ns_EncodeUrlCharset(p,u,NULL) ! #define Ns_UrlDecode(p,u) Ns_DecodeUrlCharset(p,u,NULL) ! #define Ns_EncodeUrl(p,u) Ns_EncodeUrlCharset(p,u,NULL) ! #define Ns_DecodeUrl(p,u) Ns_DecodeUrlCharset(p,u,NULL) #endif --- 1480,1485 ---- */ ! #ifdef NS_NOCOMPAT ! # error "No compatibility macros at present" #endif Index: nsthread.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/nsthread.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nsthread.h 10 Jun 2005 21:52:36 -0000 1.7 --- nsthread.h 30 Jul 2005 04:06:01 -0000 1.8 *************** *** 316,418 **** - #ifndef NS_NOCOMPAT - - /* - * Unsupported legacy API's and macros. - */ - - /* - * compat.c: - */ - - typedef struct Ns_Semaphore_ *Ns_Semaphore; - typedef struct Ns_CriticalSection_ *Ns_CriticalSection; - typedef struct Ns_ThreadLocalStorage_ *Ns_ThreadLocalStorage; - typedef struct Ns_Event_ *Ns_Event; - - NS_EXTERN int Ns_InitializeMutex(Ns_Mutex *mutexPtr); - NS_EXTERN int Ns_DestroyMutex(Ns_Mutex *mutexPtr); - NS_EXTERN int Ns_LockMutex(Ns_Mutex *mutexPtr); - NS_EXTERN int Ns_UnlockMutex(Ns_Mutex *mutexPtr); - NS_EXTERN int Ns_InitializeCriticalSection(Ns_CriticalSection *cs); - NS_EXTERN int Ns_DestroyCriticalSection(Ns_CriticalSection *cs); - NS_EXTERN int Ns_EnterCriticalSection(Ns_CriticalSection *cs); - NS_EXTERN int Ns_LeaveCriticalSection(Ns_CriticalSection *cs); - NS_EXTERN int Ns_InitializeEvent(Ns_Event *event); - NS_EXTERN int Ns_DestroyEvent(Ns_Event *event); - NS_EXTERN int Ns_SetEvent(Ns_Event *event); - NS_EXTERN int Ns_BroadcastEvent(Ns_Event *event); - NS_EXTERN int Ns_WaitForEvent(Ns_Event *event, Ns_Mutex *lock); - NS_EXTERN int Ns_TimedWaitForEvent(Ns_Event *event, Ns_Mutex *lock, int timeout); - NS_EXTERN int Ns_AbsTimedWaitForEvent(Ns_Event *event, Ns_Mutex *lock, - time_t abstime); - NS_EXTERN int Ns_UTimedWaitForEvent(Ns_Event *event, Ns_Mutex *lock, int seconds, - int microseconds); - NS_EXTERN int Ns_InitializeRWLock(Ns_RWLock *lock); - NS_EXTERN int Ns_DestroyRWLock(Ns_RWLock *lock); - NS_EXTERN int Ns_ReadLockRWLock(Ns_RWLock *lock); - NS_EXTERN int Ns_ReadUnlockRWLock(Ns_RWLock *lock); - NS_EXTERN int Ns_WriteLockRWLock(Ns_RWLock *lock); - NS_EXTERN int Ns_WriteUnlockRWLock(Ns_RWLock *lock); - NS_EXTERN int Ns_InitializeSemaphore(Ns_Semaphore *sema, int initCount); - NS_EXTERN int Ns_DestroySemaphore(Ns_Semaphore *sema); - NS_EXTERN int Ns_WaitForSemaphore(Ns_Semaphore *sema); - NS_EXTERN int Ns_ReleaseSemaphore(Ns_Semaphore *sema, int count); - NS_EXTERN int Ns_AllocThreadLocalStorage(Ns_ThreadLocalStorage *tls, - Ns_TlsCleanup *cleanup); - NS_EXTERN int Ns_SetThreadLocalStorage(Ns_ThreadLocalStorage *tls, void *p); - NS_EXTERN int Ns_GetThreadLocalStorage(Ns_ThreadLocalStorage *tls, void **p); - NS_EXTERN int Ns_WaitForThread(Ns_Thread *threadPtr); - NS_EXTERN int Ns_WaitThread(Ns_Thread *threadPtr, int *exitCodePtr); - NS_EXTERN void Ns_ExitThread(int exitCode); - NS_EXTERN int Ns_BeginDetachedThread(Ns_ThreadProc *proc, void *arg); - NS_EXTERN int Ns_BeginThread(Ns_ThreadProc *proc, void *arg, Ns_Thread *thrPtr); - NS_EXTERN int Ns_GetThreadId(void); - NS_EXTERN void Ns_GetThread(Ns_Thread *threadPtr); - - /* - * pool.c: - */ - - typedef struct Ns_Pool_ *Ns_Pool; - - NS_EXTERN int nsMemNumBuckets; - NS_EXTERN Ns_Pool *Ns_PoolCreate(char *name); - NS_EXTERN void Ns_PoolFlush(Ns_Pool *pool); - NS_EXTERN void Ns_PoolDestroy(Ns_Pool *pool); - NS_EXTERN void *Ns_PoolAlloc(Ns_Pool *pool, size_t size); - NS_EXTERN void Ns_PoolFree(Ns_Pool *pool, void *cp); - NS_EXTERN void *Ns_PoolRealloc(Ns_Pool *pool, void *ptr, size_t size); - NS_EXTERN void *Ns_PoolCalloc(Ns_Pool *pool, size_t elsize, size_t nelem); - NS_EXTERN char *Ns_PoolStrDup(Ns_Pool *pool, char *old); - NS_EXTERN char *Ns_PoolStrCopy(Ns_Pool *pool, char *old); - NS_EXTERN void *Ns_ThreadMalloc(size_t size); - NS_EXTERN void *Ns_ThreadAlloc(size_t size); - NS_EXTERN void *Ns_ThreadRealloc(void *ptr, size_t size); - NS_EXTERN void Ns_ThreadFree(void *ptr); - NS_EXTERN void *Ns_ThreadCalloc(size_t nelem, size_t elsize); - NS_EXTERN char *Ns_ThreadStrDup(char *old); - NS_EXTERN char *Ns_ThreadStrCopy(char *old); - - #define Ns_Readdir ns_readdir - #define Ns_Localtime ns_localtime - #define Ns_Gmtime ns_gmtime - #define Ns_Ctime ns_ctime - #define Ns_Asctime ns_asctime - #define Ns_Strtok ns_strtok - #define Ns_InetNtoa ns_inet_ntoa - #define Ns_Signal ns_signal - #define Ns_Sigmask ns_sigmask - #define Ns_Sigwait ns_sigwait - #define Ns_Malloc ns_malloc - #define Ns_Realloc ns_realloc - #define Ns_Free ns_free - #define Ns_Calloc ns_calloc - #define Ns_StrDup ns_strdup - #define Ns_StrCopy ns_strcopy - #define Ns_ThreadAlloc Ns_ThreadMalloc - #define Ns_Fork ns_fork - - #endif /* NS_NOCOMPAT */ - #endif /* NSTHREAD_H */ --- 316,318 ---- |
From: Stephen D. <sd...@us...> - 2005-07-30 04:06:14
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3800 Modified Files: ChangeLog Log Message: * include/ns.h: * include/nsthread.h: * nsd/tclthread.c: * nsd/tclfile.c: * nsthread/Makefile: * nsthread/compat: * nscgi/nscgi.c: Remove a bunch of truly ancient compatibility macros and functions. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.174 retrieving revision 1.175 diff -C2 -d -r1.174 -r1.175 *** ChangeLog 30 Jul 2005 03:35:01 -0000 1.174 --- ChangeLog 30 Jul 2005 04:06:01 -0000 1.175 *************** *** 1,4 **** --- 1,12 ---- 2005-07-29 Stephen Deasey <sd...@us...> + * include/ns.h: + * include/nsthread.h: + * nsd/tclthread.c: + * nsd/tclfile.c: + * nsthread/Makefile: + * nsthread/compat: + * nscgi/nscgi.c: Remove a bunch of truly ancient compatibility + macros and functions. * nsd/tclinit.c: |
From: Stephen D. <sd...@us...> - 2005-07-30 03:35:23
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32374 Modified Files: ChangeLog Log Message: * nsd/tclinit.c: * nsd/tclcmds.c: * nsd/init.tcl: Remove ns_markfordelete command and roll into ns_ictl as ns_ictl markfordelete. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.173 retrieving revision 1.174 diff -C2 -d -r1.173 -r1.174 *** ChangeLog 30 Jul 2005 03:17:50 -0000 1.173 --- ChangeLog 30 Jul 2005 03:35:01 -0000 1.174 *************** *** 1,4 **** --- 1,10 ---- 2005-07-29 Stephen Deasey <sd...@us...> + + * nsd/tclinit.c: + * nsd/tclcmds.c: + * nsd/init.tcl: Remove ns_markfordelete command and roll into + ns_ictl as ns_ictl markfordelete. + * nsd/nsd.h: * nsd/nsmain.c: |
From: Stephen D. <sd...@us...> - 2005-07-30 03:35:20
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32374/nsd Modified Files: init.tcl tclcmds.c tclinit.c Log Message: * nsd/tclinit.c: * nsd/tclcmds.c: * nsd/init.tcl: Remove ns_markfordelete command and roll into ns_ictl as ns_ictl markfordelete. Index: tclcmds.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclcmds.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tclcmds.c 12 Jul 2005 07:31:39 -0000 1.18 --- tclcmds.c 30 Jul 2005 03:35:10 -0000 1.19 *************** *** 106,110 **** NsTclLogObjCmd, NsTclLogRollObjCmd, - NsTclMarkForDeleteObjCmd, NsTclMkdirObjCmd, NsTclModulePathObjCmd, --- 106,109 ---- *************** *** 289,293 **** {"ns_logctl", NULL, NsTclLogCtlObjCmd}, {"ns_logroll", NULL, NsTclLogRollObjCmd}, - {"ns_markfordelete", NULL, NsTclMarkForDeleteObjCmd}, {"ns_mkdir", NULL, NsTclMkdirObjCmd}, {"ns_mktemp", NsTclMkTempCmd, NULL}, --- 288,291 ---- Index: tclinit.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclinit.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tclinit.c 30 Jul 2005 03:17:50 -0000 1.11 --- tclinit.c 30 Jul 2005 03:35:11 -0000 1.12 *************** *** 754,765 **** static CONST char *opts[] = { ! "addmodule", "cleanup", "epoch", "get", "getmodules", "save", ! "update", "oncreate", "oncleanup", "oninit", "ondelete", "trace", NULL }; enum { IAddModuleIdx, ICleanupIdx, IEpochIdx, IGetIdx, IGetModulesIdx, ! ISaveIdx, IUpdateIdx, IOnCreateIdx, IOnCleanupIdx, IOnInitIdx, ! IOnDeleteIdx, ITraceIdx }; Ns_ObjvTable traceWhen[] = { --- 754,765 ---- static CONST char *opts[] = { ! "addmodule", "cleanup", "epoch", "get", "getmodules", "markfordelete", ! "save", "update", "oncreate", "oncleanup", "oninit", "ondelete", "trace", NULL }; enum { IAddModuleIdx, ICleanupIdx, IEpochIdx, IGetIdx, IGetModulesIdx, ! IMarkForDeleteIdx, ISaveIdx, IUpdateIdx, IOnCreateIdx, IOnCleanupIdx, ! IOnInitIdx, IOnDeleteIdx, ITraceIdx }; Ns_ObjvTable traceWhen[] = { *************** *** 851,854 **** --- 851,862 ---- break; + case IMarkForDeleteIdx: + /* + * The interp will be deleted on next deallocation. + */ + + itPtr->delete = 1; + break; + case ISaveIdx: /* *************** *** 960,994 **** *---------------------------------------------------------------------- * - * NsTclMarkForDeleteObjCmd -- - * - * Implements ns_markfordelete. - * - * Results: - * Tcl result. - * - * Side effects: - * See Ns_TclMarkForDelete. - * - *---------------------------------------------------------------------- - */ - - int - NsTclMarkForDeleteObjCmd(ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj **objv) - { - NsInterp *itPtr = arg; - - if (objc != 1) { - Tcl_WrongNumArgs(interp, 1, objv, ""); - return TCL_ERROR; - } - itPtr->delete = 1; - - return TCL_OK; - } - - - /* - *---------------------------------------------------------------------- - * * NsTclDummyObjCmd -- * --- 968,971 ---- Index: init.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/init.tcl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** init.tcl 14 May 2005 05:39:29 -0000 1.2 --- init.tcl 30 Jul 2005 03:35:10 -0000 1.3 *************** *** 148,152 **** } elseif {$code == 1} { ! ns_markfordelete } return -code $code $result --- 148,152 ---- } elseif {$code == 1} { ! ns_ictl markfordelete } return -code $code $result *************** *** 665,669 **** # ! ns_markfordelete # EOF $RCSfile$ --- 665,669 ---- # ! ns_ictl markfordelete # EOF $RCSfile$ |
From: Stephen D. <sd...@us...> - 2005-07-30 03:17:59
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29888/nsd Modified Files: nsd.h server.c tclinit.c tclmisc.c Log Message: * include/ns.h: * nsd/nsd.h: * nsd/server.c: * nsd/tclinit.c: * nsd/tclmisc.c: Add Ns_TclLogErrorInfo and allow admin to configure which conenction headers to log for Tcl errors. (RFE #1241432) Index: nsd.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsd.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** nsd.h 30 Jul 2005 03:11:06 -0000 1.27 --- nsd.h 30 Jul 2005 03:17:50 -0000 1.28 *************** *** 653,656 **** --- 653,657 ---- int epoch; Tcl_Obj *modules; + CONST char **errorLogHeaders; } tcl; Index: tclmisc.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclmisc.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tclmisc.c 12 Jul 2005 08:26:04 -0000 1.11 --- tclmisc.c 30 Jul 2005 03:17:50 -0000 1.12 *************** *** 79,82 **** --- 79,185 ---- *---------------------------------------------------------------------- * + * Ns_TclLogErrorInfo -- + * + * Log the global errorInfo variable to the server log along with + * some connection info, if available. + * + * Results: + * Returns a read-only pointer to the complete errorInfo. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + CONST char * + Ns_TclLogErrorInfo(Tcl_Interp *interp, CONST char *extraInfo) + { + NsInterp *itPtr = NsGetInterpData(interp); + Ns_Conn *conn; + CONST char *errorInfo, **logHeaders, **hdr; + char *value; + Ns_DString ds; + + if (extraInfo != NULL) { + Tcl_AddObjErrorInfo(interp, extraInfo, -1); + } + errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); + if (errorInfo == NULL) { + errorInfo = ""; + } + if (itPtr != NULL && itPtr->conn != NULL) { + conn = itPtr->conn; + Ns_DStringInit(&ds); + Ns_DStringVarAppend(&ds, conn->request->method, " ", conn->request->url, + ", PeerAddress: ", Ns_ConnPeer(conn), NULL); + + logHeaders = itPtr->servPtr->tcl.errorLogHeaders; + if (logHeaders != NULL) { + for (hdr = logHeaders; *hdr != NULL; hdr++) { + if ((value = Ns_SetIGet(conn->headers, *hdr)) != NULL) { + Ns_DStringVarAppend(&ds, ", ", *hdr, ": ", value, NULL); + } + } + } + Ns_Log(Error, "%s\n%s", Ns_DStringValue(&ds), errorInfo); + Ns_DStringFree(&ds); + } else { + Ns_Log(Error, "%s\n%s", Tcl_GetStringResult(interp), errorInfo); + } + + return errorInfo; + } + + + /* + *---------------------------------------------------------------------- + * + * Ns_TclLogError -- + * + * Log the global errorInfo variable to the server log. + * + * Results: + * Returns a read-only pointer to the errorInfo. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + CONST char * + Ns_TclLogError(Tcl_Interp *interp) + { + return Ns_TclLogErrorInfo(interp, NULL); + } + + + /* + *---------------------------------------------------------------------- + * + * Ns_TclLogErrorRequest -- + * + * Deprecated. See: Ns_TclLoggErrorInfo. + * + * Results: + * Returns a pointer to the read-only errorInfo. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + CONST char * + Ns_TclLogErrorRequest(Tcl_Interp *interp, Ns_Conn *conn) + { + return Ns_TclLogErrorInfo(interp, NULL); + } + + + /* + *---------------------------------------------------------------------- + * * NsTclStripHtmlCmd -- * Index: tclinit.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclinit.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tclinit.c 30 Jul 2005 03:11:07 -0000 1.10 --- tclinit.c 30 Jul 2005 03:17:50 -0000 1.11 *************** *** 690,764 **** *---------------------------------------------------------------------- * - * Ns_TclLogError -- - * - * Log the global errorInfo variable to the server log. - * - * Results: - * Returns a pointer to the errorInfo. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - - char * - Ns_TclLogError(Tcl_Interp *interp) - { - CONST char *errorInfo; - - errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); - if (errorInfo == NULL) { - errorInfo = ""; - } - Ns_Log(Error, "%s\n%s", Tcl_GetStringResult(interp), errorInfo); - - return (char *) errorInfo; - } - - - /* - *---------------------------------------------------------------------- - * - * Ns_TclLogErrorRequest -- - * - * Log both errorInfo and info about the HTTP request that led - * to it. - * - * Results: - * Returns a pointer to the errorInfo. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - - char * - Ns_TclLogErrorRequest(Tcl_Interp *interp, Ns_Conn *conn) - { - char *agent; - CONST char *errorInfo; - - errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); - if (errorInfo == NULL) { - errorInfo = Tcl_GetStringResult(interp); - } - agent = Ns_SetIGet(conn->headers, "user-agent"); - if (agent == NULL) { - agent = "?"; - } - Ns_Log(Error, "error for %s %s, " - "User-Agent: %s, PeerAddress: %s\n%s", - conn->request->method, conn->request->url, - agent, Ns_ConnPeer(conn), errorInfo); - - return (char*) errorInfo; - } - - - /* - *---------------------------------------------------------------------- - * * Ns_TclInitModule -- * --- 690,693 ---- Index: server.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/server.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** server.c 12 Jul 2005 11:19:22 -0000 1.10 --- server.c 30 Jul 2005 03:17:50 -0000 1.11 *************** *** 320,323 **** --- 320,333 ---- /* + * Initialize the list of connection headers to log for Tcl errors. + */ + + p = Ns_ConfigGetValue(path, "errorlogheaders"); + if (p != NULL && Tcl_SplitList(NULL, p, &n, &servPtr->tcl.errorLogHeaders) + != TCL_OK) { + Ns_Log(Error, "invalid error log headers: %s", p); + } + + /* * Initialize the Tcl detached channel support. */ |
From: Stephen D. <sd...@us...> - 2005-07-30 03:17:58
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29888/include Modified Files: ns.h Log Message: * include/ns.h: * nsd/nsd.h: * nsd/server.c: * nsd/tclinit.c: * nsd/tclmisc.c: Add Ns_TclLogErrorInfo and allow admin to configure which conenction headers to log for Tcl errors. (RFE #1241432) Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** ns.h 22 Jul 2005 06:46:40 -0000 1.38 --- ns.h 30 Jul 2005 03:17:50 -0000 1.39 *************** *** 1319,1330 **** NS_GNUC_NONNULL(1); - NS_EXTERN char * - Ns_TclLogError(Tcl_Interp *interp) - NS_GNUC_NONNULL(1); - - NS_EXTERN char * - Ns_TclLogErrorRequest(Tcl_Interp *interp, Ns_Conn *conn) - NS_GNUC_NONNULL(1) NS_GNUC_NONNULL(2); - NS_EXTERN int Ns_TclInitModule(CONST char *server, CONST char *module) --- 1319,1322 ---- *************** *** 1362,1365 **** --- 1354,1369 ---- NS_GNUC_PRINTF(2, 3); + NS_EXTERN CONST char * + Ns_TclLogErrorInfo(Tcl_Interp *interp, CONST char *info) + NS_GNUC_NONNULL(1); + + NS_EXTERN CONST char * + Ns_TclLogError(Tcl_Interp *interp) + NS_GNUC_NONNULL(1); + + NS_EXTERN CONST char * + Ns_TclLogErrorRequest(Tcl_Interp *interp, Ns_Conn *conn) + NS_GNUC_NONNULL(1) NS_GNUC_DEPRECATED; + /* * tclrequest.c: |
From: Stephen D. <sd...@us...> - 2005-07-30 03:17:58
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29888 Modified Files: ChangeLog Log Message: * include/ns.h: * nsd/nsd.h: * nsd/server.c: * nsd/tclinit.c: * nsd/tclmisc.c: Add Ns_TclLogErrorInfo and allow admin to configure which conenction headers to log for Tcl errors. (RFE #1241432) Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.172 retrieving revision 1.173 diff -C2 -d -r1.172 -r1.173 *** ChangeLog 30 Jul 2005 03:10:57 -0000 1.172 --- ChangeLog 30 Jul 2005 03:17:50 -0000 1.173 *************** *** 6,9 **** --- 6,17 ---- per-server. (RFE #1241351) + * include/ns.h: + * nsd/nsd.h: + * nsd/server.c: + * nsd/tclinit.c: + * nsd/tclmisc.c: Add Ns_TclLogErrorInfo and allow admin to + configure which conenction headers to log for Tcl + errors. (RFE #1241432) + 2005-07-22 Stephen Deasey <sd...@us...> |
From: Stephen D. <sd...@us...> - 2005-07-30 03:11:42
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28549 Modified Files: ChangeLog Log Message: * nsd/nsd.h: * nsd/nsmain.c: * nsd/tclinit.c: Allocate interps efficiently, max 1 per-thread per-server. (RFE #1241351) Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.171 retrieving revision 1.172 diff -C2 -d -r1.171 -r1.172 *** ChangeLog 22 Jul 2005 06:46:39 -0000 1.171 --- ChangeLog 30 Jul 2005 03:10:57 -0000 1.172 *************** *** 1,2 **** --- 1,9 ---- + 2005-07-29 Stephen Deasey <sd...@us...> + + * nsd/nsd.h: + * nsd/nsmain.c: + * nsd/tclinit.c: Allocate interps efficiently, max 1 per-thread + per-server. (RFE #1241351) + 2005-07-22 Stephen Deasey <sd...@us...> |
From: Stephen D. <sd...@us...> - 2005-07-30 03:11:17
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28549/nsd Modified Files: nsd.h nsmain.c tclinit.c Log Message: * nsd/nsd.h: * nsd/nsmain.c: * nsd/tclinit.c: Allocate interps efficiently, max 1 per-thread per-server. (RFE #1241351) Index: tclinit.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclinit.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tclinit.c 12 Jul 2005 07:31:39 -0000 1.9 --- tclinit.c 30 Jul 2005 03:11:07 -0000 1.10 *************** *** 80,89 **** */ ! static Tcl_Interp *CreateInterp(); ! static Tcl_InterpDeleteProc FreeInterpData; ! static int UpdateInterp(NsInterp *itPtr); ! static NsInterp *PopInterp(CONST char *server); static void PushInterp(NsInterp *itPtr); static Tcl_HashEntry *GetCacheEntry(NsServer *servPtr); static Ns_TlsCleanup DeleteInterps; static void RunTraces(NsInterp *itPtr, int why); --- 80,90 ---- */ ! static NsInterp *PopInterp(NsServer *servPtr, Tcl_Interp *interp); static void PushInterp(NsInterp *itPtr); static Tcl_HashEntry *GetCacheEntry(NsServer *servPtr); + static Tcl_Interp *CreateInterp(NsInterp **itPtrPtr); + static NsInterp *NewInterpData(Tcl_Interp *interp); + static int UpdateInterp(NsInterp *itPtr); + static Tcl_InterpDeleteProc FreeInterpData; static Ns_TlsCleanup DeleteInterps; static void RunTraces(NsInterp *itPtr, int why); *************** *** 169,178 **** Ns_TclCreateInterp(void) { ! Tcl_Interp *interp; ! ! interp = CreateInterp(); ! (void) NsInitInterp(interp, NULL, NULL); ! ! return interp; } --- 170,174 ---- Ns_TclCreateInterp(void) { ! return CreateInterp(NULL); } *************** *** 186,190 **** * * Results: ! * Tcl result. * * Side effects: --- 182,186 ---- * * Results: ! * Always TCL_OK. * * Side effects: *************** *** 197,201 **** Ns_TclInit(Tcl_Interp *interp) { ! return NsInitInterp(interp, NULL, NULL); } --- 193,198 ---- Ns_TclInit(Tcl_Interp *interp) { ! (void) NewInterpData(interp); ! return TCL_OK; } *************** *** 248,261 **** * Ns_TclAllocateInterp -- * ! * Allocate an interpreter from the per-thread list. Note that a ! * single thread can have multiple interps for multiple virtual ! * servers. * * Results: ! * Pointer to Tcl_Interp. * * Side effects: ! * See PopInterp for details on various traces which may be ! * called. * *---------------------------------------------------------------------- --- 245,256 ---- * Ns_TclAllocateInterp -- * ! * Return a pre-initialized interp for the given server or create ! * a new one and cache it for the current thread. * * Results: ! * Pointer to Tcl_Interp or NULL if invalid server. * * Side effects: ! * May invoke alloc and create traces. * *---------------------------------------------------------------------- *************** *** 265,272 **** Ns_TclAllocateInterp(CONST char *server) { NsInterp *itPtr; ! itPtr = PopInterp(server); ! return (itPtr ? itPtr->interp : NULL); } --- 260,282 ---- Ns_TclAllocateInterp(CONST char *server) { + NsServer *servPtr; NsInterp *itPtr; ! /* ! * Verify the server. NULL (i.e., no server) is valid but ! * a non-null, unknown server is an error. ! */ ! ! if (server == NULL) { ! servPtr = NULL; ! } else { ! servPtr = NsGetServer(server); ! if (servPtr == NULL) { ! return NULL; ! } ! } ! itPtr = PopInterp(servPtr, NULL); ! ! return itPtr->interp; } *************** *** 278,285 **** * * Return an interp to the per-thread cache. If the interp is ! * associated with a connection, silently do nothing as cleanup ! * will occur later with connection cleanup. If the interp is ! * only a Tcl interp, i.e., missing the NsInterp structure, ! * simply delete the interp directly (this is suspect). * * Results: --- 288,293 ---- * * Return an interp to the per-thread cache. If the interp is ! * associated with a connection, simply adjust the refcnt as ! * cleanup will occur later when the connection closes. * * Results: *************** *** 299,305 **** --- 307,316 ---- itPtr = NsGetInterpData(interp); if (itPtr == NULL) { + Ns_Log(Bug, "Ns_TclDeAllocateInterp: no interp data"); Tcl_DeleteInterp(interp); } else if (itPtr->conn == NULL) { PushInterp(itPtr); + } else { + itPtr->refcnt--; } } *************** *** 332,336 **** if (connPtr->itPtr == NULL) { ! itPtr = PopInterp(connPtr->server); itPtr->conn = conn; itPtr->nsconn.flags = 0; --- 343,347 ---- if (connPtr->itPtr == NULL) { ! itPtr = PopInterp(connPtr->servPtr, NULL); itPtr->conn = conn; itPtr->nsconn.flags = 0; *************** *** 409,420 **** Ns_TclDestroyInterp(Tcl_Interp *interp) { ! NsInterp *itPtr = NsGetInterpData(interp); /* ! * If this is a server interp, invoke the delete traces. */ ! if (itPtr != NULL) { RunTraces(itPtr, NS_TCL_TRACE_DELETE); } --- 420,435 ---- Ns_TclDestroyInterp(Tcl_Interp *interp) { ! NsInterp *itPtr = NsGetInterpData(interp); ! Tcl_HashEntry *hPtr; /* ! * If this is a server interp, invoke the delete traces ! * and remove from thread cache. */ ! if (itPtr != NULL && itPtr->servPtr != NULL) { RunTraces(itPtr, NS_TCL_TRACE_DELETE); + hPtr = GetCacheEntry(itPtr->servPtr); + Tcl_SetHashValue(hPtr, NULL); } *************** *** 1039,1042 **** --- 1054,1058 ---- } itPtr->delete = 1; + return TCL_OK; } *************** *** 1177,1184 **** *---------------------------------------------------------------------- * ! * NsInitInterp -- * ! * Initialize the given interp with basic commands and if servPtr ! * is not null, virtual server commands. * * Results: --- 1193,1200 ---- *---------------------------------------------------------------------- * ! * NsTclAppInit -- * ! * Initialize an interactive command interp with basic and ! * server commands using the default virtual server. * * Results: *************** *** 1186,1191 **** * * Side effects: ! * Depends on Tcl init script sourced by Tcl_Init. Some Tcl ! * object types will be initialized on first call. * *---------------------------------------------------------------------- --- 1202,1206 ---- * * Side effects: ! * Depends on Tcl init script sourced by Tcl_Init. * *---------------------------------------------------------------------- *************** *** 1193,1267 **** int ! NsInitInterp(Tcl_Interp *interp, NsServer *servPtr, NsInterp **itPtrPtr) { ! static volatile int initialized = 0; ! NsInterp *itPtr; ! int result = TCL_OK; /* ! * Core one-time server initialization to add a few Tcl_Obj ! * types. These calls cannot be in NsTclInit above because ! * Tcl is not fully initialized at libnsd load time. */ ! if (!initialized) { ! Ns_MasterLock(); ! if (!initialized) { ! NsTclInitQueueType(); ! NsTclInitAddrType(); ! NsTclInitTimeType(); ! NsTclInitSpecType(); ! NsTclInitKeylistType(); ! initialized = 1; ! } ! Ns_MasterUnlock(); } ! /* ! * Allocate and initialize a new NsInterp struct. ! */ ! ! itPtr = NsGetInterpData(interp); ! if (itPtr == NULL) { ! itPtr = ns_calloc(1, sizeof(NsInterp)); ! itPtr->interp = interp; ! Tcl_InitHashTable(&itPtr->sets, TCL_STRING_KEYS); ! Tcl_InitHashTable(&itPtr->chans, TCL_STRING_KEYS); ! Tcl_InitHashTable(&itPtr->https, TCL_STRING_KEYS); ! ! /* ! * Associate the new NsInterp with this interp. At interp delete ! * time, Tcl will call FreeInterpData to cleanup the struct. ! */ ! ! Tcl_SetAssocData(interp, "ns:data", FreeInterpData, itPtr); ! ! /* ! * Add basic commands which function without a virtual server. ! */ ! ! NsTclAddBasicCmds(itPtr); ! ! /* ! * Add virtual-server commands and update the interp ! * state, run create traces. ! */ ! ! if (servPtr != NULL) { ! itPtr->servPtr = servPtr; ! NsTclAddServerCmds(itPtr); ! RunTraces(itPtr, NS_TCL_TRACE_CREATE); ! if ((result = UpdateInterp(itPtr)) != TCL_OK) { ! Ns_TclLogError(interp); ! } ! } else { ! RunTraces(itPtr, NS_TCL_TRACE_CREATE); ! } } ! if (itPtrPtr != NULL) { ! *itPtrPtr = itPtr; } ! return result; } --- 1208,1245 ---- int ! NsTclAppInit(Tcl_Interp *interp) { ! NsServer *servPtr; ! NsInterp *itPtr; ! Tcl_HashEntry *hPtr; /* ! * There can only be one interp per-server per-thread, and it ! * needs to be the one Tcl just handed us. Clear out any ! * previously cached interp. */ ! servPtr = NsGetServer(nsconf.defaultServer); ! if (servPtr == NULL) { ! Ns_Log(Bug, "NsTclAppInit: invalid default server: %s", ! nsconf.defaultServer); ! return TCL_ERROR; } ! hPtr = GetCacheEntry(servPtr); ! itPtr = Tcl_GetHashValue(hPtr); ! if (itPtr != NULL) { ! Ns_TclDestroyInterp(itPtr->interp); ! Tcl_SetHashValue(hPtr, NULL); } ! ! if (Tcl_Init(interp) != TCL_OK) { ! Ns_TclLogError(interp); } + Tcl_SetVar(interp, "tcl_rcFileName", "~/.nsdrc", TCL_GLOBAL_ONLY); ! itPtr = PopInterp(servPtr, interp); ! ! return TCL_OK; } *************** *** 1354,1366 **** * PopInterp -- * ! * Pop next avaialble virtual-server interp from the per-thread ! * cache, allocating a new interp if necessary. * * Results: ! * Pointer to next available NsInterp. * * Side effects: ! * Will invoke alloc traces and, if the interp is new, create ! * traces. * *---------------------------------------------------------------------- --- 1332,1345 ---- * PopInterp -- * ! * Get virtual-server interp from the per-thread cache and ! * increment the reference count. Allocate a new interp if ! * necessary. * * Results: ! * NsInterp. * * Side effects: ! * Will invoke alloc traces if not recursively allocated and, if ! * the interp is new, create traces. * *---------------------------------------------------------------------- *************** *** 1368,1414 **** static NsInterp * ! PopInterp(CONST char *server) { - NsServer *servPtr; NsInterp *itPtr; - Tcl_Interp *interp; Tcl_HashEntry *hPtr; static Ns_Cs lock; /* ! * Verify the server. NULL (i.e., no server) is valid but ! * a non-null, unknown server is an error. ! */ ! ! if (server == NULL) { ! servPtr = NULL; ! } else { ! servPtr = NsGetServer(server); ! if (servPtr == NULL) { ! return NULL; ! } ! } ! ! /* ! * Pop the first interp off the list of availabe interps for ! * the given virtual server on this thread. If none exists, ! * create and initialize a new interp. */ hPtr = GetCacheEntry(servPtr); itPtr = Tcl_GetHashValue(hPtr); ! if (itPtr != NULL) { ! Tcl_SetHashValue(hPtr, itPtr->nextPtr); ! } else { if (nsconf.tcl.lockoninit) { Ns_CsEnter(&lock); } ! interp = CreateInterp(); ! NsInitInterp(interp, servPtr, &itPtr); if (nsconf.tcl.lockoninit) { Ns_CsLeave(&lock); } } - itPtr->nextPtr = NULL; /* --- 1347,1388 ---- static NsInterp * ! PopInterp(NsServer *servPtr, Tcl_Interp *interp) { NsInterp *itPtr; Tcl_HashEntry *hPtr; static Ns_Cs lock; /* ! * Get an already initialized interp for the given virtual server ! * on this thread. If it doesn't yet exist, create and ! * initialize one. */ hPtr = GetCacheEntry(servPtr); itPtr = Tcl_GetHashValue(hPtr); ! if (itPtr == NULL) { if (nsconf.tcl.lockoninit) { Ns_CsEnter(&lock); } ! if (interp != NULL) { ! itPtr = NewInterpData(interp); ! } else { ! interp = CreateInterp(&itPtr); ! } ! if (servPtr != NULL) { ! itPtr->servPtr = servPtr; ! NsTclAddServerCmds(itPtr); ! RunTraces(itPtr, NS_TCL_TRACE_CREATE); ! if (UpdateInterp(itPtr) != TCL_OK) { ! Ns_TclLogError(interp); ! } ! } else { ! RunTraces(itPtr, NS_TCL_TRACE_CREATE); ! } if (nsconf.tcl.lockoninit) { Ns_CsLeave(&lock); } + Tcl_SetHashValue(hPtr, itPtr); } /* *************** *** 1417,1424 **** */ ! RunTraces(itPtr, NS_TCL_TRACE_ALLOCATE); ! if (Tcl_EvalEx(itPtr->interp, "ns_init", -1, 0) != TCL_OK) { ! Ns_TclLogError(itPtr->interp); } return itPtr; } --- 1391,1401 ---- */ ! if (++itPtr->refcnt == 1) { ! RunTraces(itPtr, NS_TCL_TRACE_ALLOCATE); ! if (Tcl_EvalEx(itPtr->interp, "ns_init", -1, 0) != TCL_OK) { ! Ns_TclLogError(itPtr->interp); ! } } + return itPtr; } *************** *** 1430,1434 **** * PushInterp -- * ! * Return a virtual-server interp to the per-thread interp list. * * Results: --- 1407,1411 ---- * PushInterp -- * ! * Return a virtual-server interp to the thread cache. * * Results: *************** *** 1436,1440 **** * * Side effects: ! * Will invoke de-alloc traces, interp may be destroyed. * *---------------------------------------------------------------------- --- 1413,1418 ---- * * Side effects: ! * May invoke de-alloc traces, destroy interp if no longer ! * being used. * *---------------------------------------------------------------------- *************** *** 1445,1449 **** { Tcl_Interp *interp = itPtr->interp; - Tcl_HashEntry *hPtr; /* --- 1423,1426 ---- *************** *** 1453,1468 **** */ ! RunTraces(itPtr, NS_TCL_TRACE_DEALLOCATE); ! if (Tcl_EvalEx(interp, "ns_cleanup", -1, 0) != TCL_OK) { ! Ns_TclLogError(interp); ! } ! if (itPtr->delete) { ! Ns_TclDestroyInterp(interp); ! } else { ! Tcl_ResetResult(interp); ! hPtr = GetCacheEntry(itPtr->servPtr); ! itPtr->nextPtr = Tcl_GetHashValue(hPtr); ! Tcl_SetHashValue(hPtr, itPtr); } } --- 1430,1445 ---- */ ! if (itPtr->refcnt == 1) { ! RunTraces(itPtr, NS_TCL_TRACE_DEALLOCATE); ! if (Tcl_EvalEx(interp, "ns_cleanup", -1, 0) != TCL_OK) { ! Ns_TclLogError(interp); ! } ! if (itPtr->delete) { ! Ns_TclDestroyInterp(interp); ! return; ! } } + Tcl_ResetResult(interp); + itPtr->refcnt--; } *************** *** 1520,1523 **** --- 1497,1501 ---- CreateInterp(NsInterp **itPtrPtr) { + NsInterp *itPtr; Tcl_Interp *interp; *************** *** 1532,1535 **** --- 1510,1522 ---- } + /* + * Allocate and associate a new NsInterp struct for the interp. + */ + + itPtr = NewInterpData(interp); + if (itPtrPtr != NULL) { + *itPtrPtr = itPtr; + } + return interp; } *************** *** 1539,1566 **** *---------------------------------------------------------------------- * ! * FreeInterpData -- * ! * Tcl assoc data callback to destroy the per-interp NsInterp ! * structure at interp delete time. * * Results: ! * None. * * Side effects: ! * None. * *---------------------------------------------------------------------- */ ! static void ! FreeInterpData(ClientData arg, Tcl_Interp *interp) { ! NsInterp *itPtr = arg; ! NsFreeAdp(itPtr); ! Tcl_DeleteHashTable(&itPtr->sets); ! Tcl_DeleteHashTable(&itPtr->chans); ! Tcl_DeleteHashTable(&itPtr->https); ! ns_free(itPtr); } --- 1526,1596 ---- *---------------------------------------------------------------------- * ! * NewInterpData -- * ! * Create a new NsInterp struct for the given interp, adding ! * basic commands and associating it with the interp. * * Results: ! * Pointer to new NsInterp struct. * * Side effects: ! * Depends on Tcl init script sourced by Tcl_Init. Some Tcl ! * object types will be initialized on first call. * *---------------------------------------------------------------------- */ ! static NsInterp * ! NewInterpData(Tcl_Interp *interp) { ! static volatile int initialized = 0; ! NsInterp *itPtr; ! /* ! * Core one-time server initialization to add a few Tcl_Obj ! * types. These calls cannot be in NsTclInit above because ! * Tcl is not fully initialized at libnsd load time. ! */ ! ! if (!initialized) { ! Ns_MasterLock(); ! if (!initialized) { ! NsTclInitQueueType(); ! NsTclInitAddrType(); ! NsTclInitTimeType(); ! NsTclInitKeylistType(); ! initialized = 1; ! } ! Ns_MasterUnlock(); ! } ! ! /* ! * Allocate and initialize a new NsInterp struct. ! */ ! ! itPtr = NsGetInterpData(interp); ! if (itPtr == NULL) { ! itPtr = ns_calloc(1, sizeof(NsInterp)); ! itPtr->interp = interp; ! itPtr->servPtr = NULL; ! Tcl_InitHashTable(&itPtr->sets, TCL_STRING_KEYS); ! Tcl_InitHashTable(&itPtr->chans, TCL_STRING_KEYS); ! Tcl_InitHashTable(&itPtr->https, TCL_STRING_KEYS); ! ! /* ! * Associate the new NsInterp with this interp. At interp delete ! * time, Tcl will call FreeInterpData to cleanup the struct. ! */ ! ! Tcl_SetAssocData(interp, "ns:data", FreeInterpData, itPtr); ! ! /* ! * Add basic commands which function without a virtual server. ! */ ! ! NsTclAddBasicCmds(itPtr); ! } ! ! return itPtr; } *************** *** 1610,1616 **** *---------------------------------------------------------------------- * * DeleteInterps -- * ! * Delete all per-thread interps at thread exit time. * * Results: --- 1640,1676 ---- *---------------------------------------------------------------------- * + * FreeInterpData -- + * + * Tcl assoc data callback to destroy the per-interp NsInterp + * structure at interp delete time. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + static void + FreeInterpData(ClientData arg, Tcl_Interp *interp) + { + NsInterp *itPtr = arg; + + NsFreeAdp(itPtr); + Tcl_DeleteHashTable(&itPtr->sets); + Tcl_DeleteHashTable(&itPtr->chans); + Tcl_DeleteHashTable(&itPtr->https); + ns_free(itPtr); + } + + + /* + *---------------------------------------------------------------------- + * * DeleteInterps -- * ! * Delete all cached virtual-server interps at thread exit time. * * Results: *************** *** 1633,1638 **** hPtr = Tcl_FirstHashEntry(tablePtr, &search); while (hPtr != NULL) { ! while ((itPtr = Tcl_GetHashValue(hPtr)) != NULL) { ! Tcl_SetHashValue(hPtr, itPtr->nextPtr); Ns_TclDestroyInterp(itPtr->interp); } --- 1693,1697 ---- hPtr = Tcl_FirstHashEntry(tablePtr, &search); while (hPtr != NULL) { ! if ((itPtr = Tcl_GetHashValue(hPtr)) != NULL) { Ns_TclDestroyInterp(itPtr->interp); } Index: nsd.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsd.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** nsd.h 22 Jul 2005 06:46:40 -0000 1.26 --- nsd.h 30 Jul 2005 03:11:06 -0000 1.27 *************** *** 170,173 **** --- 170,174 ---- Tcl_HashTable servertable; Tcl_DString servers; + char *defaultServer; /* *************** *** 747,756 **** typedef struct NsInterp { - struct NsInterp *nextPtr; Tcl_Interp *interp; ! NsServer *servPtr; ! int delete; ! int epoch; ! /* * The following pointer maintains the first in --- 748,757 ---- typedef struct NsInterp { Tcl_Interp *interp; ! NsServer *servPtr; ! int delete; /* Interp should be deleted on next deallocation */ ! int epoch; /* Run the update script if != to server epoch */ ! int refcnt; /* Counts recursive allocations of cached interp */ ! /* * The following pointer maintains the first in *************** *** 864,873 **** extern NsServer *NsGetServer(CONST char *server); extern NsServer *NsGetInitServer(void); - extern NsInterp *NsGetInterpData(Tcl_Interp *interp) NS_GNUC_NONNULL(1); - extern int NsInitInterp(Tcl_Interp *interp, NsServer *servPtr, - NsInterp **itPtrPtr) - NS_GNUC_NONNULL(1); - extern void NsFreeConnInterp(Conn *connPtr) - NS_GNUC_NONNULL(1); extern Ns_Cache *NsFastpathCache(char *server, int size); --- 865,868 ---- *************** *** 952,957 **** --- 947,958 ---- extern void NsWaitJobsShutdown(Ns_Time *toPtr); + extern Tcl_AppInitProc NsTclAppInit; extern void NsTclInitServer(CONST char *server) NS_GNUC_NONNULL(1); + extern NsInterp *NsGetInterpData(Tcl_Interp *interp) + NS_GNUC_NONNULL(1); + extern void NsFreeConnInterp(Conn *connPtr) + NS_GNUC_NONNULL(1); + extern void NsLoadModules(CONST char *server); extern struct Bucket *NsTclCreateBuckets(char *server, int nbuckets); Index: nsmain.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsmain.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** nsmain.c 12 Jul 2005 07:31:39 -0000 1.16 --- nsmain.c 30 Jul 2005 03:11:06 -0000 1.17 *************** *** 63,68 **** */ - static Tcl_AppInitProc CommandInit; - static int StartWatchedServer(void); static void SysLog(int priority, char *fmt, ...); --- 63,66 ---- *************** *** 83,87 **** */ - static char *cmdServer; /* Command mode interp server */ static int watchdogExit = 0; /* Watchdog loop toggle */ --- 81,84 ---- *************** *** 695,699 **** } } ! cmdServer = server; /* --- 692,696 ---- } } ! nsconf.defaultServer = server; /* *************** *** 749,753 **** cmdargv[cmdargc++] = argv[i]; } ! Tcl_Main(cmdargc, cmdargv, CommandInit); } --- 746,750 ---- cmdargv[cmdargc++] = argv[i]; } ! Tcl_Main(cmdargc, cmdargv, NsTclAppInit); } *************** *** 940,972 **** *---------------------------------------------------------------------- * - * CommandInit -- - * - * Initialize the command interp with basic and server commands. - * - * Results: - * Tcl result. - * - * Side effects: - * Depends on init scripts. - * - *---------------------------------------------------------------------- - */ - - static int - CommandInit(Tcl_Interp *interp) - { - NsServer *servPtr = NsGetServer(cmdServer); - - Tcl_InitMemory(interp); - if (Tcl_Init(interp) != TCL_OK) { - Ns_TclLogError(interp); - } - return NsInitInterp(interp, servPtr, NULL); - } - - - /* - *---------------------------------------------------------------------- - * * StatusMsg -- * --- 937,940 ---- |
From: Stephen D. <sd...@us...> - 2005-07-22 06:47:25
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28940 Modified Files: ChangeLog Log Message: * include/ns.h: * nsd/nsd.h: * nsd/modload.c: Untabify and reformat. Add CONST declarations. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.170 retrieving revision 1.171 diff -C2 -d -r1.170 -r1.171 *** ChangeLog 22 Jul 2005 06:41:22 -0000 1.170 --- ChangeLog 22 Jul 2005 06:46:39 -0000 1.171 *************** *** 3,6 **** --- 3,10 ---- * include/ns.h: * nsd/nsd.h: + * nsd/modload.c: Untabify and reformat. Add CONST declarations. + + * include/ns.h: + * nsd/nsd.h: * nsd/config.c: Untabify and reformat. Add CONST declarations. |
From: Stephen D. <sd...@us...> - 2005-07-22 06:47:22
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28940/include Modified Files: ns.h Log Message: * include/ns.h: * nsd/nsd.h: * nsd/modload.c: Untabify and reformat. Add CONST declarations. Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ns.h 22 Jul 2005 06:41:23 -0000 1.37 --- ns.h 22 Jul 2005 06:46:40 -0000 1.38 *************** *** 282,286 **** typedef void (Ns_SchedProc) (void *arg, int id); typedef int (Ns_ServerInitProc) (char *server); ! typedef int (Ns_ModuleInitProc) (char *server, char *module); typedef int (Ns_RequestAuthorizeProc) (char *server, char *method, char *url, char *user, char *pass, char *peer); --- 282,286 ---- typedef void (Ns_SchedProc) (void *arg, int id); typedef int (Ns_ServerInitProc) (char *server); ! typedef int (Ns_ModuleInitProc) (CONST char *server, CONST char *module); typedef int (Ns_RequestAuthorizeProc) (char *server, char *method, char *url, char *user, char *pass, char *peer); *************** *** 973,980 **** */ ! NS_EXTERN int Ns_ModuleLoad(char *server, char *module, char *file, char *init); ! NS_EXTERN void *Ns_ModuleSymbol(char *file, char *name); ! NS_EXTERN void *Ns_ModuleGetSymbol(char *name); ! NS_EXTERN void Ns_RegisterModule(char *name, Ns_ModuleInitProc *prco); /* --- 973,992 ---- */ ! NS_EXTERN void ! Ns_RegisterModule(CONST char *name, Ns_ModuleInitProc *proc) ! NS_GNUC_NONNULL(1) NS_GNUC_NONNULL(2); ! ! NS_EXTERN int ! Ns_ModuleLoad(CONST char *server, CONST char *module, CONST char *file, ! CONST char *init) ! NS_GNUC_NONNULL(2) NS_GNUC_NONNULL(3) NS_GNUC_NONNULL(4); ! ! NS_EXTERN void * ! Ns_ModuleSymbol(CONST char *file, CONST char *name) ! NS_GNUC_NONNULL(1) NS_GNUC_NONNULL(2); ! ! NS_EXTERN void * ! Ns_ModuleGetSymbol(CONST char *name) ! NS_GNUC_NONNULL(1); /* |
From: Stephen D. <sd...@us...> - 2005-07-22 06:47:20
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28940/nsd Modified Files: modload.c nsd.h Log Message: * include/ns.h: * nsd/nsd.h: * nsd/modload.c: Untabify and reformat. Add CONST declarations. Index: modload.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/modload.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** modload.c 10 Jun 2005 17:58:39 -0000 1.2 --- modload.c 22 Jul 2005 06:46:40 -0000 1.3 *************** *** 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" *************** *** 32,36 **** * modload.c -- * ! * Load .so files into the server and initialize them. */ --- 32,36 ---- * modload.c -- * ! * Load .so files into the server and initialize them. */ *************** *** 39,61 **** NS_RCSID("@(#) $Header$"); #if defined(USE_DLSHL) ! #include <dl.h> #elif defined(USE_DYLD) ! #include <mach-o/dyld.h> ! static char *dylderr = ""; #elif !defined(_WIN32) ! #include <dlfcn.h> ! #ifdef USE_RTLD_LAZY ! #ifdef RTLD_NOW ! #undef RTLD_NOW ! #endif ! #define RTLD_NOW RTLD_LAZY ! #endif ! #ifndef RTLD_GLOBAL ! #define RTLD_GLOBAL 0 ! #endif ! #ifndef RTLD_NOW ! #define RTLD_NOW 0 ! #endif #endif --- 39,62 ---- NS_RCSID("@(#) $Header$"); + #if defined(USE_DLSHL) ! # include <dl.h> #elif defined(USE_DYLD) ! # include <mach-o/dyld.h> ! static char *dylderr = ""; #elif !defined(_WIN32) ! # include <dlfcn.h> ! # ifdef USE_RTLD_LAZY ! # ifdef RTLD_NOW ! # undef RTLD_NOW ! # endif ! # define RTLD_NOW RTLD_LAZY ! # endif ! # ifndef RTLD_GLOBAL ! # define RTLD_GLOBAL 0 ! # endif ! # ifndef RTLD_NOW ! # define RTLD_NOW 0 ! # endif #endif *************** *** 65,83 **** typedef struct Module { ! struct Module *nextPtr; ! char *name; Ns_ModuleInitProc *proc; } Module; /* ! * Static variables defined in this file. */ ! static Tcl_HashTable modulesTable; ! static void *DlOpen(char *file); ! static void *DlSym(void *handle, char *name); ! static void *DlSym2(void *handle, char *name); static char *DlError(void); ! static Module *firstPtr; --- 66,89 ---- typedef struct Module { ! struct Module *nextPtr; ! char *name; Ns_ModuleInitProc *proc; } Module; /* ! * Static functions defined in this file. */ ! static void *DlOpen(CONST char *file); ! static void *DlSym(void *handle, CONST char *name); ! static void *DlSym2(void *handle, CONST char *name); static char *DlError(void); ! ! /* ! * Static variables defined in this file. ! */ ! ! static Tcl_HashTable modulesTable; /* Table of loaded, loadable modules. */ ! static Module *firstPtr; /* List of static modules to be initilaized. */ *************** *** 87,97 **** * NsInitModLoad -- * ! * Initialize module table. * * Results: ! * None. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 93,103 ---- * NsInitModLoad -- * ! * Initialize module table. * * Results: ! * None. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 114,127 **** * Ns_RegisterModule -- * ! * Register a static module. This routine can only be called from ! * a Ns_ServerInitProc passed to Ns_Main or within the Ns_ModuleInit ! * proc of a loadable module. It registers a module callback for ! * for the currently initializing server. * * Results: ! * None. * * Side effects: ! * Proc will be called after dynamic modules are loaded. * *---------------------------------------------------------------------- --- 120,133 ---- * Ns_RegisterModule -- * ! * Register a static module. This routine can only be called from ! * a Ns_ServerInitProc passed to Ns_Main or within the Ns_ModuleInit ! * proc of a loadable module. It registers a module callback for ! * for the currently initializing server. * * Results: ! * None. * * Side effects: ! * Proc will be called after dynamic modules are loaded. * *---------------------------------------------------------------------- *************** *** 129,133 **** void ! Ns_RegisterModule(char *name, Ns_ModuleInitProc *proc) { Module *modPtr, **nextPtrPtr; --- 135,139 ---- void ! Ns_RegisterModule(CONST char *name, Ns_ModuleInitProc *proc) { Module *modPtr, **nextPtrPtr; *************** *** 139,143 **** nextPtrPtr = &firstPtr; while (*nextPtrPtr != NULL) { ! nextPtrPtr = &((*nextPtrPtr)->nextPtr); } *nextPtrPtr = modPtr; --- 145,149 ---- nextPtrPtr = &firstPtr; while (*nextPtrPtr != NULL) { ! nextPtrPtr = &((*nextPtrPtr)->nextPtr); } *nextPtrPtr = modPtr; *************** *** 150,161 **** * Ns_ModuleLoad -- * ! * Load a module and initialize it. The result code from modules ! * without the version symbol are ignored. * * Results: ! * NS_OK or NS_ERROR * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 156,167 ---- * Ns_ModuleLoad -- * ! * Load a module and initialize it. The result code from modules ! * without the version symbol are ignored. * * Results: ! * NS_OK or NS_ERROR. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 163,167 **** int ! Ns_ModuleLoad(char *server, char *module, char *file, char *init) { Ns_ModuleInitProc *initProc; --- 169,174 ---- int ! Ns_ModuleLoad(CONST char *server, CONST char *module, CONST char *file, ! CONST char *init) { Ns_ModuleInitProc *initProc; *************** *** 171,175 **** initProc = Ns_ModuleSymbol(file, init); if (initProc == NULL) { ! return NS_ERROR; } verPtr = Ns_ModuleSymbol(file, "Ns_ModuleVersion"); --- 178,182 ---- initProc = Ns_ModuleSymbol(file, init); if (initProc == NULL) { ! return NS_ERROR; } verPtr = Ns_ModuleSymbol(file, "Ns_ModuleVersion"); *************** *** 178,183 **** status = NS_OK; } else if (status != NS_OK) { ! Ns_Log(Error, "modload: init %s of %s returned: %d", file, init, status); } return status; } --- 185,191 ---- status = NS_OK; } else if (status != NS_OK) { ! Ns_Log(Error, "modload: init %s of %s returned: %d", file, init, status); } + return status; } *************** *** 189,200 **** * Ns_ModuleSymbol -- * ! * Load a module if it's not already loaded, and extract a ! * requested symbol from it. * * Results: ! * A pointer to the symbol's value. * * Side effects: ! * May load the module if it hasn't been loaded yet. * *---------------------------------------------------------------------- --- 197,208 ---- * Ns_ModuleSymbol -- * ! * Load a module if it's not already loaded, and extract the ! * requested symbol from it. * * Results: ! * A pointer to the symbol's value. * * Side effects: ! * May load the module if it hasn't been loaded yet. * *---------------------------------------------------------------------- *************** *** 202,215 **** void * ! Ns_ModuleSymbol(char *file, char *name) { Tcl_HashEntry *hPtr; Ns_DString ds; ! int new; ! void *module; void *symbol; struct stat st; #ifndef _WIN32 ! FileKey key; #endif --- 210,223 ---- void * ! Ns_ModuleSymbol(CONST char *file, CONST char *name) { Tcl_HashEntry *hPtr; Ns_DString ds; ! int new; ! void *module; void *symbol; struct stat st; #ifndef _WIN32 ! FileKey key; #endif *************** *** 220,225 **** } if (stat(file, &st) != 0) { ! Ns_Log(Notice, "modload: stat(%s) failed: %s", file, strerror(errno)); ! goto done; } #ifdef _WIN32 --- 228,233 ---- } if (stat(file, &st) != 0) { ! Ns_Log(Notice, "modload: stat(%s) failed: %s", file, strerror(errno)); ! goto done; } #ifdef _WIN32 *************** *** 233,251 **** module = Tcl_GetHashValue(hPtr); } else { ! Ns_Log(Notice, "modload: loading '%s'", file); ! module = DlOpen(file); ! if (module == NULL) { Ns_Log(Warning, "modload: could not load %s: %s", file, DlError()); Tcl_DeleteHashEntry(hPtr); ! goto done; ! } Tcl_SetHashValue(hPtr, module); } symbol = DlSym(module, name); if (symbol == NULL) { ! Ns_Log(Warning, "modload: could not find %s in %s", name, file); } ! done: Ns_DStringFree(&ds); return symbol; } --- 241,261 ---- module = Tcl_GetHashValue(hPtr); } else { ! Ns_Log(Notice, "modload: loading '%s'", file); ! module = DlOpen(file); ! if (module == NULL) { Ns_Log(Warning, "modload: could not load %s: %s", file, DlError()); Tcl_DeleteHashEntry(hPtr); ! goto done; ! } Tcl_SetHashValue(hPtr, module); } symbol = DlSym(module, name); if (symbol == NULL) { ! Ns_Log(Warning, "modload: could not find %s in %s", name, file); } ! ! done: Ns_DStringFree(&ds); + return symbol; } *************** *** 257,270 **** * Ns_ModuleGetSymbol -- * ! * Locate a given symbol in the program's symbol table and ! * return the address of it. This differs from the other Module ! * functions in that it doesn't require the shared library file ! * name - this should sniff the entire symbol space. * * Results: ! * A pointer to the requested symbol's value. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 267,280 ---- * Ns_ModuleGetSymbol -- * ! * Locate a given symbol in the program's symbol table and ! * return the address of it. This differs from the other Module ! * functions in that it doesn't require the shared library file ! * name - this should sniff the entire symbol space. * * Results: ! * A pointer to the requested symbol's value. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 272,276 **** void * ! Ns_ModuleGetSymbol(char *name) { return DlSym(NULL, name); --- 282,286 ---- void * ! Ns_ModuleGetSymbol(CONST char *name) { return DlSym(NULL, name); *************** *** 283,293 **** * NsLoadModules -- * ! * Load all modules for given server. * * Results: ! * None. * * Side effects: ! * Will load and initialize modules. * *---------------------------------------------------------------------- --- 293,303 ---- * NsLoadModules -- * ! * Load all modules for given server. * * Results: ! * None. * * Side effects: ! * Will load and initialize modules. * *---------------------------------------------------------------------- *************** *** 295,299 **** void ! NsLoadModules(char *server) { Ns_Set *modules; --- 305,309 ---- void ! NsLoadModules(CONST char *server) { Ns_Set *modules; *************** *** 304,318 **** modules = Ns_ConfigGetSection(Ns_ConfigGetPath(server, NULL, "modules", NULL)); for (i = 0; modules != NULL && i < Ns_SetSize(modules); ++i) { ! module = Ns_SetKey(modules, i); file = Ns_SetValue(modules, i); ! /* ! * Check for specific module init after filename. ! */ s = strchr(file, '('); if (s == NULL) { ! init = "Ns_ModuleInit"; ! } else { *s = '\0'; init = s + 1; --- 314,328 ---- modules = Ns_ConfigGetSection(Ns_ConfigGetPath(server, NULL, "modules", NULL)); for (i = 0; modules != NULL && i < Ns_SetSize(modules); ++i) { ! module = Ns_SetKey(modules, i); file = Ns_SetValue(modules, i); ! /* ! * Check for specific module init after filename. ! */ s = strchr(file, '('); if (s == NULL) { ! init = "Ns_ModuleInit"; ! } else { *s = '\0'; init = s + 1; *************** *** 321,337 **** *e = '\0'; } ! } ! /* ! * Load the module if it's not the reserved "tcl" name. ! */ ! ! if (!STRIEQ(file, "tcl") && Ns_ModuleLoad(server, module, file, init) != NS_OK) { ! Ns_Fatal("modload: failed to load module '%s'", file); } ! /* ! * Add this module to the server Tcl init list. ! */ Ns_TclInitModule(server, module); --- 331,347 ---- *e = '\0'; } ! } ! /* ! * Load the module if it's not the reserved "tcl" name. ! */ ! ! if (!STRIEQ(file, "tcl") && Ns_ModuleLoad(server, module, file, init) != NS_OK) { ! Ns_Fatal("modload: failed to load module '%s'", file); } ! /* ! * Add this module to the server Tcl init list. ! */ Ns_TclInitModule(server, module); *************** *** 352,367 **** while (firstPtr != NULL) { ! modPtr = firstPtr; ! firstPtr = NULL; ! while (modPtr != NULL) { ! nextPtr = modPtr->nextPtr; ! Ns_Log(Notice, "modload: initializing module '%s'", modPtr->name); ! if ((*modPtr->proc)(server, modPtr->name) != NS_OK) { ! Ns_Fatal("modload: failed to initialize %s", modPtr->name); ! } ! ns_free(modPtr->name); ! ns_free(modPtr); ! modPtr = nextPtr; ! } } } --- 362,377 ---- while (firstPtr != NULL) { ! modPtr = firstPtr; ! firstPtr = NULL; ! while (modPtr != NULL) { ! nextPtr = modPtr->nextPtr; ! Ns_Log(Notice, "modload: initializing module '%s'", modPtr->name); ! if ((*modPtr->proc)(server, modPtr->name) != NS_OK) { ! Ns_Fatal("modload: failed to initialize %s", modPtr->name); ! } ! ns_free(modPtr->name); ! ns_free(modPtr); ! modPtr = nextPtr; ! } } } *************** *** 373,383 **** * DlOpen -- * ! * Load a dynamic library * * Results: ! * An Ns_ModHandle, or NULL on failure. * * Side effects: ! * See shl_load * *---------------------------------------------------------------------- --- 383,393 ---- * DlOpen -- * ! * Load a dynamic library. * * Results: ! * An Ns_ModHandle, or NULL on failure. * * Side effects: ! * See shl_load. * *---------------------------------------------------------------------- *************** *** 385,389 **** static void * ! DlOpen(char *file) { #if defined(USE_DYLD) --- 395,399 ---- static void * ! DlOpen(CONST char *file) { #if defined(USE_DYLD) *************** *** 391,395 **** NSObjectFileImage image; NSModule module; ! NSObjectFileImageReturnCode err; module = NULL; --- 401,405 ---- NSObjectFileImage image; NSModule module; ! NSObjectFileImageReturnCode err; module = NULL; *************** *** 398,433 **** err = NSCreateObjectFileImageFromFile(file, &image); switch (err) { ! case NSObjectFileImageSuccess: module = NSLinkModule(image, file, TRUE); ! break; ! case NSObjectFileImageInappropriateFile: ! dylderr = "Inappropriate Mach-O file"; ! retry = 1; ! break; ! case NSObjectFileImageArch: ! dylderr = "Inappropriate Mach-O architecture"; ! break; ! case NSObjectFileImageFormat: ! dylderr = "Invalid Mach-O file format"; ! retry = 1; ! break; ! case NSObjectFileImageAccess: ! dylderr = "Permission denied"; ! break; ! default: ! dylderr = "Unknown error"; ! break; } if (retry) { ! /* ! * Fallback to open shared library. ! */ ! module = (void *)NSAddImage(file, ! NSADDIMAGE_OPTION_WITH_SEARCHING | ! NSADDIMAGE_OPTION_RETURN_ON_ERROR); } return (void *) module; #elif defined(_WIN32) return (void *) LoadLibrary(file); --- 408,446 ---- err = NSCreateObjectFileImageFromFile(file, &image); switch (err) { ! case NSObjectFileImageSuccess: module = NSLinkModule(image, file, TRUE); ! break; ! case NSObjectFileImageInappropriateFile: ! dylderr = "Inappropriate Mach-O file"; ! retry = 1; ! break; ! case NSObjectFileImageArch: ! dylderr = "Inappropriate Mach-O architecture"; ! break; ! case NSObjectFileImageFormat: ! dylderr = "Invalid Mach-O file format"; ! retry = 1; ! break; ! case NSObjectFileImageAccess: ! dylderr = "Permission denied"; ! break; ! default: ! dylderr = "Unknown error"; ! break; } + if (retry) { ! /* ! * Fallback to open shared library. ! */ ! module = (void *) NSAddImage(file, ! NSADDIMAGE_OPTION_WITH_SEARCHING ! | NSADDIMAGE_OPTION_RETURN_ON_ERROR); } + return (void *) module; + #elif defined(_WIN32) return (void *) LoadLibrary(file); *************** *** 445,455 **** * DlSym -- * ! * Load a symbol from a shared object * * Results: ! * A symbol pointer or null on error. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 458,468 ---- * DlSym -- * ! * Load a symbol from a shared object. * * Results: ! * A symbol pointer or null on error. * * Side effects: ! * None. * *---------------------------------------------------------------------- *************** *** 457,461 **** static void * ! DlSym(void *handle, char *name) { Ns_DString ds; --- 470,474 ---- static void * ! DlSym(void *handle, CONST char *name) { Ns_DString ds; *************** *** 480,484 **** static void * ! DlSym2(void *handle, char *name) { void *symbol = NULL; --- 493,497 ---- static void * ! DlSym2(void *handle, CONST char *name) { void *symbol = NULL; *************** *** 489,497 **** } #elif defined(_WIN32) ! symbol = (void *) GetProcAddress((HMODULE) handle, name); #elif (USE_DYLD) symbol = (void *) NSLookupSymbolInModule(handle, name); if (symbol == NULL) { ! /* * Fallback to get symbol from shared library --- 502,510 ---- } #elif defined(_WIN32) ! symbol = (void *) GetProcAddress((HMODULE) handle, name); #elif (USE_DYLD) symbol = (void *) NSLookupSymbolInModule(handle, name); if (symbol == NULL) { ! /* * Fallback to get symbol from shared library *************** *** 499,511 **** symbol = (void *) NSLookupSymbolInImage(handle, name, ! NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW | ! NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); } if (symbol != NULL) { ! symbol = (void *) NSAddressOfSymbol(symbol); } #else symbol = dlsym(handle, name); #endif return symbol; } --- 512,525 ---- symbol = (void *) NSLookupSymbolInImage(handle, name, ! NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW ! | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); } if (symbol != NULL) { ! symbol = (void *) NSAddressOfSymbol(symbol); } #else symbol = dlsym(handle, name); #endif + return symbol; } *************** *** 517,527 **** * DlError -- * ! * Return the error code from trying to load a shared object * * Results: ! * A string error. * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 531,541 ---- * DlError -- * ! * Return the error code from trying to load a shared object. * * Results: ! * A string error. * * Side effects: ! * None. * *---------------------------------------------------------------------- Index: nsd.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsd.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** nsd.h 22 Jul 2005 06:41:28 -0000 1.25 --- nsd.h 22 Jul 2005 06:46:40 -0000 1.26 *************** *** 954,958 **** extern void NsTclInitServer(CONST char *server) NS_GNUC_NONNULL(1); ! extern void NsLoadModules(char *server); extern struct Bucket *NsTclCreateBuckets(char *server, int nbuckets); --- 954,958 ---- extern void NsTclInitServer(CONST char *server) NS_GNUC_NONNULL(1); ! extern void NsLoadModules(CONST char *server); extern struct Bucket *NsTclCreateBuckets(char *server, int nbuckets); |
From: Stephen D. <sd...@us...> - 2005-07-22 06:42:05
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27286/include Modified Files: ns.h Log Message: * include/ns.h: * nsd/nsd.h: * nsd/config.c: Untabify and reformat. Add CONST declarations. Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ns.h 12 Jul 2005 16:00:52 -0000 1.36 --- ns.h 22 Jul 2005 06:41:23 -0000 1.37 *************** *** 593,605 **** */ ! NS_EXTERN char *Ns_ConfigGetValue(char *section, char *key); ! NS_EXTERN char *Ns_ConfigGetValueExact(char *section, char *key); ! NS_EXTERN int Ns_ConfigGetInt(char *section, char *key, int *valuePtr); ! NS_EXTERN int Ns_ConfigGetInt64(char *section, char *key, ns_int64 *valuePtr); ! NS_EXTERN int Ns_ConfigGetBool(char *section, char *key, int *valuePtr); ! NS_EXTERN char *Ns_ConfigGetPath(char *server, char *module, ...) NS_GNUC_SENTINEL; ! NS_EXTERN Ns_Set **Ns_ConfigGetSections(void); ! NS_EXTERN Ns_Set *Ns_ConfigGetSection(char *section); ! NS_EXTERN void Ns_GetVersion(int *major, int *minor, int *patch, int *type); /* --- 593,623 ---- */ ! NS_EXTERN char * ! Ns_ConfigGetValue(CONST char *section, CONST char *key); ! ! NS_EXTERN char * ! Ns_ConfigGetValueExact(CONST char *section, CONST char *key); ! ! NS_EXTERN int ! Ns_ConfigGetInt(CONST char *section, CONST char *key, int *valuePtr); ! ! NS_EXTERN int ! Ns_ConfigGetInt64(CONST char *section, CONST char *key, ns_int64 *valuePtr); ! ! NS_EXTERN int ! Ns_ConfigGetBool(CONST char *section, CONST char *key, int *valuePtr); ! ! NS_EXTERN char * ! Ns_ConfigGetPath(CONST char *server, CONST char *module, ...) ! NS_GNUC_SENTINEL; ! ! NS_EXTERN Ns_Set ** ! Ns_ConfigGetSections(void); ! ! NS_EXTERN Ns_Set * ! Ns_ConfigGetSection(CONST char *section); ! ! NS_EXTERN void ! Ns_GetVersion(int *major, int *minor, int *patch, int *type); /* |
From: Stephen D. <sd...@us...> - 2005-07-22 06:42:03
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27286 Modified Files: ChangeLog Log Message: * include/ns.h: * nsd/nsd.h: * nsd/config.c: Untabify and reformat. Add CONST declarations. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.169 retrieving revision 1.170 diff -C2 -d -r1.169 -r1.170 *** ChangeLog 21 Jul 2005 10:43:09 -0000 1.169 --- ChangeLog 22 Jul 2005 06:41:22 -0000 1.170 *************** *** 1,2 **** --- 1,8 ---- + 2005-07-22 Stephen Deasey <sd...@us...> + + * include/ns.h: + * nsd/nsd.h: + * nsd/config.c: Untabify and reformat. Add CONST declarations. + 2005-07-21 Stephen Deasey <sd...@us...> |
From: Stephen D. <sd...@us...> - 2005-07-22 06:41:40
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27286/nsd Modified Files: config.c nsd.h Log Message: * include/ns.h: * nsd/nsd.h: * nsd/config.c: Untabify and reformat. Add CONST declarations. Index: config.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/config.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** config.c 10 Jun 2005 17:58:38 -0000 1.2 --- config.c 22 Jul 2005 06:41:24 -0000 1.3 *************** *** 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 [...974 lines suppressed...] return set; } --- 624,640 ---- set = NULL; if (!create) { ! hPtr = Tcl_FindHashEntry(&nsconf.sections, section); } else { ! hPtr = Tcl_CreateHashEntry(&nsconf.sections, section, &new); ! if (new) { ! set = Ns_SetCreate(section); ! Tcl_SetHashValue(hPtr, set); ! } } if (hPtr != NULL) { ! set = Tcl_GetHashValue(hPtr); } Ns_DStringFree(&ds); + return set; } Index: nsd.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsd.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** nsd.h 12 Jul 2005 16:00:54 -0000 1.24 --- nsd.h 22 Jul 2005 06:41:28 -0000 1.25 *************** *** 932,937 **** extern void NsClosePreBound(void); extern void NsInitServer(char *server, Ns_ServerInitProc *initProc); ! extern char *NsConfigRead(char *file); ! extern void NsConfigEval(char *config, int argc, char **argv, int optind); extern void NsConfUpdate(void); extern void NsEnableDNSCache(int timeout, int maxentries); --- 932,937 ---- extern void NsClosePreBound(void); extern void NsInitServer(char *server, Ns_ServerInitProc *initProc); ! extern char *NsConfigRead(CONST char *file); ! extern void NsConfigEval(CONST char *config, int argc, char **argv, int optind); extern void NsConfUpdate(void); extern void NsEnableDNSCache(int timeout, int maxentries); |
From: Vlad S. <ser...@us...> - 2005-07-21 14:46:13
|
Update of /cvsroot/naviserver/modules/nssnmp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2783 Modified Files: nssnmp.c Log Message: Index: nssnmp.c =================================================================== RCS file: /cvsroot/naviserver/modules/nssnmp/nssnmp.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** nssnmp.c 21 Jul 2005 14:40:19 -0000 1.5 --- nssnmp.c 21 Jul 2005 14:44:39 -0000 1.6 *************** *** 1766,1770 **** int slen = sizeof(struct sockaddr); #endif ! int start_time; int size = 56; char buf[4096]; --- 1766,1770 ---- int slen = sizeof(struct sockaddr); #endif ! time_t start_time; int size = 56; char buf[4096]; *************** *** 2012,2015 **** --- 2012,2018 ---- * * $Log$ + * Revision 1.6 2005/07/21 14:44:39 seryakov + * *** empty log message *** + * * Revision 1.5 2005/07/21 14:40:19 seryakov * fixed bug in ns_ping |
From: Vlad S. <ser...@us...> - 2005-07-21 14:40:46
|
Update of /cvsroot/naviserver/modules/nssnmp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1545 Modified Files: ChangeLog nssnmp.c Log Message: fixed bug in ns_ping Index: nssnmp.c =================================================================== RCS file: /cvsroot/naviserver/modules/nssnmp/nssnmp.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** nssnmp.c 12 Jun 2005 22:34:24 -0000 1.4 --- nssnmp.c 21 Jul 2005 14:40:19 -0000 1.5 *************** *** 1746,1750 **** Server *server = (Server*)arg; if (argc < 2) { ! Tcl_AppendResult(interp, "wrong # args: should be \"",argv[0], " host","\"", NULL); return TCL_ERROR; } --- 1746,1750 ---- Server *server = (Server*)arg; if (argc < 2) { ! Tcl_AppendResult(interp, "wrong # args: should be \"",argv[0], " host","\" ?-timeout n? ?-debug 0|1? ?-count n? ?-size n?", NULL); return TCL_ERROR; } *************** *** 1766,1769 **** --- 1766,1770 ---- int slen = sizeof(struct sockaddr); #endif + int start_time; int size = 56; char buf[4096]; *************** *** 1799,1802 **** --- 1800,1804 ---- if((id = ++server->icmp.id) > 65535) id = 1; Ns_MutexUnlock(&server->icmp.mutex); + start_time = time(0); for(i = 0; i < count;i++) { *************** *** 1820,1823 **** --- 1822,1827 ---- retry_count = 0; again: + // Check the total time we spent pinging + if(time(0) - start_time > timeout) break; FD_ZERO(&fds); FD_SET(fd,&fds); *************** *** 2008,2011 **** --- 2012,2018 ---- * * $Log$ + * Revision 1.5 2005/07/21 14:40:19 seryakov + * fixed bug in ns_ping + * * Revision 1.4 2005/06/12 22:34:24 seryakov * compiler warnings silence Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/modules/nssnmp/ChangeLog,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ChangeLog 9 Jun 2005 21:31:30 -0000 1.2 --- ChangeLog 21 Jul 2005 14:40:19 -0000 1.3 *************** *** 1,2 **** --- 1,6 ---- + 2005-07-21 Vlad Seryakov vl...@cr... + + * fixed timeout bug in ns_ping + 2005-06-09 Vlad Seryakov vl...@cr... |
From: Stephen D. <sd...@us...> - 2005-07-21 10:44:42
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14639/tests Added Files: http_chunked.test Removed Files: ns_adp_chunked.test Log Message: * tests/ns_adp_chunked.test: * tests/http_chunked.test: Rename tests which handle both Tcl and ADP. Add some more tests which highlight a few bugs. * tests/testserver/pages/ns_adp_chunked.tcl: * tests/testserver/pages/http_chunked.adp: Rename file. Handle streaming and non-streaming situations, and actually write out the data in two goes. Add a workaround for a bug in the ns_conn chunked switch: detect whether client is HTTP/1.1 and therefore handles chunked encoding. This needs to disappear altogether. * tests/testserver/pages/ns_tcl_chunked.tcl: Incorporate code directly into test file using ns_register_proc. --- NEW FILE: http_chunked.test --- # # 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" # 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/tests/http_chunked.test,v 1.1 2005/07/21 10:43:09 sdeasey Exp $ # package require tcltest 2.2 namespace import -force ::tcltest::* eval ::tcltest::configure $argv if {[ns_config test listenport]} { testConstraint serverListen true } test http_chunked-1.1 {adp streaming w/chunks to HTTP/1.1 client} -constraints serverListen -body { nstest_http -http 1.1 -getheaders {Transfer-Encoding Content-Length} -getbody t \ GET /http_chunked.adp?stream=1 } -result "200 chunked {} {a\r\n0123456789\r\n5\r\n01234\r\n0\r\n\r\n}" test http_chunked-1.2 {adp with buffered response} -constraints { serverListen knownBug } -body { nstest_http -http 1.1 -getheaders {Transfer-Encoding Content-Length} -getbody t \ GET /http_chunked.adp?stream=0 } -result {200 {} 15 012345678901234} test http_chunked-1.3 {adp streaming to HTTP/1.0 client} -constraints serverListen -body { nstest_http -setheaders {Connection keep-alive} \ -getheaders {Transfer-Encoding Connection Content-Length} -getbody t \ GET /http_chunked.adp?stream=1 } -result {200 {} close {} 012345678901234} test http_chunked-2.1 {Tcl streaming w/chunks to HTTP/1.1 client} -constraints serverListen -setup { ns_register_proc GET /tclchunked { ns_conn chunked 1 ;# remove this explicit call ns_headers 200 text/plain ns_write 0123456789 ns_write 01234 ;#} } -body { nstest_http -http 1.1 -getheaders {Transfer-Encoding Content-Length} -getbody 1 \ GET /tclchunked } -cleanup { ns_unregister_proc GET /tclchunked } -result "200 chunked {} {a\r\n0123456789\r\n5\r\n01234\r\n0\r\n\r\n}" test http_chunked-2.2 {Tcl streaming to HTTP/1.0 client} -constraints serverListen -setup { ns_register_proc GET /tclchunked { ns_headers 200 text/plain ns_write 0123456789 ns_write 01234 ;#} } -body { nstest_http -http 1.1 -getheaders {Transfer-Encoding Content-Length} -getbody 1 \ GET /tclchunked } -cleanup { ns_unregister_proc GET /tclchunked } -result {200 {} {} 012345678901234} test http_chunked-2.3 {Tcl response of known size to HTTP/1.1 client} -constraints serverListen -setup { ns_register_proc GET /tclchunked {ns_return 200 text/plain 01234 ;#} } -body { nstest_http -http 1.1 -getheaders {Transfer-Encoding Content-Length} -getbody 1 \ GET /tclchunked } -cleanup { ns_unregister_proc GET /tclchunked } -result {200 {} 5 01234} cleanupTests --- ns_adp_chunked.test DELETED --- |