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: Zoran V. <vas...@us...> - 2005-10-21 10:12:07
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24033 Modified Files: ChangeLog Log Message: See file. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.232 retrieving revision 1.233 diff -C2 -d -r1.232 -r1.233 *** ChangeLog 21 Oct 2005 07:38:38 -0000 1.232 --- ChangeLog 21 Oct 2005 10:11:44 -0000 1.233 *************** *** 1,2 **** --- 1,8 ---- + 2005-10-21 Zoran Vasiljevic <vas...@us...> + + * nsd/tclcmds.c + * nsd/tclfile.c: re-born ns_normalizepath as C command + * tcl/compat.tcl: removed Tcl ns_normalizepath wrapper + 2005-10-21 Bernd Eidenschink <ei...@us...> |
From: Zoran V. <vas...@us...> - 2005-10-21 10:08:08
|
Update of /cvsroot/naviserver/naviserver/tcl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22962/tcl Modified Files: compat.tcl Log Message: Removed Tcl ns_normalizepath wrapper Index: compat.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/tcl/compat.tcl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** compat.tcl 8 Oct 2005 12:06:07 -0000 1.3 --- compat.tcl 21 Oct 2005 10:07:58 -0000 1.4 *************** *** 142,165 **** # - # ns_normalizepath -- - # - # Normalize the path. WATCH: this procedure is actually broken - # because it will normalize "a/b/c" to "/a/b/c" which is WRONG. - # This is because it mimics the broken Ns_NormalizePath C-API. - # - # Please use Tcl [file normalize] instead. This always return - # properly normalized absolute path, as expected. - # - - proc ns_normalizepath {path} { - if {[file pathtype $path] == "relative"} { - ns_log warning "normalizepath: $path; broken for relative paths" - ns_log warning "normalizepath: use \[file normalize\] instead" - set path /$path - } - file normalize $path - } - - # # ns_link -- # --- 142,145 ---- |
From: Zoran V. <vas...@us...> - 2005-10-21 10:07:34
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22857/nsd Modified Files: tclcmds.c tclfile.c Log Message: Re-born ns_normalizepath as C command Index: tclcmds.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclcmds.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tclcmds.c 21 Oct 2005 06:22:14 -0000 1.22 --- tclcmds.c 21 Oct 2005 10:07:26 -0000 1.23 *************** *** 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" *************** *** 106,109 **** --- 106,110 ---- NsTclModulePathObjCmd, NsTclMutexObjCmd, + NsTclNormalizePathObjCmd, NsTclNsvAppendObjCmd, NsTclNsvArrayObjCmd, *************** *** 279,282 **** --- 280,284 ---- {"ns_logctl", NULL, NsTclLogCtlObjCmd}, {"ns_logroll", NULL, NsTclLogRollObjCmd}, + {"ns_normalizepath", NULL, NsTclNormalizePathObjCmd}, {"ns_mktemp", NsTclMkTempCmd, NULL}, {"ns_modulepath", NULL, NsTclModulePathObjCmd}, *************** *** 378,381 **** --- 380,384 ---- {"ns_ictl", NULL, NsTclICtlObjCmd}, {"ns_library", NsTclLibraryCmd, NULL}, + {"ns_normalizepath", NULL, NsTclNormalizePathObjCmd}, {"ns_moduleload", NULL, NsTclModuleLoadObjCmd}, {"ns_puts", NULL, NsTclAdpPutsObjCmd}, Index: tclfile.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclfile.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tclfile.c 15 Oct 2005 14:47:52 -0000 1.8 --- tclfile.c 21 Oct 2005 10:07:26 -0000 1.9 *************** *** 551,554 **** --- 551,590 ---- return TCL_OK; } + + /* + *---------------------------------------------------------------------- + * + * NsTclNormalizePathObjCmd -- + * + * Implements ns_normalizepath as obj command. + * + * Results: + * Tcl result. + * + * Side effects: + * See docs. + * + *---------------------------------------------------------------------- + */ + + int + NsTclNormalizePathObjCmd(ClientData arg, Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[]) + { + Ns_DString ds; + + if (objc != 2) { + Tcl_WrongNumArgs(interp, 1, objv, "path"); + return TCL_ERROR; + } + + Ns_DStringInit(&ds); + Ns_NormalizePath(&ds, Tcl_GetString(objv[1])); + Tcl_SetObjResult(interp, Tcl_NewStringObj(Ns_DStringValue(&ds), + Ns_DStringLength(&ds))); + Ns_DStringFree(&ds); + + return TCL_OK; + } |
From: Bernd E. <ei...@us...> - 2005-10-21 07:38:48
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23477/tests Modified Files: ns_info.test Log Message: See ChangeLog Index: ns_info.test =================================================================== RCS file: /cvsroot/naviserver/naviserver/tests/ns_info.test,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ns_info.test 20 Oct 2005 17:02:45 -0000 1.1 --- ns_info.test 21 Oct 2005 07:38:38 -0000 1.2 *************** *** 132,139 **** "-driver-" - "-sched-" - ! "-main-" {} ! "default" { ! set expected_threads 1 ! } } } --- 132,137 ---- "-driver-" - "-sched-" - ! "-main-" { set expected_threads 1 } ! "default" {} } } |
From: Bernd E. <ei...@us...> - 2005-10-21 07:38:48
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23477 Modified Files: ChangeLog Log Message: See ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.231 retrieving revision 1.232 diff -C2 -d -r1.231 -r1.232 *** ChangeLog 21 Oct 2005 07:03:29 -0000 1.231 --- ChangeLog 21 Oct 2005 07:38:38 -0000 1.232 *************** *** 1,2 **** --- 1,7 ---- + 2005-10-21 Bernd Eidenschink <ei...@us...> + + * tests/images/: re-added files as binaries. + * tests/ns_info.test: minor fix for test 2.27.1 + 2005-10-20 Stephen Deasey <sd...@us...> |
Update of /cvsroot/naviserver/naviserver/tests/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20061 Added Files: broken.gif broken.jpg color5x200.gif color5x200.jpg color5x200_progressive.jpg empty.gif empty.jpg small.gif Log Message: re-adding files with -kb option --- NEW FILE: color5x200.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: color5x200_progressive.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: small.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: color5x200.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: empty.jpg --- --- NEW FILE: empty.gif --- --- NEW FILE: broken.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: broken.jpg --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/naviserver/naviserver/tests/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19010 Removed Files: broken.gif broken.jpg color5x200.gif color5x200.jpg color5x200_progressive.jpg empty.gif empty.jpg small.gif Log Message: removed prior to re-import as binary files --- color5x200.jpg DELETED --- --- color5x200_progressive.jpg DELETED --- --- small.gif DELETED --- --- color5x200.gif DELETED --- --- empty.jpg DELETED --- --- empty.gif DELETED --- --- broken.gif DELETED --- --- broken.jpg DELETED --- |
From: Stephen D. <sd...@us...> - 2005-10-21 07:03:37
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16412 Modified Files: ChangeLog Log Message: Add tracker RFE numbers to fixes. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.230 retrieving revision 1.231 diff -C2 -d -r1.230 -r1.231 *** ChangeLog 21 Oct 2005 06:50:11 -0000 1.230 --- ChangeLog 21 Oct 2005 07:03:29 -0000 1.231 *************** *** 186,189 **** --- 186,190 ---- from the init.tcl bootstrap. Policy about where modules are located and when they are loaded is now easily accessible to Tcl. + (RFE# 1244177) * nsd/tclcallbacks.c: * nsd/tclmisc.c: *************** *** 248,253 **** * nsd/log.c: "before-tclvfs" in order to simplify backoff * nsd/modload.c: if needed. ! * nsd/nsconf.c: ! * nsd/nsmain.c: * nsd/pidfile.c: * nsd/rollfile.c: --- 249,254 ---- * nsd/log.c: "before-tclvfs" in order to simplify backoff * nsd/modload.c: if needed. ! * nsd/nsconf.c: ! * nsd/nsmain.c: (RFE# 1202462 * nsd/pidfile.c: * nsd/rollfile.c: |
From: Stephen D. <sd...@us...> - 2005-10-21 06:50:20
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13973 Modified Files: ChangeLog Log Message: * nsd/modload.c (Ns_ModuleLoad): Although the first two arguments to Ns_ModuleLoad are called server and module, they're really just two arbitrary strings passed to the module. The nsdb module for examples passes the driver name and configuration path. For this reason we cannot realy on knowing the current virtual server and so cannot allocate an interp from the per-thread cache. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.229 retrieving revision 1.230 diff -C2 -d -r1.229 -r1.230 *** ChangeLog 21 Oct 2005 06:22:14 -0000 1.229 --- ChangeLog 21 Oct 2005 06:50:11 -0000 1.230 *************** *** 1,4 **** --- 1,11 ---- 2005-10-20 Stephen Deasey <sd...@us...> + * nsd/modload.c (Ns_ModuleLoad): Although the first two arguments + to Ns_ModuleLoad are called server and module, they're really just + two arbitrary strings passed to the module. The nsdb module for + examples passes the driver name and configuration path. For this + reason we cannot realy on knowing the current virtual server and + so cannot allocate an interp from the per-thread cache. + * include/ns.h: * nsd/tclobj.c: Generalise the ns_thread routines for wrapping a C |
From: Stephen D. <sd...@us...> - 2005-10-21 06:50:20
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13973/nsd Modified Files: modload.c Log Message: * nsd/modload.c (Ns_ModuleLoad): Although the first two arguments to Ns_ModuleLoad are called server and module, they're really just two arbitrary strings passed to the module. The nsdb module for examples passes the driver name and configuration path. For this reason we cannot realy on knowing the current virtual server and so cannot allocate an interp from the per-thread cache. Index: modload.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/modload.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** modload.c 9 Oct 2005 22:27:24 -0000 1.7 --- modload.c 21 Oct 2005 06:50:11 -0000 1.8 *************** *** 159,167 **** } ! interp = Ns_TclAllocateInterp(server); ! if (interp == NULL) { ! Ns_Log(Error, "modload: invalid server name: '%s'", server); ! return NS_ERROR; ! } status = Tcl_FSLoadFile(interp, pathObj, init, "Ns_ModuleVersion", &tclInitProc, &tclVerProc, &lh, &uPtr); --- 159,163 ---- } ! interp = Tcl_CreateInterp(); status = Tcl_FSLoadFile(interp, pathObj, init, "Ns_ModuleVersion", &tclInitProc, &tclVerProc, &lh, &uPtr); *************** *** 169,176 **** if (status != TCL_OK) { Ns_Log(Error, "modload: %s: %s", file, Tcl_GetStringResult(interp)); ! Ns_TclDeAllocateInterp(interp); return NS_ERROR; } ! Ns_TclDeAllocateInterp(interp); initProc = (Ns_ModuleInitProc *) tclInitProc; --- 165,172 ---- if (status != TCL_OK) { Ns_Log(Error, "modload: %s: %s", file, Tcl_GetStringResult(interp)); ! Tcl_DeleteInterp(interp); return NS_ERROR; } ! Tcl_DeleteInterp(interp); initProc = (Ns_ModuleInitProc *) tclInitProc; |
From: Stephen D. <sd...@us...> - 2005-10-21 06:22:23
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8676/nsd Modified Files: tclcmds.c tclobj.c tclthread.c Log Message: * include/ns.h: * nsd/tclobj.c: Generalise the ns_thread routines for wrapping a C structs with a Tcl obj handle. Slighlty enhanced: also allows wrapping of statically allocated C structs which always have a direct string name -> struct relationship. * nsd/tclcmds.c: * nsd/tclthread.c: Convert to Tcl objects, remove some duplicated code and convert to the new ns:addr Tcl object type interface. * tests/ns_thread.test: Exercise the ns_thread command and the new ns:addr Tcl object type. Index: tclobj.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclobj.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tclobj.c 12 Jul 2005 08:26:05 -0000 1.5 --- tclobj.c 21 Oct 2005 06:22:14 -0000 1.6 *************** *** 40,43 **** --- 40,85 ---- + /* + * Local functions defined in this file. + */ + + static Tcl_UpdateStringProc UpdateStringOfAddr; + static Tcl_SetFromAnyProc SetAddrFromAny; + + /* + * Local variables defined in this file. + */ + + static Tcl_ObjType addrType = { + "ns:addr", + (Tcl_FreeInternalRepProc *) NULL, + (Tcl_DupInternalRepProc *) NULL, + UpdateStringOfAddr, + SetAddrFromAny + }; + + + /* + *---------------------------------------------------------------------- + * + * NsTclInitAddrType -- + * + * Initialize the Tcl address object type. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + void + NsTclInitAddrType(void) + { + Tcl_RegisterObjType(&addrType); + } + /* *************** *** 150,151 **** --- 192,404 ---- } + + + /* + *---------------------------------------------------------------------- + * + * Ns_TclSetFromAnyError -- + * + * This procedure is registered as the setFromAnyProc for an + * object type when it doesn't make sense to generate it's internal + * form from the string representation alone. + * + * Results: + * The return value is always TCL_ERROR, and an error message is + * left in interp's result if interp isn't NULL. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + int + Ns_TclSetFromAnyError(Tcl_Interp *interp, Tcl_Obj *objPtr) + { + Tcl_AppendToObj(Tcl_GetObjResult(interp), + "can't convert value to requested type except via prescribed API", + -1); + return TCL_ERROR; + } + + + /* + *---------------------------------------------------------------------- + * + * Ns_TclGetAddrFromObj -- + * + * Return the internal pointer of an address Tcl_Obj. + * + * Results: + * TCL_OK or TCL_ERROR if conversion failed or not the correct type. + * + * Side effects: + * Object may be converted to address type. + * + *---------------------------------------------------------------------- + */ + + int + Ns_TclGetAddrFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, + CONST char *type, void **addrPtrPtr) + { + if (Tcl_ConvertToType(interp, objPtr, &addrType) != TCL_OK) { + return TCL_ERROR; + } + if (objPtr->internalRep.twoPtrValue.ptr1 != (void *) type) { + Tcl_AppendResult(interp, "incorrect type: ", Tcl_GetString(objPtr), NULL); + return TCL_ERROR; + } + *addrPtrPtr = objPtr->internalRep.twoPtrValue.ptr2; + + return TCL_OK; + } + + + /* + *---------------------------------------------------------------------- + * + * Ns_TclSetAddrObj -- + * + * Convert the given object to the ns:addr type. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + void + Ns_TclSetAddrObj(Tcl_Obj *objPtr, CONST char *type, void *addr) + { + if (Tcl_IsShared(objPtr)) { + Tcl_Panic("Ns_TclSetAddrObj called with shared object"); + } + Ns_TclSetTwoPtrValue(objPtr, &addrType, (void *) type, addr); + Tcl_InvalidateStringRep(objPtr); + } + + + /* + *---------------------------------------------------------------------- + * + * Ns_TclGetOpaqueFromObj -- + * + * Get the internal pointer of an address Tcl_Obj. + * + * Results: + * TCL_OK or TCL_ERROR if object was not of the ns:addr type. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + int + Ns_TclGetOpaqueFromObj(Tcl_Obj *objPtr, CONST char *type, void **addrPtrPtr) + { + if (objPtr->typePtr != &addrType + || objPtr->internalRep.twoPtrValue.ptr1 != (void *) type) { + return TCL_ERROR; + } + *addrPtrPtr = objPtr->internalRep.twoPtrValue.ptr2; + + return TCL_OK; + } + + + /* + *---------------------------------------------------------------------- + * + * Ns_TclSetOpaqueObj -- + * + * Convert the given object to the ns:addr type without + * invalidating the current string rep. It is OK if the object + * is shared. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + void + Ns_TclSetOpaqueObj(Tcl_Obj *objPtr, CONST char *type, void *addr) + { + Ns_TclSetTwoPtrValue(objPtr, &addrType, (void *) type, addr); + } + + + /* + *---------------------------------------------------------------------- + * + * UpdateStringOfAddr -- + * + * Update the string representation for an address object. + * Note: This procedure does not free an existing old string rep + * so storage will be lost if this has not already been done. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + static void + UpdateStringOfAddr(Tcl_Obj *objPtr) + { + void *type = objPtr->internalRep.twoPtrValue.ptr1; + void *addr = objPtr->internalRep.twoPtrValue.ptr2; + char buf[128]; + size_t len; + + len = snprintf(buf, sizeof(buf), "t%p a%p %s", + type, addr, (char *) type); + Ns_TclSetStringRep(objPtr, buf, len); + } + + + /* + *---------------------------------------------------------------------- + * + * SetAddrFromAny -- + * + * Attempt to generate an address internal form for the Tcl object. + * + * Results: + * The return value is a standard Tcl result. If an error occurs + * during conversion, an error message is left in the interpreter's + * result unless interp is NULL. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + static int + SetAddrFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr) + { + void *type, *addr; + char *string; + + string = Tcl_GetString(objPtr); + if (sscanf(string, "t%p a%p", &type, &addr) != 2 + || type == NULL || addr == NULL) { + Tcl_AppendResult(interp, "invalid address \"", string, "\"", NULL); + return TCL_ERROR; + } + Ns_TclSetTwoPtrValue(objPtr, &addrType, type, addr); + + return TCL_OK; + } Index: tclcmds.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclcmds.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tclcmds.c 9 Oct 2005 22:27:24 -0000 1.21 --- tclcmds.c 21 Oct 2005 06:22:14 -0000 1.22 *************** *** 168,171 **** --- 168,172 ---- NsTclStrftimeObjCmd, NsTclSymlinkObjCmd, + NsTclThreadObjCmd, NsTclTimeObjCmd, NsTclTmpNamObjCmd, *************** *** 205,209 **** NsTclShareCmd, NsTclStripHtmlCmd, - NsTclThreadCmd, TclX_KeyldelObjCmd, TclX_KeylgetObjCmd, --- 206,209 ---- *************** *** 316,320 **** {"ns_striphtml", NsTclStripHtmlCmd, NULL}, {"ns_symlink", NULL, NsTclSymlinkObjCmd}, ! {"ns_thread", NsTclThreadCmd, NULL}, {"ns_time", NULL, NsTclTimeObjCmd}, {"ns_tmpnam", NULL, NsTclTmpNamObjCmd}, --- 316,320 ---- {"ns_striphtml", NsTclStripHtmlCmd, NULL}, {"ns_symlink", NULL, NsTclSymlinkObjCmd}, ! {"ns_thread", NULL, NsTclThreadObjCmd}, {"ns_time", NULL, NsTclTimeObjCmd}, {"ns_tmpnam", NULL, NsTclTmpNamObjCmd}, Index: tclthread.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclthread.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tclthread.c 30 Jul 2005 04:06:02 -0000 1.5 --- tclthread.c 21 Oct 2005 06:22:14 -0000 1.6 *************** *** 32,36 **** * tclthread.c -- * ! * Tcl wrappers around all thread objects */ --- 32,36 ---- * tclthread.c -- * ! * Tcl wrappers around all thread objects */ [...1495 lines suppressed...] ! if (Tcl_GetIndexFromObj(interp, objv[1], opts, "option", 0, &opt) != TCL_OK) { ! return TCL_ERROR; } ! if (opt == createOpt) { ! addr = ns_malloc(sizeof(void *)); ! Ns_TclSetAddrObj(Tcl_GetObjResult(interp), type, addr); } else { if (objc < 3) { ! Tcl_WrongNumArgs(interp, 2, objv, "object"); ! return TCL_ERROR; ! } ! if (Ns_TclGetAddrFromObj(interp, objv[2], type, &addr) != TCL_OK) { ! return TCL_ERROR; ! } } *addrPtr = addr; *optPtr = opt; return TCL_OK; } |
From: Stephen D. <sd...@us...> - 2005-10-21 06:22:23
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8676/tests Added Files: ns_thread.test Log Message: * include/ns.h: * nsd/tclobj.c: Generalise the ns_thread routines for wrapping a C structs with a Tcl obj handle. Slighlty enhanced: also allows wrapping of statically allocated C structs which always have a direct string name -> struct relationship. * nsd/tclcmds.c: * nsd/tclthread.c: Convert to Tcl objects, remove some duplicated code and convert to the new ns:addr Tcl object type interface. * tests/ns_thread.test: Exercise the ns_thread command and the new ns:addr Tcl object type. --- NEW FILE: ns_thread.test --- # # $Header: /cvsroot/naviserver/naviserver/tests/ns_thread.test,v 1.1 2005/10/21 06:22:15 sdeasey Exp $ # package require tcltest 2.2 namespace import -force ::tcltest::* eval ::tcltest::configure $argv test ns_thread-1.1 {basic syntax} -body { ns_thread ? } -returnCodes error -result {bad option "?": must be begin, begindetached, create, wait, join, name, get, getid, id, or yield} test ns_thread-1.2 {basic syntax} -body { ns_mutex ? } -returnCodes error -result {bad option "?": must be create, destroy, lock, or unlock} test ns_thread-1.3 {basic syntax} -body { ns_critsec ? } -returnCodes error -result {bad option "?": must be create, destroy, enter, or leave} test ns_thread-1.4 {basic syntax} -body { ns_sema ? } -returnCodes error -result {bad option "?": must be create, destroy, release, or wait} test ns_thread-1.5 {basic syntax} -body { ns_cond ? } -returnCodes error -result {bad option "?": must be abswait, broadcast, create, destroy, set, signal, or wait} test ns_thread-1.6 {basic syntax} -body { ns_rwlock ? } -returnCodes error -result {bad option "?": must be create, destroy, readlock, readunlock, writelock, writeunlock, or unlock} test ns_thread-2.1 {detached thread} -body { ns_thread begindetached {return ok} } -result {} test ns_thread-2.2 {wait for thread thread} -body { set tid [ns_thread begin {return ok}] set result [ns_thread wait $tid] list $tid $result } -cleanup { unset -nocomplain -- tid result } -match regexp -result {{t0x[a-z0-9]+ a0x[a-z0-9]+ ns:thread} ok} test ns_thread-2.3 {get thread id of self} -body { ns_thread id } -match regexp -result {.[0-9]+} test ns_thread-2.4 {thread name} -body { ns_thread wait [ns_thread create {ns_thread name threadtest}] } -result {threadtest} test ns_thread-2.5 {thread yield} -body { for {set i 0} {$i < 100} {incr i} { ns_thread begindetached { for {set i 0} {$i < 100} {incr i} { set x y ns_thread yield } } } } -cleanup { unset -nocomplain -- i } -result {} test ns_thread-3.1 {create and destroy a mutex} -body { set mutex [ns_mutex create] ns_mutex destroy $mutex set mutex } -cleanup { unset -nocomplain -- mutex } -match regexp -result {t0x[a-z0-9]+ a0x[a-z0-9]+ ns:mutex} test ns_thread-3.2 {mutex locking} -body { set mutex [ns_mutex create] ns_mutex lock $mutex ns_mutex unlock $mutex ns_mutex destroy $mutex } -cleanup { unset -nocomplain -- mutex } -result {} test ns_thread-4.1 {create and destroy a critical section} -body { set cs [ns_critsec create] ns_critsec destroy $cs set cs } -cleanup { unset -nocomplain -- cs } -match regexp -result {t0x[a-z0-9]+ a0x[a-z0-9]+ ns:critsec} test ns_thread-4.2 {enter and then leave a critical section} -body { set cs [ns_critsec create] ns_critsec enter $cs ns_critsec leave $cs ns_critsec destroy $cs } -cleanup { unset -nocomplain -- cs } -result {} test ns_thread-5.1 {create and destroy a semaphore} -body { set sema [ns_sema create] ns_sema destroy $sema set sema } -cleanup { unset -nocomplain -- sema } -match regexp -result {t0x[a-z0-9]+ a0x[a-z0-9]+ ns:sema} test ns_thread-6.1 {create and destroy a read-write lock} -body { set rw [ns_rwlock create] ns_rwlock destroy $rw set rw } -cleanup { unset -nocomplain -- rw } -match regexp -result {t0x[a-z0-9]+ a0x[a-z0-9]+ ns:rwlock} test ns_thread-6.2 {read lock} -body { set rw [ns_rwlock create] ns_rwlock readlock $rw ns_rwlock unlock $rw ns_rwlock destroy $rw } -cleanup { unset -nocomplain -- rw } -result {} test ns_thread-6.2 {write lock} -body { set rw [ns_rwlock create] ns_rwlock writelock $rw ns_rwlock unlock $rw ns_rwlock destroy $rw } -cleanup { unset -nocomplain -- rw } -result {} cleanupTests |
From: Stephen D. <sd...@us...> - 2005-10-21 06:22:22
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8676 Modified Files: ChangeLog Log Message: * include/ns.h: * nsd/tclobj.c: Generalise the ns_thread routines for wrapping a C structs with a Tcl obj handle. Slighlty enhanced: also allows wrapping of statically allocated C structs which always have a direct string name -> struct relationship. * nsd/tclcmds.c: * nsd/tclthread.c: Convert to Tcl objects, remove some duplicated code and convert to the new ns:addr Tcl object type interface. * tests/ns_thread.test: Exercise the ns_thread command and the new ns:addr Tcl object type. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.228 retrieving revision 1.229 diff -C2 -d -r1.228 -r1.229 *** ChangeLog 21 Oct 2005 05:58:18 -0000 1.228 --- ChangeLog 21 Oct 2005 06:22:14 -0000 1.229 *************** *** 1,4 **** --- 1,15 ---- 2005-10-20 Stephen Deasey <sd...@us...> + * include/ns.h: + * nsd/tclobj.c: Generalise the ns_thread routines for wrapping a C + structs with a Tcl obj handle. Slighlty enhanced: also allows + wrapping of statically allocated C structs which always have a direct + string name -> struct relationship. + * nsd/tclcmds.c: + * nsd/tclthread.c: Convert to Tcl objects, remove some duplicated + code and convert to the new ns:addr Tcl object type interface. + * tests/ns_thread.test: Exercise the ns_thread command and the + new ns:addr Tcl object type. + * nsdbtest/nsdbtest.c: Remove unused function declaration. |
From: Stephen D. <sd...@us...> - 2005-10-21 06:22:22
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8676/include Modified Files: ns.h Log Message: * include/ns.h: * nsd/tclobj.c: Generalise the ns_thread routines for wrapping a C structs with a Tcl obj handle. Slighlty enhanced: also allows wrapping of statically allocated C structs which always have a direct string name -> struct relationship. * nsd/tclcmds.c: * nsd/tclthread.c: Convert to Tcl objects, remove some duplicated code and convert to the new ns:addr Tcl object type interface. * tests/ns_thread.test: Exercise the ns_thread command and the new ns:addr Tcl object type. Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** ns.h 20 Oct 2005 18:30:41 -0000 1.54 --- ns.h 21 Oct 2005 06:22:14 -0000 1.55 *************** *** 1010,1019 **** */ ! NS_EXTERN void Ns_TclResetObjType(Tcl_Obj *objPtr, Tcl_ObjType *newTypePtr); ! NS_EXTERN void Ns_TclSetTwoPtrValue(Tcl_Obj *objPtr, Tcl_ObjType *newTypePtr, ! void *ptr1, void *ptr2); ! NS_EXTERN void Ns_TclSetOtherValuePtr(Tcl_Obj *objPtr, Tcl_ObjType *newTypePtr, ! void *value); ! NS_EXTERN void Ns_TclSetStringRep(Tcl_Obj *objPtr, char *bytes, int length); /* --- 1010,1043 ---- */ ! NS_EXTERN void ! Ns_TclResetObjType(Tcl_Obj *objPtr, Tcl_ObjType *newTypePtr); ! ! NS_EXTERN void ! Ns_TclSetTwoPtrValue(Tcl_Obj *objPtr, Tcl_ObjType *newTypePtr, ! void *ptr1, void *ptr2); ! NS_EXTERN void ! Ns_TclSetOtherValuePtr(Tcl_Obj *objPtr, Tcl_ObjType *newTypePtr, void *value); ! ! NS_EXTERN void ! Ns_TclSetStringRep(Tcl_Obj *objPtr, char *bytes, int length); ! ! NS_EXTERN int ! Ns_TclGetAddrFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, ! CONST char *type, void **addrPtrPtr) ! NS_GNUC_NONNULL(2) NS_GNUC_NONNULL(3) NS_GNUC_NONNULL(4); ! ! NS_EXTERN void ! Ns_TclSetAddrObj(Tcl_Obj *objPtr, CONST char *type, void *addr) ! NS_GNUC_NONNULL(1) NS_GNUC_NONNULL(2) NS_GNUC_NONNULL(3); ! ! NS_EXTERN int ! Ns_TclGetOpaqueFromObj(Tcl_Obj *objPtr, CONST char *type, void **addrPtrPtr) ! NS_GNUC_NONNULL(1) NS_GNUC_NONNULL(2) NS_GNUC_NONNULL(3); ! ! NS_EXTERN void ! Ns_TclSetOpaqueObj(Tcl_Obj *objPtr, CONST char *type, void *addr) ! NS_GNUC_NONNULL(1) NS_GNUC_NONNULL(2) NS_GNUC_NONNULL(3); ! ! NS_EXTERN Tcl_SetFromAnyProc Ns_TclSetFromAnyError; /* |
From: Stephen D. <sd...@us...> - 2005-10-21 05:58:26
|
Update of /cvsroot/naviserver/naviserver/nsdbtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4609/nsdbtest Modified Files: nsdbtest.c Log Message: * nsdbtest/nsdbtest.c: Remove unused function declaration. Index: nsdbtest.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsdbtest/nsdbtest.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** nsdbtest.c 20 Oct 2005 23:38:15 -0000 1.1 --- nsdbtest.c 21 Oct 2005 05:58:18 -0000 1.2 *************** *** 51,57 **** static int ResetHandle(Ns_DbHandle *handle); - static void SetTransactionState(Ns_DbHandle *handle, char *sql); - - /* * Local variables defined in this file. --- 51,54 ---- |
From: Stephen D. <sd...@us...> - 2005-10-21 05:58:26
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4609 Modified Files: ChangeLog Log Message: * nsdbtest/nsdbtest.c: Remove unused function declaration. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.227 retrieving revision 1.228 diff -C2 -d -r1.227 -r1.228 *** ChangeLog 21 Oct 2005 05:39:12 -0000 1.227 --- ChangeLog 21 Oct 2005 05:58:18 -0000 1.228 *************** *** 1,7 **** ! 2005-10-20 Stephen Deasey <sd...@gr...> ! * nsd/tclinit.c (Ns_TclRegisterTrace): Remove debug logging code. ! 2005-10-20 Stephen Deasey <sd...@us...> * nsd/nsd.h: --- 1,7 ---- ! 2005-10-20 Stephen Deasey <sd...@us...> ! * nsdbtest/nsdbtest.c: Remove unused function declaration. ! * nsd/tclinit.c (Ns_TclRegisterTrace): Remove debug logging code. * nsd/nsd.h: |
From: Stephen D. <sd...@us...> - 2005-10-21 05:39:24
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1864 Modified Files: ChangeLog Log Message: * nsd/tclinit.c (Ns_TclRegisterTrace): Remove debug logging code. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.226 retrieving revision 1.227 diff -C2 -d -r1.226 -r1.227 *** ChangeLog 21 Oct 2005 05:25:36 -0000 1.226 --- ChangeLog 21 Oct 2005 05:39:12 -0000 1.227 *************** *** 1,2 **** --- 1,6 ---- + 2005-10-20 Stephen Deasey <sd...@gr...> + + * nsd/tclinit.c (Ns_TclRegisterTrace): Remove debug logging code. + 2005-10-20 Stephen Deasey <sd...@us...> |
From: Stephen D. <sd...@us...> - 2005-10-21 05:39:08
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1831 Modified Files: tclinit.c Log Message: * nsd/tclinit.c (Ns_TclRegisterTrace): Remove debug logging code. Index: tclinit.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclinit.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tclinit.c 21 Oct 2005 05:25:36 -0000 1.13 --- tclinit.c 21 Oct 2005 05:38:56 -0000 1.14 *************** *** 500,506 **** Tcl_Interp *interp; - Ns_Log(Warning, "Ns_TclTraceCreate[%s]: %d", - server, when); - servPtr = NsGetServer(server); if (servPtr == NULL) { --- 500,503 ---- |
From: Stephen D. <sd...@us...> - 2005-10-21 05:25:52
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32050/tests Modified Files: test.nscfg Added Files: ns_accesslog.test Log Message: * nsd/nsd.h: * nsd/tclinit.c (Ns_TclTraceCreate): Run CREATE traces as they are registered in order to make Tcl comamnds registered by binary module available to the boot script and Tcl module files. * nsd/init.tcl: Rename use of depraciated api. * nsdb/db.h: * nsdb/nsdb.c: * nsdb/dbtcl.c: Fix bug where Ns_TclRegisterTrace was being called after server startup. * tests/test.nscfg: * tests/ns_accesslog.test: Add stub tests for the nslog module. --- NEW FILE: ns_accesslog.test --- # # $Header: /cvsroot/naviserver/naviserver/tests/ns_accesslog.test,v 1.1 2005/10/21 05:25:36 sdeasey Exp $ # package require tcltest 2.2 namespace import -force ::tcltest::* eval ::tcltest::configure $argv test ns_log-1.1 {basic syntax} -body { ns_accesslog } -returnCodes error -result {wrong # args: should be "ns_accesslog option ?arg ...?"} test ns_log-1.2 {basic syntax} -body { ns_accesslog ? } -returnCodes error -result {bad option "?": must be rollfmt, maxbackup, maxbuffer, extendedheaders, flags, file, or roll} cleanupTests Index: test.nscfg =================================================================== RCS file: /cvsroot/naviserver/naviserver/tests/test.nscfg,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test.nscfg 20 Oct 2005 23:38:15 -0000 1.6 --- test.nscfg 21 Oct 2005 05:25:36 -0000 1.7 *************** *** 76,79 **** --- 76,92 ---- ns_param library [ns_config "test" home]/testserver/modules + ns_section "ns/server/test/module/nslog" + ns_param file [ns_config "test" home]/testserver/access.log + ns_param formattedtime true + ns_param logcombined true + ns_param maxbuffer 0 + ns_param maxbackup 1 + ns_param rollhour 0 + ns_param rolllog false + ns_param rollonsignal false + ns_param suppressquery false + ns_param checkforproxy true + ns_param extendedheaders "X-Test" + ns_section "ns/server/test/adp" ns_param map *.adp *************** *** 89,92 **** --- 102,106 ---- ns_section "ns/server/test/modules" + ns_param nslog [ns_config "test" home]/../nslog/nslog.so ns_param nsdb [ns_config "test" home]/../nsdb/nsdb.so |
From: Stephen D. <sd...@us...> - 2005-10-21 05:25:51
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32050/nsd Modified Files: tclinit.c init.tcl Log Message: * nsd/nsd.h: * nsd/tclinit.c (Ns_TclTraceCreate): Run CREATE traces as they are registered in order to make Tcl comamnds registered by binary module available to the boot script and Tcl module files. * nsd/init.tcl: Rename use of depraciated api. * nsdb/db.h: * nsdb/nsdb.c: * nsdb/dbtcl.c: Fix bug where Ns_TclRegisterTrace was being called after server startup. * tests/test.nscfg: * tests/ns_accesslog.test: Add stub tests for the nslog module. Index: tclinit.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclinit.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tclinit.c 30 Jul 2005 03:35:11 -0000 1.12 --- tclinit.c 21 Oct 2005 05:25:36 -0000 1.13 *************** *** 477,481 **** * Ns_TclRegisterTrace -- * ! * Add an interp trace. Traces are called in FIFO order. * * Results: --- 477,483 ---- * Ns_TclRegisterTrace -- * ! * Add an interp trace. Traces are called in FIFO order. Valid ! * traces are: NS_TCL_TRACE... CREATE, DELETE, ALLOCATE, ! * DEALLOCATE, GETCONN, and FREECONN. * * Results: *************** *** 484,488 **** * * Side effects: ! * None. * *---------------------------------------------------------------------- --- 486,491 ---- * * Side effects: ! * CREATE and ALLOCATE traces are run immediately in the current ! * interp (the initial bootstrap interp). * *---------------------------------------------------------------------- *************** *** 493,503 **** void *arg, int when) { ! Trace *tracePtr, **firstPtrPtr; ! NsServer *servPtr; servPtr = NsGetServer(server); ! if (servPtr == NULL || Ns_InfoStarted()) { return NS_ERROR; } tracePtr = ns_malloc(sizeof(Trace)); tracePtr->proc = proc; --- 496,516 ---- void *arg, int when) { ! Trace *tracePtr, **nextPtrPtr; ! NsServer *servPtr; ! Tcl_Interp *interp; ! ! Ns_Log(Warning, "Ns_TclTraceCreate[%s]: %d", ! server, when); servPtr = NsGetServer(server); ! if (servPtr == NULL) { ! Ns_Log(Error, "Ns_TclRegisterTrace: Invalid server: %s", server); return NS_ERROR; } + if (Ns_InfoStarted()) { + Ns_Log(Error, "Can not register Tcl trace, server already started."); + return NS_ERROR; + } + tracePtr = ns_malloc(sizeof(Trace)); tracePtr->proc = proc; *************** *** 505,513 **** tracePtr->when = when; tracePtr->nextPtr = NULL; ! firstPtrPtr = &servPtr->tcl.firstTracePtr; ! while (*firstPtrPtr != NULL) { ! firstPtrPtr = &((*firstPtrPtr)->nextPtr); } - *firstPtrPtr = tracePtr; return NS_OK; --- 518,541 ---- tracePtr->when = when; tracePtr->nextPtr = NULL; ! ! nextPtrPtr = &servPtr->tcl.firstTracePtr; ! while (*nextPtrPtr != NULL) { ! nextPtrPtr = &((*nextPtrPtr)->nextPtr); ! } ! *nextPtrPtr = tracePtr; ! ! /* ! * Run CREATE and ALLOCATE traces immediately so that commands registered ! * by binary modules can be called by Tcl init scripts sourced by the ! * already initialised interp which loads the modules. ! */ ! ! if (when & NS_TCL_TRACE_CREATE || when & NS_TCL_TRACE_ALLOCATE) { ! interp = Ns_TclAllocateInterp(server); ! if ((*proc)(interp, arg) != TCL_OK) { ! Ns_TclLogError(interp); ! } ! Ns_TclDeAllocateInterp(interp); } return NS_OK; *************** *** 1628,1635 **** RunTraces(NsInterp *itPtr, int why) { ! Trace *tracePtr; ! if (itPtr->servPtr != NULL) { ! tracePtr = itPtr->servPtr->tcl.firstTracePtr; while (tracePtr != NULL) { if ((tracePtr->when & why)) { --- 1656,1664 ---- RunTraces(NsInterp *itPtr, int why) { ! Trace *tracePtr; ! NsServer *servPtr = itPtr->servPtr; ! if (servPtr != NULL) { ! tracePtr = servPtr->tcl.firstTracePtr; while (tracePtr != NULL) { if ((tracePtr->when & why)) { Index: init.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/init.tcl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** init.tcl 20 Oct 2005 17:56:17 -0000 1.5 --- init.tcl 21 Oct 2005 05:25:36 -0000 1.6 *************** *** 607,611 **** } else { if {$is_proc == ""} { ! ns_ictl oninit "rename $oldName $newName" } } --- 607,611 ---- } else { if {$is_proc == ""} { ! ns_ictl trace create "rename $oldName $newName" } } |
From: Stephen D. <sd...@us...> - 2005-10-21 05:25:51
|
Update of /cvsroot/naviserver/naviserver/nsdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32050/nsdb Modified Files: db.h nsdb.c dbtcl.c Log Message: * nsd/nsd.h: * nsd/tclinit.c (Ns_TclTraceCreate): Run CREATE traces as they are registered in order to make Tcl comamnds registered by binary module available to the boot script and Tcl module files. * nsd/init.tcl: Rename use of depraciated api. * nsdb/db.h: * nsdb/nsdb.c: * nsdb/dbtcl.c: Fix bug where Ns_TclRegisterTrace was being called after server startup. * tests/test.nscfg: * tests/ns_accesslog.test: Add stub tests for the nslog module. Index: db.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsdb/db.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db.h 12 Jul 2005 07:31:40 -0000 1.2 --- db.h 21 Oct 2005 05:25:36 -0000 1.3 *************** *** 35,39 **** extern void NsDbInitPools(void); extern void NsDbInitServer(char *server); ! extern Ns_TclTraceProc NsDbAddCmds; extern void NsDbClose(Ns_DbHandle *); extern void NsDbDisconnect(Ns_DbHandle *); --- 35,39 ---- extern void NsDbInitPools(void); extern void NsDbInitServer(char *server); ! extern Ns_TclTraceProc NsDbAddCmds, NsDbReleaseHandles; extern void NsDbClose(Ns_DbHandle *); extern void NsDbDisconnect(Ns_DbHandle *); Index: nsdb.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsdb/nsdb.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nsdb.c 12 Jul 2005 07:31:40 -0000 1.3 --- nsdb.c 21 Oct 2005 05:25:36 -0000 1.4 *************** *** 49,53 **** * * Results: ! * NS_OK. * * Side effects: --- 49,53 ---- * * Results: ! * NS_OK or NS_ERROR. * * Side effects: *************** *** 67,71 **** } NsDbInitServer(server); ! return Ns_TclRegisterTrace(server, NsDbAddCmds, server, ! NS_TCL_TRACE_CREATE); } --- 67,77 ---- } NsDbInitServer(server); ! if (Ns_TclRegisterTrace(server, NsDbAddCmds, server, ! NS_TCL_TRACE_CREATE) != NS_OK ! || Ns_TclRegisterTrace(server, NsDbReleaseHandles, NULL, ! NS_TCL_TRACE_DEALLOCATE) != NS_OK) { ! return NS_ERROR; ! } ! ! return NS_OK; } Index: dbtcl.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsdb/dbtcl.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dbtcl.c 12 Jul 2005 07:31:40 -0000 1.3 --- dbtcl.c 21 Oct 2005 05:25:36 -0000 1.4 *************** *** 60,64 **** static Tcl_CmdProc DbCmd, QuoteListToListCmd, GetCsvCmd, DbErrorCodeCmd, DbErrorMsgCmd, GetCsvCmd, DbConfigPathCmd, PoolDescriptionCmd; ! static Ns_TclTraceProc ReleaseDbs; static char *datakey = "nsdb:data"; --- 60,68 ---- static Tcl_CmdProc DbCmd, QuoteListToListCmd, GetCsvCmd, DbErrorCodeCmd, DbErrorMsgCmd, GetCsvCmd, DbConfigPathCmd, PoolDescriptionCmd; ! ! /* ! * Local variables defined in this file. ! */ ! static char *datakey = "nsdb:data"; *************** *** 122,126 **** Tcl_InitHashTable(&idataPtr->dbs, TCL_STRING_KEYS); Tcl_SetAssocData(interp, datakey, FreeData, idataPtr); - Ns_TclRegisterTrace(server, ReleaseDbs, NULL, NS_TCL_TRACE_DEALLOCATE); Tcl_CreateCommand(interp, "ns_db", DbCmd, idataPtr, NULL); --- 126,129 ---- *************** *** 139,142 **** --- 142,185 ---- /* *---------------------------------------------------------------------- + * NsDbReleaseHandles -- + * + * Release any database handles still held when an interp is + * deallocated. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + int + NsDbReleaseHandles(Tcl_Interp *interp, void *arg) + { + Ns_DbHandle *handlePtr; + Tcl_HashEntry *hPtr; + Tcl_HashSearch search; + InterpData *idataPtr; + + idataPtr = Tcl_GetAssocData(interp, datakey, NULL); + if (idataPtr != NULL) { + hPtr = Tcl_FirstHashEntry(&idataPtr->dbs, &search); + while (hPtr != NULL) { + handlePtr = Tcl_GetHashValue(hPtr); + Ns_DbPoolPutHandle(handlePtr); + hPtr = Tcl_NextHashEntry(&search); + } + Tcl_DeleteHashTable(&idataPtr->dbs); + Tcl_InitHashTable(&idataPtr->dbs, TCL_STRING_KEYS); + } + + return TCL_OK; + } + + + /* + *---------------------------------------------------------------------- * * DbCmd -- *************** *** 1044,1084 **** ns_free(idataPtr); } - - - /* - *---------------------------------------------------------------------- - * ReleaseDbs -- - * - * Release any database handles still held. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - - static int - ReleaseDbs(Tcl_Interp *interp, void *arg) - { - Ns_DbHandle *handlePtr; - Tcl_HashEntry *hPtr; - Tcl_HashSearch search; - InterpData *idataPtr; - - idataPtr = Tcl_GetAssocData(interp, datakey, NULL); - if (idataPtr != NULL) { - hPtr = Tcl_FirstHashEntry(&idataPtr->dbs, &search); - while (hPtr != NULL) { - handlePtr = Tcl_GetHashValue(hPtr); - Ns_DbPoolPutHandle(handlePtr); - hPtr = Tcl_NextHashEntry(&search); - } - Tcl_DeleteHashTable(&idataPtr->dbs); - Tcl_InitHashTable(&idataPtr->dbs, TCL_STRING_KEYS); - } - - return TCL_OK; - } --- 1087,1088 ---- |
From: Stephen D. <sd...@us...> - 2005-10-21 05:25:51
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32050 Modified Files: ChangeLog Log Message: * nsd/nsd.h: * nsd/tclinit.c (Ns_TclTraceCreate): Run CREATE traces as they are registered in order to make Tcl comamnds registered by binary module available to the boot script and Tcl module files. * nsd/init.tcl: Rename use of depraciated api. * nsdb/db.h: * nsdb/nsdb.c: * nsdb/dbtcl.c: Fix bug where Ns_TclRegisterTrace was being called after server startup. * tests/test.nscfg: * tests/ns_accesslog.test: Add stub tests for the nslog module. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.225 retrieving revision 1.226 diff -C2 -d -r1.225 -r1.226 *** ChangeLog 20 Oct 2005 23:38:15 -0000 1.225 --- ChangeLog 21 Oct 2005 05:25:36 -0000 1.226 *************** *** 1,4 **** --- 1,16 ---- 2005-10-20 Stephen Deasey <sd...@us...> + * nsd/nsd.h: + * nsd/tclinit.c (Ns_TclTraceCreate): Run CREATE traces as they are + registered in order to make Tcl comamnds registered by binary + module available to the boot script and Tcl module files. + * nsd/init.tcl: Rename use of depraciated api. + * nsdb/db.h: + * nsdb/nsdb.c: + * nsdb/dbtcl.c: Fix bug where Ns_TclRegisterTrace was being called + after server startup. + * tests/test.nscfg: + * tests/ns_accesslog.test: Add stub tests for the nslog module. + * Makefile: * nsdbtest/Makefile: |
From: Stephen D. <sd...@us...> - 2005-10-20 23:38:29
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28406/tests Modified Files: test.nscfg Added Files: nsdb.test Log Message: * Makefile: * nsdbtest/Makefile: * nsdbtest/nsdbtest.c: * tests/test.nscfg: * tests/nsdb.test: Implement a simple nsdb driver for testing and add the beginnings of some tests. Index: test.nscfg =================================================================== RCS file: /cvsroot/naviserver/naviserver/tests/test.nscfg,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test.nscfg 8 Jul 2005 18:18:13 -0000 1.5 --- test.nscfg 20 Oct 2005 23:38:15 -0000 1.6 *************** *** 84,87 **** --- 84,94 ---- ns_param minsize 0 + ns_section "ns/server/test/db" + ns_param pools a,b + ns_param defaultpool a + + ns_section "ns/server/test/modules" + ns_param nsdb [ns_config "test" home]/../nsdb/nsdb.so + *************** *** 124,125 **** --- 131,168 ---- ns_param initfile ../nsd/init.tcl ns_param library [ns_config "test" home]/testserver/modules + + + + # + # nsdb module testing. + # + + ns_section "ns/db/drivers" + ns_param nsdbtest [ns_config "test" home]/../nsdbtest/nsdbtest.so + + ns_section "ns/db/pools" + ns_param a A + ns_param b B + + ns_section "ns/db/pool/a" + ns_param verbose off + ns_param driver nsdbtest + ns_param connections 2 + ns_param user username + ns_param password password + ns_param logsqlerrors off + ns_param datasource datasource_poola + ns_param maxidle 1 + ns_param maxopen 1 + + ns_section "ns/db/pool/b" + ns_param verbose off + ns_param driver nsdbtest + ns_param connections 2 + ns_param user username + ns_param password password + ns_param logsqlerrors off + ns_param datasource datasource_poolb + ns_param maxidle 1 + ns_param maxopen 1 + --- NEW FILE: nsdb.test --- # # $Header: /cvsroot/naviserver/naviserver/tests/nsdb.test,v 1.1 2005/10/20 23:38:15 sdeasey Exp $ # package require tcltest 2.2 namespace import -force ::tcltest::* eval ::tcltest::configure $argv test ns_db-1.1 {basic syntax} -body { ns_db } -returnCodes error -result {wrong # of args: should be "ns_db command ?args ...?} cleanupTests |
From: Stephen D. <sd...@us...> - 2005-10-20 23:38:29
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28406 Modified Files: ChangeLog Makefile Log Message: * Makefile: * nsdbtest/Makefile: * nsdbtest/nsdbtest.c: * tests/test.nscfg: * tests/nsdb.test: Implement a simple nsdb driver for testing and add the beginnings of some tests. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.224 retrieving revision 1.225 diff -C2 -d -r1.224 -r1.225 *** ChangeLog 20 Oct 2005 18:30:41 -0000 1.224 --- ChangeLog 20 Oct 2005 23:38:15 -0000 1.225 *************** *** 1,2 **** --- 1,11 ---- + 2005-10-20 Stephen Deasey <sd...@us...> + + * Makefile: + * nsdbtest/Makefile: + * nsdbtest/nsdbtest.c: + * tests/test.nscfg: + * tests/nsdb.test: Implement a simple nsdb driver for testing and + add the beginnings of some tests. + 2005-10-20 Vlad Seryakov <ser...@us...> Index: Makefile =================================================================== RCS file: /cvsroot/naviserver/naviserver/Makefile,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Makefile 16 Oct 2005 08:38:29 -0000 1.15 --- Makefile 20 Oct 2005 23:38:15 -0000 1.16 *************** *** 34,38 **** include include/Makefile.global ! dirs = nsthread nsd nssock nscgi nscp nslog nsperm nsdb distfiles = $(dirs) doc tcl include tests win32 *.tcl configure m4 \ --- 34,38 ---- include include/Makefile.global ! dirs = nsthread nsd nssock nscgi nscp nslog nsperm nsdb nsdbtest distfiles = $(dirs) doc tcl include tests win32 *.tcl configure m4 \ *************** *** 69,85 **** test: all ! LD_LIBRARY_PATH="./nsd:./nsthread" ./nsd/nsd -c -d -t tests/test.nscfg all.tcl $(TESTFLAGS) $(TCLTESTARGS) runtest: all ! LD_LIBRARY_PATH="./nsd:./nsthread" ./nsd/nsd -c -d -t tests/test.nscfg gdbtest: all @echo "set args -c -d -t tests/test.nscfg all.tcl $(TESTFLAGS) $(TCLTESTARGS)" > gdb.run ! LD_LIBRARY_PATH="./nsd:./nsthread" gdb -x gdb.run ./nsd/nsd rm gdb.run gdbruntest: all @echo "set args -c -d -t tests/test.nscfg" > gdb.run ! LD_LIBRARY_PATH="./nsd:./nsthread" gdb -x gdb.run ./nsd/nsd rm gdb.run --- 69,85 ---- test: all ! LD_LIBRARY_PATH="./nsd:./nsthread:../nsdb" ./nsd/nsd -c -d -t tests/test.nscfg all.tcl $(TESTFLAGS) $(TCLTESTARGS) runtest: all ! LD_LIBRARY_PATH="./nsd:./nsthread:../nsdb" ./nsd/nsd -c -d -t tests/test.nscfg gdbtest: all @echo "set args -c -d -t tests/test.nscfg all.tcl $(TESTFLAGS) $(TCLTESTARGS)" > gdb.run ! LD_LIBRARY_PATH="./nsd:./nsthread:../nsdb" gdb -x gdb.run ./nsd/nsd rm gdb.run gdbruntest: all @echo "set args -c -d -t tests/test.nscfg" > gdb.run ! LD_LIBRARY_PATH="./nsd:./nsthread:../nsdb" gdb -x gdb.run ./nsd/nsd rm gdb.run |
From: Stephen D. <sd...@us...> - 2005-10-20 23:38:28
|
Update of /cvsroot/naviserver/naviserver/nsdbtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28406/nsdbtest Added Files: Makefile nsdbtest.c Log Message: * Makefile: * nsdbtest/Makefile: * nsdbtest/nsdbtest.c: * tests/test.nscfg: * tests/nsdb.test: Implement a simple nsdb driver for testing and add the beginnings of some tests. --- NEW FILE: nsdbtest.c --- /* * 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. * * Copyright (C) 2005 Stephen Deasey. * * 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. * */ /* * nsdbtest.c -- * * Implements a stub nsdb driver for testing. */ #include "../nsdb/nsdb.h" NS_RCSID("$Header: /cvsroot/naviserver/naviserver/nsdbtest/nsdbtest.c,v 1.1 2005/10/20 23:38:15 sdeasey Exp $"); NS_EXPORT int Ns_ModuleVersion = 1; /* * Local functions defined in this file. */ static char *DbType(Ns_DbHandle *handle); static int OpenDb(Ns_DbHandle *handle); static int CloseDb(Ns_DbHandle *handle); static Ns_Set *BindRow(Ns_DbHandle *handle); static int Exec(Ns_DbHandle *handle, char *sql); static int GetRow(Ns_DbHandle *handle, Ns_Set *row); static int Flush(Ns_DbHandle *handle); static int ResetHandle(Ns_DbHandle *handle); static void SetTransactionState(Ns_DbHandle *handle, char *sql); /* * Local variables defined in this file. */ static Ns_DbProc procs[] = { {DbFn_DbType, DbType}, {DbFn_Name, DbType}, {DbFn_OpenDb, OpenDb}, {DbFn_CloseDb, CloseDb}, {DbFn_BindRow, BindRow}, {DbFn_Exec, Exec}, {DbFn_GetRow, GetRow}, {DbFn_Flush, Flush}, {DbFn_Cancel, Flush}, {DbFn_ResetHandle, ResetHandle}, {0, NULL} }; static char *dbName = "nsdbtest"; /* *---------------------------------------------------------------------- * * Ns_DbDriverInit -- * * Register driver functions. * * Results: * NS_OK or NS_ERROR. * * Side effects: * None. * *---------------------------------------------------------------------- */ NS_EXPORT int Ns_DbDriverInit(char *driver, char *configPath) { return Ns_DbRegisterDriver(driver, &procs[0]); } /* *---------------------------------------------------------------------- * * DbType -- * * Return a string which identifies the driver type and name. * * Results: * Database type/name. * * Side effects: * None. * *---------------------------------------------------------------------- */ static char * DbType(Ns_DbHandle *handle) { return dbName; } /* *---------------------------------------------------------------------- * * OpenDb -- * * Open a connection. * * Results: * NS_OK or NS_ERROR. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int OpenDb(Ns_DbHandle *handle) { return NS_OK; } /* *---------------------------------------------------------------------- * * CloseDb -- * * Close an open connection. * * Results: * NS_OK or NS_ERROR. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int CloseDb(Ns_DbHandle *handle) { return NS_OK; } /* *---------------------------------------------------------------------- * * BindRow -- * * Retrieve the column names of the current result. * * Results: * An Ns_Set whos keys are the names of columns, or NULL on error. * * Side effects: * None. * *---------------------------------------------------------------------- */ static Ns_Set * BindRow(Ns_DbHandle *handle) { Ns_SetPut(handle->row, "column1", NULL); handle->fetchingRows = NS_FALSE; return handle->row; } /* *---------------------------------------------------------------------- * * Exec -- * * Execute an SQL statement. * * Results: * NS_ROWS, NS_DML or NS_ERROR. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int Exec(Ns_DbHandle *handle, char *sql) { if (handle->verbose) { Ns_Log(Notice, "nsdbtest(%s): Querying '%s'", handle->driver, sql); } if (STRIEQ(sql, "rows")) { return NS_ROWS; } else if (STRIEQ(sql, "dml")) { return NS_DML; } return NS_ERROR; } /* *---------------------------------------------------------------------- * * GetRow -- * * Fill in the given Ns_Set with values for each column of the * current row. * * Results: * NS_OK, NS_END_DATA or NS_ERROR. * * Side effects: * Current tupple updated. * *---------------------------------------------------------------------- */ static int GetRow(Ns_DbHandle *handle, Ns_Set *row) { Ns_SetPutValue(row, 0, "ok"); return NS_END_DATA; } /* *---------------------------------------------------------------------- * * Flush -- * * Flush unfetched rows. * * Results: * NS_OK or NS_ERROR. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int Flush(Ns_DbHandle *handle) { return NS_OK; } /* *---------------------------------------------------------------------- * * ResetHandle -- * * Reset connection ready for next command. * * Results: * NS_OK or NS_ERROR. * * Side effects: * Any active transaction will be rolled back. * *---------------------------------------------------------------------- */ static int ResetHandle(Ns_DbHandle *handle) { return NS_OK; } --- NEW FILE: Makefile --- # # # $Header: /cvsroot/naviserver/naviserver/nsdbtest/Makefile,v 1.1 2005/10/20 23:38:15 sdeasey Exp $ # MOD = nsdbtest.so OBJS = nsdbtest.o include ../include/Makefile.build |