You can subscribe to this list here.
2005 |
Jan
|
Feb
(32) |
Mar
(56) |
Apr
(92) |
May
(39) |
Jun
(226) |
Jul
(98) |
Aug
(66) |
Sep
|
Oct
(153) |
Nov
(43) |
Dec
(42) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(97) |
Feb
(141) |
Mar
(147) |
Apr
(80) |
May
(51) |
Jun
(93) |
Jul
(88) |
Aug
(50) |
Sep
(179) |
Oct
(48) |
Nov
(82) |
Dec
(71) |
2007 |
Jan
(42) |
Feb
(46) |
Mar
(123) |
Apr
(21) |
May
(139) |
Jun
(59) |
Jul
(34) |
Aug
(57) |
Sep
(47) |
Oct
(137) |
Nov
(49) |
Dec
(12) |
2008 |
Jan
(10) |
Feb
(8) |
Mar
(63) |
Apr
(17) |
May
(34) |
Jun
(38) |
Jul
(16) |
Aug
(62) |
Sep
(9) |
Oct
(121) |
Nov
(38) |
Dec
(4) |
2009 |
Jan
|
Feb
(11) |
Mar
(9) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
(4) |
Apr
(10) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
(12) |
2012 |
Jan
(26) |
Feb
(1) |
Mar
(15) |
Apr
(1) |
May
(1) |
Jun
(7) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
(52) |
Nov
(8) |
Dec
(25) |
2013 |
Jan
(35) |
Feb
(14) |
Mar
(10) |
Apr
(10) |
May
(29) |
Jun
(16) |
Jul
(5) |
Aug
(8) |
Sep
(8) |
Oct
(6) |
Nov
(1) |
Dec
(3) |
2014 |
Jan
(16) |
Feb
(13) |
Mar
(5) |
Apr
(9) |
May
(21) |
Jun
(6) |
Jul
(5) |
Aug
(2) |
Sep
(59) |
Oct
(115) |
Nov
(122) |
Dec
(45) |
2015 |
Jan
(31) |
Feb
(32) |
Mar
(19) |
Apr
(25) |
May
(3) |
Jun
(4) |
Jul
(18) |
Aug
(3) |
Sep
(23) |
Oct
(11) |
Nov
(17) |
Dec
(12) |
2016 |
Jan
(20) |
Feb
(27) |
Mar
(20) |
Apr
(40) |
May
(35) |
Jun
(48) |
Jul
(44) |
Aug
(51) |
Sep
(18) |
Oct
(42) |
Nov
(39) |
Dec
(29) |
2017 |
Jan
(37) |
Feb
(34) |
Mar
(20) |
Apr
(37) |
May
(10) |
Jun
(2) |
Jul
(14) |
Aug
(15) |
Sep
(25) |
Oct
(29) |
Nov
(15) |
Dec
(29) |
2018 |
Jan
(5) |
Feb
(15) |
Mar
(6) |
Apr
(20) |
May
(39) |
Jun
(39) |
Jul
(17) |
Aug
(20) |
Sep
(10) |
Oct
(17) |
Nov
(20) |
Dec
(8) |
2019 |
Jan
(28) |
Feb
(21) |
Mar
(13) |
Apr
(44) |
May
(44) |
Jun
(28) |
Jul
(51) |
Aug
(30) |
Sep
(7) |
Oct
(20) |
Nov
(8) |
Dec
(21) |
2020 |
Jan
(27) |
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Vlad S. <ser...@us...> - 2005-02-24 17:25:04
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22692 Modified Files: ChangeLog Log Message: ns_info reports NaviSertver now, new Listen functions are in ns.h now Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ChangeLog 22 Feb 2005 20:33:28 -0000 1.4 --- ChangeLog 24 Feb 2005 17:24:52 -0000 1.5 *************** *** 1,2 **** --- 1,8 ---- + 2005-02-24 Vlad Seryakov <vl...@cr...> + + * include/ns.h nsd/nsd.h nsd/binder.c: changed server name + from AOLserver to NaviServer in ns_info command. + New ListenXXX family functions declared in the ns.h file. + 2005-02-22 Vlad Seryakov <vl...@cr...> |
From: Vlad S. <ser...@us...> - 2005-02-22 20:34:27
|
Update of /cvsroot/naviserver/naviserver/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10315/doc Modified Files: ns_at.n Log Message: added ns_atstartup Tcl command, updated documentation at.n Index: ns_at.n =================================================================== RCS file: /cvsroot/naviserver/naviserver/doc/ns_at.n,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ns_at.n 16 Feb 2005 08:39:10 -0000 1.1.1.1 --- ns_at.n 22 Feb 2005 20:33:30 -0000 1.2 *************** *** 38,42 **** '\" Note: do not modify the .SH NAME line immediately below! .SH NAME ! ns_atclose, ns_atexit, ns_atshutdown, ns_atsignal \- commands .SH SYNOPSIS \fBns_atclose \fIoption \fR?\fIarg arg ...\fR? --- 38,42 ---- '\" Note: do not modify the .SH NAME line immediately below! .SH NAME ! ns_atclose, ns_atexit, ns_atstartup, ns_atshutdown, ns_atsignal \- commands .SH SYNOPSIS \fBns_atclose \fIoption \fR?\fIarg arg ...\fR? *************** *** 44,47 **** --- 44,49 ---- \fBns_atexit \fIoption \fR?\fIarg arg ...\fR? .sp + \fBns_atstartup \fIoption \fR?\fIarg arg ...\fR? + .sp \fBns_atshutdown \fIoption \fR?\fIarg arg ...\fR? .sp *************** *** 51,55 **** .SH DESCRIPTION .PP ! These commands... .SH "SEE ALSO" --- 53,67 ---- .SH DESCRIPTION .PP ! ns_atclose will run Tcl command at each connection close. ! .PP ! ns_atexit will run Tcl command at server exit ! .PP ! ns_atstartup will run Tcl command just after server started and initialized, ! so all Tcl namespaces and proc are already available. ! .PP ! ns_atsignal will run Tcl command when a signal arrives ! .PP ! ns_atshutdown will run Tcl command just before server is about to shutdown ! .PP .SH "SEE ALSO" |
From: Vlad S. <ser...@us...> - 2005-02-22 20:34:26
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10315/nsd Modified Files: tclcmds.c tclsched.c Log Message: added ns_atstartup Tcl command, updated documentation at.n Index: tclcmds.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclcmds.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tclcmds.c 16 Feb 2005 08:39:50 -0000 1.1.1.1 --- tclcmds.c 22 Feb 2005 20:33:32 -0000 1.2 *************** *** 173,176 **** --- 173,177 ---- NsTclAtCloseCmd, NsTclAtExitCmd, + NsTclAtStartupCmd, NsTclAtShutdownCmd, NsTclAtSignalCmd, *************** *** 320,323 **** --- 321,325 ---- {"ns_schedule_weekly", NsTclSchedWeeklyCmd, NULL}, {"ns_atsignal", NsTclAtSignalCmd, NULL}, + {"ns_atstartup", NsTclAtStartupCmd, NULL}, {"ns_atshutdown", NsTclAtShutdownCmd, NULL}, {"ns_atexit", NsTclAtExitCmd, NULL}, Index: tclsched.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclsched.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tclsched.c 16 Feb 2005 08:40:01 -0000 1.1.1.1 --- tclsched.c 22 Feb 2005 20:33:36 -0000 1.2 *************** *** 63,67 **** * NsTclAt -- * ! * Implements ns_atsignal, ns_atshutdown, and ns_atexit commands. * * Results: --- 63,67 ---- * NsTclAt -- * ! * Implements ns_atstartup, ns_atsignal, ns_atshutdown, and ns_atexit commands. * * Results: *************** *** 94,97 **** --- 94,103 ---- int + NsTclAtStartupCmd(ClientData arg, Tcl_Interp *interp, int argc, char **argv) + { + return AtCmd(Ns_RegisterAtStartup, interp, argc, argv); + } + + int NsTclAtSignalCmd(ClientData arg, Tcl_Interp *interp, int argc, char **argv) { |
From: Vlad S. <ser...@us...> - 2005-02-22 20:34:14
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10315 Modified Files: ChangeLog Log Message: added ns_atstartup Tcl command, updated documentation at.n Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ChangeLog 17 Feb 2005 14:19:51 -0000 1.3 --- ChangeLog 22 Feb 2005 20:33:28 -0000 1.4 *************** *** 1,2 **** --- 1,8 ---- + 2005-02-22 Vlad Seryakov <vl...@cr...> + + * nsd/tclsched.c nsd/tclcmds.c doc/at.n: added ns_atstartup + Tcl command to be run after server started and initialized. + Update documentation about those commands, kind of. + 2005-02-17 Zoran Vasiljevic <vas...@us...> |
From: Vlad S. <ser...@us...> - 2005-02-17 14:20:01
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21994 Modified Files: ChangeLog Log Message: updated changelog Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ChangeLog 17 Feb 2005 09:43:57 -0000 1.2 --- ChangeLog 17 Feb 2005 14:19:51 -0000 1.3 *************** *** 5,9 **** threads when linked against Tcl 8.4+ library. 2005-02-15 Zoran Vasiljevic <vas...@us...> ! --- INITIAL IMPORT OF 4.0.10 AOLSERVER CODE --- \ No newline at end of file --- 5,33 ---- threads when linked against Tcl 8.4+ library. + 2005-02-16 Vlad Seryakov <vl...@cr...> + + * Makefile configure configure.in sample-config.tcl include/Makefile.build + include/Makefile.global.in include/Makefile.module.in include/ns.h + include/nsdb.h include/nsextmsg.h include/nspd.h include/nsthread.h + tcl/charsets.tcl tcl/compat.tcl tcl/debug.tcl tcl/fastpath.tcl + tcl/file.tcl tcl/form.tcl tcl/http.tcl tcl/init.tcl + tcl/nsdb.tcl tcl/util.tcl: modified license in the header + + * tcl/sendmail.tcl: added erro notification flag to smtp_recv proc, + when receiving last QUIT response, do not fire exception if + remote server just drops the connection on QUIT + + * nsd/binder.c: added UDP/UNIX/RAW protocols to the sockets, + + * nsd/init.c: call InitLog before dns resolver will try to resolve local + host, this prevents server crash + + * nsd/tclsock.c: back ported from CVS 4.1, added -localhost/-localport to + ns_scokopen + + * nsdb/dbdrv.c: if driver set exception in select, do to rewrite it in the + server + 2005-02-15 Zoran Vasiljevic <vas...@us...> ! --- INITIAL IMPORT OF 4.0.10 AOLSERVER CODE --- |
From: Zoran V. <vas...@us...> - 2005-02-17 09:44:12
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23211 Modified Files: ChangeLog Log Message: See file Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ChangeLog 16 Feb 2005 08:38:48 -0000 1.1.1.1 --- ChangeLog 17 Feb 2005 09:43:57 -0000 1.2 *************** *** 0 **** --- 1,9 ---- + 2005-02-17 Zoran Vasiljevic <vas...@us...> + + * nsd/tclfile.c: fixed broken NsTclChanObjCmd command which + caused server crashes when trasporting channels between + threads when linked against Tcl 8.4+ library. + + 2005-02-15 Zoran Vasiljevic <vas...@us...> + + --- INITIAL IMPORT OF 4.0.10 AOLSERVER CODE --- \ No newline at end of file |
From: Zoran V. <vas...@us...> - 2005-02-17 09:43:47
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22906/nsd Modified Files: tclfile.c Log Message: Fixed broken NsTclChanObjCmd command which caused server crashes when trasporting channels between threads when linked against Tcl 8.4+ Index: tclfile.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclfile.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tclfile.c 16 Feb 2005 08:39:58 -0000 1.1.1.1 --- tclfile.c 17 Feb 2005 09:43:39 -0000 1.2 *************** *** 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" *************** *** 44,47 **** --- 44,56 ---- #endif + /* + * Structure handling one registered channel for the [ns_chan] command + */ + + typedef struct _NsRegChan { + char *name; + Tcl_Channel chan; + } NsRegChan; + static void SpliceChannel(Tcl_Interp *interp, Tcl_Channel chan); static void UnspliceChannel(Tcl_Interp *interp, Tcl_Channel chan); *************** *** 1017,1021 **** NsServer *servPtr = itPtr->servPtr; Tcl_Channel chan = NULL; ! char *name; int new, shared; Tcl_HashTable *tabPtr; --- 1026,1031 ---- NsServer *servPtr = itPtr->servPtr; Tcl_Channel chan = NULL; ! char *name, *chanName; ! NsRegChan *regChan = NULL; int new, shared; Tcl_HashTable *tabPtr; *************** *** 1041,1066 **** case CCreateIdx: if (objc != 4) { ! Tcl_WrongNumArgs(interp, 1, objv, "create channel name"); return TCL_ERROR; } ! chan = Tcl_GetChannel(interp, Tcl_GetString(objv[2]), NULL); if (chan == (Tcl_Channel)NULL) { return TCL_ERROR; } - if (!Tcl_IsChannelRegistered(interp, chan)) { - Tcl_SetResult(interp, "channel is not registered", TCL_STATIC); - return TCL_ERROR; - } if (Tcl_IsChannelShared(chan)) { Tcl_SetResult(interp, "channel is shared", TCL_STATIC); return TCL_ERROR; } ! name = Tcl_GetString(objv[3]); ! Ns_MutexLock(&servPtr->chans.lock); hPtr = Tcl_CreateHashEntry(&servPtr->chans.table, name, &new); ! if (new) { ! Tcl_SetHashValue(hPtr, chan); ! } ! Ns_MutexUnlock(&servPtr->chans.lock); if (!new) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), --- 1051,1077 ---- case CCreateIdx: if (objc != 4) { ! Tcl_WrongNumArgs(interp, 1, objv, "create channel name"); return TCL_ERROR; } ! chanName = Tcl_GetString(objv[2]); ! chan = Tcl_GetChannel(interp, chanName, NULL); if (chan == (Tcl_Channel)NULL) { return TCL_ERROR; } if (Tcl_IsChannelShared(chan)) { Tcl_SetResult(interp, "channel is shared", TCL_STATIC); return TCL_ERROR; } ! name = Tcl_GetString(objv[3]); ! Ns_MutexLock(&servPtr->chans.lock); 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); ! Tcl_SetHashValue(hPtr, regChan); ! } ! Ns_MutexUnlock(&servPtr->chans.lock); if (!new) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), *************** *** 1070,1074 **** } UnspliceChannel(interp, chan); ! break; case CGetIdx: --- 1081,1085 ---- } UnspliceChannel(interp, chan); ! break; case CGetIdx: *************** *** 1078,1087 **** } name = Tcl_GetString(objv[2]); ! Ns_MutexLock(&servPtr->chans.lock); ! hPtr = Tcl_FindHashEntry(&servPtr->chans.table, name); if (hPtr != NULL) { ! chan = (Tcl_Channel)Tcl_GetHashValue(hPtr); Tcl_DeleteHashEntry(hPtr); ! } Ns_MutexUnlock(&servPtr->chans.lock); if (hPtr == NULL) { --- 1089,1098 ---- } name = Tcl_GetString(objv[2]); ! Ns_MutexLock(&servPtr->chans.lock); ! hPtr = Tcl_FindHashEntry(&servPtr->chans.table, name); if (hPtr != NULL) { ! regChan = (NsRegChan*)Tcl_GetHashValue(hPtr); Tcl_DeleteHashEntry(hPtr); ! } Ns_MutexUnlock(&servPtr->chans.lock); if (hPtr == NULL) { *************** *** 1090,1097 **** return TCL_ERROR; } ! SpliceChannel(interp, chan); ! Tcl_SetResult(interp, (char*)Tcl_GetChannelName(chan), TCL_VOLATILE); hPtr = Tcl_CreateHashEntry(&itPtr->chans, name, &new); ! Tcl_SetHashValue(hPtr, chan); break; --- 1101,1108 ---- return TCL_ERROR; } ! SpliceChannel(interp, regChan->chan); ! Tcl_SetResult(interp, regChan->name, TCL_VOLATILE); hPtr = Tcl_CreateHashEntry(&itPtr->chans, name, &new); ! Tcl_SetHashValue(hPtr, regChan); break; *************** *** 1105,1118 **** if (hPtr == NULL) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), ! "no such shared channel: ", name, NULL); return TCL_ERROR; } ! chan = Tcl_GetHashValue(hPtr); ! UnspliceChannel(interp, chan); Tcl_DeleteHashEntry(hPtr); ! Ns_MutexLock(&servPtr->chans.lock); hPtr = Tcl_CreateHashEntry(&servPtr->chans.table, name, &new); ! Tcl_SetHashValue(hPtr, chan); ! Ns_MutexUnlock(&servPtr->chans.lock); break; --- 1116,1137 ---- if (hPtr == NULL) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), ! "no such shared channel: ", name, NULL); return TCL_ERROR; } ! regChan = (NsRegChan*)Tcl_GetHashValue(hPtr); ! chan = Tcl_GetChannel(interp, regChan->name, NULL); ! if (chan == (Tcl_Channel)NULL || chan != regChan->chan) { ! Tcl_DeleteHashEntry(hPtr); ! if (chan != regChan->chan) { ! Tcl_SetResult(interp, "channel mismatch", TCL_STATIC); ! } ! return TCL_ERROR; ! } ! UnspliceChannel(interp, regChan->chan); Tcl_DeleteHashEntry(hPtr); ! Ns_MutexLock(&servPtr->chans.lock); hPtr = Tcl_CreateHashEntry(&servPtr->chans.table, name, &new); ! Tcl_SetHashValue(hPtr, regChan); ! Ns_MutexUnlock(&servPtr->chans.lock); break; *************** *** 1122,1126 **** return TCL_ERROR; } ! shared = (objc == 3); if (shared) { Ns_MutexLock(&servPtr->chans.lock); --- 1141,1145 ---- return TCL_ERROR; } ! shared = (objc == 3); if (shared) { Ns_MutexLock(&servPtr->chans.lock); *************** *** 1144,1151 **** return TCL_ERROR; } ! shared = (objc == 3); if (shared) { Ns_MutexLock(&servPtr->chans.lock); ! tabPtr = &servPtr->chans.table; } else { tabPtr = &itPtr->chans; --- 1163,1170 ---- return TCL_ERROR; } ! shared = (objc == 3); if (shared) { Ns_MutexLock(&servPtr->chans.lock); ! tabPtr = &servPtr->chans.table; } else { tabPtr = &itPtr->chans; *************** *** 1153,1164 **** hPtr = Tcl_FirstHashEntry(tabPtr, &search); while (hPtr != NULL) { ! chan = Tcl_GetHashValue(hPtr); if (shared) { ! Tcl_Close(NULL, chan); } Tcl_DeleteHashEntry(hPtr); hPtr = Tcl_NextHashEntry(&search); } ! if (objc == 3) { Ns_MutexUnlock(&servPtr->chans.lock); } --- 1172,1188 ---- hPtr = Tcl_FirstHashEntry(tabPtr, &search); while (hPtr != NULL) { ! regChan = (NsRegChan*)Tcl_GetHashValue(hPtr); if (shared) { ! Tcl_SpliceChannel(regChan->chan); ! Tcl_UnregisterChannel((Tcl_Interp*)NULL, regChan->chan); ! } else { ! Tcl_UnregisterChannel(interp, regChan->chan); } + Ns_Free(regChan->name); + Ns_Free(regChan); Tcl_DeleteHashEntry(hPtr); hPtr = Tcl_NextHashEntry(&search); } ! if (shared) { Ns_MutexUnlock(&servPtr->chans.lock); } |
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6070/include Modified Files: Makefile.build Makefile.global.in Makefile.module.in ns.h nsdb.h nsextmsg.h nspd.h nsthread.h Log Message: License terms in the headers are changed to Mozilla. sendmail proc extended to support cc as argument and possibly ignore error on receiving QUIT response, some mail servers just drop the connection and then sendmail generate error. ns_getform checks for connection and if no connection returns empty instead of generate error, to be used safely in schedule scripts when same code runs on the Web frontend and backend. Index: Makefile.global.in =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/Makefile.global.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.global.in 16 Feb 2005 15:05:46 -0000 1.2 --- Makefile.global.in 16 Feb 2005 16:45:44 -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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ns.h 16 Feb 2005 08:41:19 -0000 1.1.1.1 --- ns.h 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. * * Software distributed under the License is distributed on an "AS IS" Index: Makefile.build =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/Makefile.build,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile.build 16 Feb 2005 08:41:21 -0000 1.1.1.1 --- Makefile.build 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" Index: nsextmsg.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/nsextmsg.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** nsextmsg.h 16 Feb 2005 08:41:21 -0000 1.1.1.1 --- nsextmsg.h 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. * * Software distributed under the License is distributed on an "AS IS" Index: nsdb.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/nsdb.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** nsdb.h 16 Feb 2005 08:41:20 -0000 1.1.1.1 --- nsdb.h 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. * * Software distributed under the License is distributed on an "AS IS" Index: Makefile.module.in =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/Makefile.module.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.module.in 16 Feb 2005 15:05:46 -0000 1.2 --- Makefile.module.in 16 Feb 2005 16:45:44 -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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" Index: nspd.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/nspd.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** nspd.h 16 Feb 2005 08:41:20 -0000 1.1.1.1 --- nspd.h 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. * * Software distributed under the License is distributed on an "AS IS" Index: nsthread.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/nsthread.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** nsthread.h 16 Feb 2005 08:41:21 -0000 1.1.1.1 --- nsthread.h 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. * * Software distributed under the License is distributed on an "AS IS" |
From: Vlad S. <ser...@us...> - 2005-02-16 16:46:00
|
Update of /cvsroot/naviserver/naviserver/tcl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6070/tcl Modified Files: charsets.tcl compat.tcl debug.tcl fastpath.tcl file.tcl form.tcl http.tcl init.tcl nsdb.tcl sendmail.tcl util.tcl Removed Files: modlog.tcl Log Message: License terms in the headers are changed to Mozilla. sendmail proc extended to support cc as argument and possibly ignore error on receiving QUIT response, some mail servers just drop the connection and then sendmail generate error. ns_getform checks for connection and if no connection returns empty instead of generate error, to be used safely in schedule scripts when same code runs on the Web frontend and backend. Index: file.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/tcl/file.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** file.tcl 16 Feb 2005 08:40:40 -0000 1.1.1.1 --- file.tcl 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" *************** *** 48,52 **** ! if {$on} { ns_share errorPage ns_log notice "tcl: enabling .tcl pages" --- 48,52 ---- ! if $on { ns_share errorPage ns_log notice "tcl: enabling .tcl pages" *************** *** 65,103 **** } ! proc ns_sourceproc {conn args} { ! ns_share errorPage ! set file [ns_url2file [ns_conn url $conn]] ! if {![file exists $file]} { ! ns_returnnotfound $conn ! } else { ! set code [catch { ! source $file ! } result ] ! global errorCode errorInfo ! if { ![info exists errorCode] } { ! # Tcl bug workaround. ! set errorCode NONE ! } ! if { ![info exists errorInfo] } { ! # Another Tcl bug workaround. ! set errorInfo "" ! } ! if {$code == 1 && $errorCode == "NS_TCL_ABORT"} { ! return ! } ! if { $errorPage == "" } { ! return -code $code \ ! -errorcode $errorCode -errorinfo $errorInfo $result ! } else { ! ## Custom error page -- unfortunately we can't pass parameters. ! source $errorPage ! } } } --- 65,142 ---- } + if { ![string equal [info commands "ns_cache"] ""] } { + proc ns_sourceproc {conn ignored} { ! ns_share errorPage ! set file [ns_url2file [ns_conn url $conn]] ! if ![file exists $file] { ! ns_returnnotfound $conn ! } else { ! set code [catch { ! source_cached $file ! } result ] ! global errorCode errorInfo ! ! if { ![info exists errorCode] } { ! # Tcl bug workaround. ! set errorCode NONE ! } ! if { ![info exists errorInfo] } { ! # Another Tcl bug workaround. ! set errorInfo "" ! } ! ! if {$code == 1 && $errorCode == "NS_TCL_ABORT"} { ! return ! } ! if { $errorPage == "" } { ! return -code $code \ ! -errorcode $errorCode -errorinfo $errorInfo $result ! } else { ! ## Custom error page -- unfortunately we can't pass parameters. ! source $errorPage ! } ! } ! } ! } else { ! proc ns_sourceproc {conn ignored} { ! ! ns_share errorPage ! ! set file [ns_url2file [ns_conn url $conn]] ! if ![file exists $file] { ! ns_returnnotfound $conn ! } else { ! set code [catch { ! source $file ! } result ] ! ! global errorCode errorInfo ! if { ![info exists errorCode] } { ! # Tcl bug workaround. ! set errorCode NONE ! } ! if { ![info exists errorInfo] } { ! # Another Tcl bug workaround. ! set errorInfo "" ! } ! if {$code == 1 && $errorCode == "NS_TCL_ABORT"} { ! return ! } ! if { $errorPage == "" } { ! return -code $code \ ! -errorcode $errorCode -errorinfo $errorInfo $result ! } else { ! ## Custom error page -- unfortunately we can't pass parameters. ! source $errorPage ! } ! } } } + --- modlog.tcl DELETED --- Index: util.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/tcl/util.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** util.tcl 16 Feb 2005 08:40:42 -0000 1.1.1.1 --- util.tcl 16 Feb 2005 16:45:45 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" Index: compat.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/tcl/compat.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** compat.tcl 16 Feb 2005 08:40:40 -0000 1.1.1.1 --- compat.tcl 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" Index: form.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/tcl/form.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** form.tcl 16 Feb 2005 08:40:40 -0000 1.1.1.1 --- form.tcl 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" *************** *** 135,138 **** --- 135,140 ---- global _ns_form _ns_formfiles + if { ![ns_conn isconnected] } { return } + # # If a charset has been specified, use ns_urlcharset to Index: fastpath.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/tcl/fastpath.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** fastpath.tcl 16 Feb 2005 08:40:40 -0000 1.1.1.1 --- fastpath.tcl 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" Index: nsdb.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/tcl/nsdb.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** nsdb.tcl 16 Feb 2005 08:40:40 -0000 1.1.1.1 --- nsdb.tcl 16 Feb 2005 16:45:45 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" Index: charsets.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/tcl/charsets.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** charsets.tcl 16 Feb 2005 08:40:40 -0000 1.1.1.1 --- charsets.tcl 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" Index: http.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/tcl/http.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** http.tcl 16 Feb 2005 08:40:40 -0000 1.1.1.1 --- http.tcl 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" Index: sendmail.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/tcl/sendmail.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sendmail.tcl 16 Feb 2005 08:40:40 -0000 1.1.1.1 --- sendmail.tcl 16 Feb 2005 16:45:45 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" *************** *** 29,44 **** # - # $Header$ - # - - # # sendmail.tcl - Define the ns_sendmail procedure for sending # email from a Tcl script through a remote SMTP server. # ! ! proc _ns_smtp_send {wfp string timeout} { ! if {[lindex [ns_sockselect -timeout $timeout {} $wfp {}] 1] == ""} { ! error "Timeout writing to SMTP host" } puts $wfp $string\r --- 29,40 ---- # # sendmail.tcl - Define the ns_sendmail procedure for sending # email from a Tcl script through a remote SMTP server. # ! proc _ns_smtp_send { mode wfp string timeout} { ! ! if {[lindex [ns_sockselect -timeout $timeout {} $wfp {}] 1] == ""} { ! error "$mode: Timeout writing to SMTP host" } puts $wfp $string\r *************** *** 46,120 **** } ! ! proc _ns_smtp_recv {rfp check timeout} { ! while {1} { ! if {[lindex [ns_sockselect -timeout $timeout $rfp {} {}] 0] == ""} { ! error "Timeout reading from SMTP host" ! } ! set line [gets $rfp] ! set code [string range $line 0 2] ! if {![string match $check $code]} { ! error "Expected a $check status line; got:\n$line" ! } ! if {![string match "-" [string range $line 3 3]]} { ! break; ! } } } ! proc ns_sendmail { to from subject body {extraheaders {}} {bcc {}} } { ! ! ## Takes comma-separated values in the "to" parm ! ## Multiple To and BCC addresses are handled appropriately. ## Original ns_sendmail functionality is preserved. ! ## Cut out carriage returns ! regsub -all "\n" $to "" to ! regsub -all "\r" $to "" to ! regsub -all "\n" $bcc "" bcc ! regsub -all "\r" $bcc "" bcc ! ! ## Split to into a proper list ! set tolist_in [split $to ","] ! set bcclist_in [split $bcc ","] ## Get smtp server into, if none then use localhost set smtp [ns_config ns/parameters smtphost] ! if {[string match "" $smtp]} { ! set smtp [ns_config ns/parameters mailhost] ! } ! if {[string match "" $smtp]} { ! set smtp localhost ! } set timeout [ns_config ns/parameters smtptimeout] ! if {[string match "" $timeout]} { ! set timeout 60 ! } set smtpport [ns_config ns/parameters smtpport] ! if {[string match "" $smtpport]} { ! set smtpport 25 ! } set tolist [list] ! foreach toaddr $tolist_in { ! lappend tolist "[string trim $toaddr]" } set bcclist [list] ! if {![string match "" $bcclist_in]} { ! foreach bccaddr $bcclist_in { ! lappend bcclist "[string trim $bccaddr]" ! } } ## Send it along to _ns_sendmail ! _ns_sendmail $smtp $smtpport $timeout $tolist $bcclist \ ! $from $subject $body $extraheaders } ! ! proc _ns_sendmail {smtp smtpport timeout tolist bcclist \ ! from subject body extraheaders} { ## Put the tolist in the headers --- 42,121 ---- } ! proc _ns_smtp_recv { mode rfp check timeout { error 1 } } { ! ! while (1) { ! if {[lindex [ns_sockselect -timeout $timeout $rfp {} {}] 0] == ""} { ! error "$mode: Timeout reading from SMTP host" ! } ! set line [gets $rfp] ! set code [string range $line 0 2] ! if { ![string match $check $code] } { ! set errmsg "$mode: Expected a $check status line; got:\n$line" ! if { $error } { error $errmsg } ! ns_log Error ns_sendmail: $errmsg ! break ! } ! if ![string match "-" [string range $line 3 3]] { break } } } + proc ns_sendmail { to from subject body {headers {}} {bcc {}} {cc {}} } { ! ## Takes comma-separated values in the "to,cc,bcc" parms ! ## Multiple To,CC and BCC addresses are handled appropriately. ## Original ns_sendmail functionality is preserved. ! ## Read CC/BCC addresses from extra headers if any ! if { $headers != "" } { ! if { [set addr [ns_set iget $headers cc]] != "" } { ! ns_set idelkey $headers cc ! append cc , $addr ! } ! if { [set addr [ns_set iget $headers bcc]] != "" } { ! ns_set idelkey $headers bcc ! append bcc , $addr ! } ! } ## Get smtp server into, if none then use localhost set smtp [ns_config ns/parameters smtphost] ! if [string match "" $smtp] { set smtp [ns_config ns/parameters mailhost] } ! if [string match "" $smtp] { set smtp localhost } set timeout [ns_config ns/parameters smtptimeout] ! if [string match "" $timeout] { set timeout 60 } set smtpport [ns_config ns/parameters smtpport] ! if [string match "" $smtpport] { set smtpport 25 } + ## Extract "from" email address + if [regexp {.*<(.*)>} $from d address] { set from $address } + + ## Prepare to,cc,bcc address lists set tolist [list] ! regsub -all {[\n\r ]} $to {} to ! foreach addr [split $to ,] { ! if { [regexp {.*<(.*)>} $addr d address] } { set addr $address } ! if { [set addr [string trim $addr]] != "" } { lappend tolist $addr } ! } ! ! set cclist [list] ! regsub -all {[\n\r ]} $cc {} cc ! foreach addr [split $cc ,] { ! if { [regexp {.*<(.*)>} $addr d address] } { set addr $address } ! if { [set addr [string trim $addr]] != "" } { lappend cclist $addr } } set bcclist [list] ! regsub -all {[\n\r ]} $bcc {} bcc ! foreach addr [split $bcc ,] { ! if { [regexp {.*<(.*)>} $addr d address] } { set addr $address } ! if { [set addr [string trim $addr]] != "" } { lappend bcclist $addr } } ## Send it along to _ns_sendmail ! _ns_sendmail $smtp $smtpport $timeout $tolist $cclist $bcclist \ ! $from $subject $body $headers } ! proc _ns_sendmail {smtp smtpport timeout tolist cclist bcclist from subject body headers} { ## Put the tolist in the headers *************** *** 122,145 **** ## Build headers ! set msg "To: $rfcto\nFrom: $from\nSubject: $subject\nDate: [ns_httptime [ns_time]]" ! ## Insert extra headers, if any (not for BCC) ! if {![string match "" $extraheaders]} { ! set size [ns_set size $extraheaders] ! for {set i 0} {$i < $size} {incr i} { ! append msg "\n[ns_set key $extraheaders $i]: [ns_set value $extraheaders $i]" ! } } ## Blank line between headers and body ! append msg "\n\n$body\n" ## Terminate body with a solitary period foreach line [split $msg "\n"] { ! if {[string match . $line]} { ! append data . ! } ! append data $line ! append data "\r\n" } append data . --- 123,147 ---- ## Build headers ! set msg "To: $rfcto\nFrom: $from\nSubject: $subject\nDate: [ns_httptime [ns_time]]\n" ! ! ## CC recipients in separate header ! if { $cclist != "" } { append msg "Cc: [join $cclist ","]\n" } ! ## Insert extra headers, if any (not for BCC) ! if { $headers != "" } { ! set size [ns_set size $headers] ! for {set i 0} {$i < $size} {incr i} { ! append msg "[ns_set key $headers $i]: [ns_set value $headers $i]\n" ! } } ## Blank line between headers and body ! append msg "\n$body\n" ## Terminate body with a solitary period foreach line [split $msg "\n"] { ! if { [string match . $line] } { append data . } ! append data $line ! append data "\r\n" } append data . *************** *** 149,184 **** set rfp [lindex $sock 0] set wfp [lindex $sock 1] - - ## Strip "from:" email address - regexp {.*<(.*)>} $from ig from ## Perform the SMTP conversation if { [catch { ! _ns_smtp_recv $rfp 220 $timeout ! _ns_smtp_send $wfp "HELO [ns_info hostname]" $timeout ! _ns_smtp_recv $rfp 250 $timeout ! _ns_smtp_send $wfp "MAIL FROM:<$from>" $timeout ! _ns_smtp_recv $rfp 250 $timeout ! ## Loop through To and BCC list via multiple RCPT TO lines ! ## A BCC should never, ever appear in the header ! foreach toto [concat $tolist $bcclist] { ! #transform "Fritz <fr...@fo...>" into "fr...@fo..." ! regexp {.*<(.*)>} $toto ig toto ! _ns_smtp_send $wfp "RCPT TO:<$toto>" $timeout ! _ns_smtp_recv $rfp 250 $timeout ! } ! _ns_smtp_send $wfp DATA $timeout ! _ns_smtp_recv $rfp 354 $timeout ! _ns_smtp_send $wfp $data $timeout ! _ns_smtp_recv $rfp 250 $timeout ! _ns_smtp_send $wfp QUIT $timeout ! _ns_smtp_recv $rfp 221 $timeout } errMsg ] } { ! ## Error, close and report ! close $rfp ! close $wfp ! return -code error $errMsg } --- 151,196 ---- set rfp [lindex $sock 0] set wfp [lindex $sock 1] ## Perform the SMTP conversation if { [catch { ! _ns_smtp_recv "Start" $rfp 220 $timeout ! _ns_smtp_send "Helo" $wfp "HELO [ns_info hostname]" $timeout ! _ns_smtp_recv "Helo" $rfp 250 $timeout ! _ns_smtp_send "Mail $from" $wfp "MAIL FROM:<$from>" $timeout ! _ns_smtp_recv "Mail $from" $rfp 250 $timeout ! ## Loop through To list via multiple RCPT TO lines ! foreach to $tolist { ! if { $to == "" } { continue } ! _ns_smtp_send "Rcpt $to" $wfp "RCPT TO:<$to>" $timeout ! _ns_smtp_recv "Rcpt $to" $rfp 250 $timeout 0 ! } ! ! ## Loop through CC list via multiple RCPT TO lines ! foreach to $cclist { ! if { $to == "" } { continue } ! _ns_smtp_send "Rcpt $to" $wfp "RCPT TO:<$to>" $timeout ! _ns_smtp_recv "Rcpt $to" $rfp 250 $timeout 0 ! } ! ## Loop through BCC list via multiple RCPT TO lines ! ## A BCC should never, ever appear in the header. Ever. Not even. ! foreach to $bcclist { ! if { $to == "" } { continue } ! _ns_smtp_send "Rcpt $to" $wfp "RCPT TO:<$to>" $timeout ! _ns_smtp_recv "Rcpt $to" $rfp 250 $timeout 0 ! } ! ! _ns_smtp_send Data $wfp DATA $timeout ! _ns_smtp_recv Data $rfp 354 $timeout ! _ns_smtp_send Data $wfp $data $timeout ! _ns_smtp_recv Data $rfp 250 $timeout ! _ns_smtp_send Quit $wfp QUIT $timeout ! _ns_smtp_recv Quit $rfp 221 $timeout 0 } errMsg ] } { ! ## Error, close and report ! close $rfp ! close $wfp ! return -code error $errMsg } Index: init.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/tcl/init.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** init.tcl 16 Feb 2005 08:40:42 -0000 1.1.1.1 --- init.tcl 16 Feb 2005 16:45:45 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" Index: debug.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/tcl/debug.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** debug.tcl 16 Feb 2005 08:40:40 -0000 1.1.1.1 --- debug.tcl 16 Feb 2005 16:45:44 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" |
From: Vlad S. <ser...@us...> - 2005-02-16 16:46:00
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6070 Modified Files: Makefile configure.in sample-config.tcl Log Message: License terms in the headers are changed to Mozilla. sendmail proc extended to support cc as argument and possibly ignore error on receiving QUIT response, some mail servers just drop the connection and then sendmail generate error. ns_getform checks for connection and if no connection returns empty instead of generate error, to be used safely in schedule scripts when same code runs on the Web frontend and backend. Index: configure.in =================================================================== RCS file: /cvsroot/naviserver/naviserver/configure.in,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** configure.in 16 Feb 2005 08:38:46 -0000 1.1.1.1 --- configure.in 16 Feb 2005 16:45:43 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" Index: Makefile =================================================================== RCS file: /cvsroot/naviserver/naviserver/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:38:42 -0000 1.1.1.1 --- Makefile 16 Feb 2005 16:45:43 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" *************** *** 45,57 **** install-binaries: all for i in bin lib log include modules/tcl servers/server1/pages; do \ ! $(MKDIR) $(AOLSERVER)/$$i; \ done for i in include/*.h include/Makefile.global include/Makefile.module; do \ ! $(INSTALL_DATA) $$i $(AOLSERVER)/include/; \ done for i in tcl/*.tcl; do \ ! $(INSTALL_DATA) $$i $(AOLSERVER)/modules/tcl/; \ done ! $(INSTALL_DATA) sample-config.tcl $(AOLSERVER)/ $(INSTALL_SH) install-sh $(INSTBIN)/ for i in $(dirs); do \ --- 45,57 ---- install-binaries: all for i in bin lib log include modules/tcl servers/server1/pages; do \ ! $(MKDIR) $(NAVISERVER)/$$i; \ done for i in include/*.h include/Makefile.global include/Makefile.module; do \ ! $(INSTALL_DATA) $$i $(NAVISERVER)/include/; \ done for i in tcl/*.tcl; do \ ! $(INSTALL_DATA) $$i $(NAVISERVER)/modules/tcl/; \ done ! $(INSTALL_DATA) sample-config.tcl $(NAVISERVER)/ $(INSTALL_SH) install-sh $(INSTBIN)/ for i in $(dirs); do \ *************** *** 63,67 **** install-doc: ! cd doc && /bin/sh ./install-doc $(AOLSERVER) test: all --- 63,67 ---- install-doc: ! cd doc && /bin/sh ./install-doc $(NAVISERVER) test: all Index: sample-config.tcl =================================================================== RCS file: /cvsroot/naviserver/naviserver/sample-config.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sample-config.tcl 16 Feb 2005 08:38:43 -0000 1.1.1.1 --- sample-config.tcl 16 Feb 2005 16:45:43 -0000 1.2 *************** *** 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://www.mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" *************** *** 34,38 **** # sample-config.tcl -- Example config script. # ! # This script is an AOLserver configuration script with # several example sections. To use: # --- 34,38 ---- # sample-config.tcl -- Example config script. # ! # This script is an naviserver configuration script with # several example sections. To use: # *************** *** 88,92 **** # MIME types. # ! # Note: AOLserver already has an exhaustive list of MIME types, but in # case something is missing you can add it here. # --- 88,92 ---- # MIME types. # ! # Note: naviserver already has an exhaustive list of MIME types, but in # case something is missing you can add it here. # *************** *** 143,147 **** # Server-level configuration # ! # There is only one server in AOLserver, but this is helpful when multiple # servers share the same configuration file. This file assumes that only # one server is in use so it is set at the top in the "server" Tcl variable. --- 143,147 ---- # Server-level configuration # ! # There is only one server in naviserver, but this is helpful when multiple # servers share the same configuration file. This file assumes that only # one server is in use so it is set at the top in the "server" Tcl variable. *************** *** 256,261 **** # See also: # ! # /aolserver/nsd/fastpath.c ! # /aolserver/tcl/fastpath.tcl --- 256,261 ---- # See also: # ! # /naviserver/nsd/fastpath.c ! # /naviserver/tcl/fastpath.tcl *************** *** 404,408 **** # http://<host>:<port>/_stats # ! # 3. Configure user. (Optional: default = aolserver) # 4. Configure password. (Optional: default = stats) # --- 404,408 ---- # http://<host>:<port>/_stats # ! # 3. Configure user. (Optional: default = naviserver) # 4. Configure password. (Optional: default = stats) # *************** *** 412,416 **** #ns_section ns/server/stats # ns_param enabled 1 ! # ns_param url /aolserver/stats # ns_param user nsadmin # ns_param password 23dfs!d --- 412,416 ---- #ns_section ns/server/stats # ns_param enabled 1 ! # ns_param url /naviserver/stats # ns_param user nsadmin # ns_param password 23dfs!d |
From: Vlad S. <ser...@us...> - 2005-02-16 15:59:51
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28381 Modified Files: init.c Log Message: In rare cases when dns resolver cannot resolve the hostname on startup and tries to log this error it crashes because log was not initilized yet. Index: init.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/init.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** init.c 16 Feb 2005 08:40:00 -0000 1.1.1.1 --- init.c 16 Feb 2005 15:59:42 -0000 1.2 *************** *** 66,74 **** NsInitBinder(); #endif NsInitCache(); NsInitConf(); NsInitEncodings(); NsInitListen(); - NsInitLog(); NsInitInfo(); NsInitMimeTypes(); --- 66,74 ---- NsInitBinder(); #endif + NsInitLog(); NsInitCache(); NsInitConf(); NsInitEncodings(); NsInitListen(); NsInitInfo(); NsInitMimeTypes(); |
From: Vlad S. <ser...@us...> - 2005-02-16 15:06:00
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13754/nsd Modified Files: binder.c tclsock.c Log Message: Binder suppport for different protocols added, supported TCP/UDP/ICMP/UNIX protocols. Added Ns_SockListenUdp,Ns_SockListenRaw,Ns_SockListenUnix functions. Backported sockopen command from 4.1 tree with -localhost/-localport options. db select will reuse exception which driver set otherwise will set standard error about wrong query. Index: tclsock.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclsock.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tclsock.c 16 Feb 2005 08:40:17 -0000 1.1.1.1 --- tclsock.c 16 Feb 2005 15:05:46 -0000 1.2 *************** *** 105,140 **** { Ns_DString ds; - char *opt, *addr; - int all = 0; int status; ! if (byaddr) { ! if (objc < 2 || objc > 3) { ! Tcl_WrongNumArgs(interp, 1, objv, "?-all? address"); ! return TCL_ERROR; ! } ! } else { ! if (objc != 2) { ! Tcl_WrongNumArgs(interp, 1, objv, "address"); ! return TCL_ERROR; ! } ! } ! opt = Tcl_GetString(objv[1]); ! if (objc >= 3 && STREQ(opt, "-all")) { ! all = 1; ! addr = Tcl_GetString(objv[2]); ! } else { ! addr = opt; } - Ns_DStringInit(&ds); if (byaddr) { ! if (all) { ! status = Ns_GetAllAddrByHost(&ds, addr); ! } else { ! status = Ns_GetAddrByHost(&ds, addr); ! } } else { ! status = Ns_GetHostByAddr(&ds, addr); } if (status == NS_TRUE) { --- 105,119 ---- { Ns_DString ds; int status; ! if (objc != 2) { ! Tcl_WrongNumArgs(interp, 1, objv, "address"); ! return TCL_ERROR; } Ns_DStringInit(&ds); if (byaddr) { ! status = Ns_GetAddrByHost(&ds, Tcl_GetString(objv[1])); } else { ! status = Ns_GetHostByAddr(&ds, Tcl_GetString(objv[1])); } if (status == NS_TRUE) { *************** *** 143,147 **** Ns_DStringFree(&ds); if (status != NS_TRUE) { ! Tcl_AppendResult(interp, "could not lookup ", addr, NULL); return TCL_ERROR; } --- 122,128 ---- Ns_DStringFree(&ds); if (status != NS_TRUE) { ! Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "could not lookup ", ! Tcl_GetString(objv[1]), ! NULL); return TCL_ERROR; } *************** *** 393,441 **** int ! NsTclSockOpenObjCmd(ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { SOCKET sock; ! int port; ! int timeout; ! int first; ! int async; ! if (objc < 3 || objc > 5) { ! Tcl_WrongNumArgs(interp, 1, objv, "?-nonblock|-timeout seconds? host port"); return TCL_ERROR; } ! first = 1; ! async = 0; ! timeout = -1; ! if (objc == 4) { ! /* ! * open -nonblock host port ! */ ! ! if (!STREQ(Tcl_GetString(objv[1]), "-nonblock") && ! !STREQ(Tcl_GetString(objv[1]), "-async")) { ! Tcl_WrongNumArgs(interp, 1, objv, "?-nonblock|-timeout seconds? host port"); ! return TCL_ERROR; } ! first = 2; ! async = 1; ! } else if (objc == 5) { ! /* ! * open -timeout seconds host port ! */ ! if (!STREQ(Tcl_GetString(objv[1]), "-timeout")) { ! Tcl_WrongNumArgs(interp, 1, objv, "?-nonblock|-timeout seconds? host port"); ! return TCL_ERROR; ! } ! if (Tcl_GetIntFromObj(interp, objv[2], &timeout) != TCL_OK) { ! return TCL_ERROR; ! } ! first = 3; } ! if (Tcl_GetIntFromObj(interp, objv[first + 1], &port) != TCL_OK) { return TCL_ERROR; } --- 374,473 ---- int ! NsTclSockOpenObjCmd( ! ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ! ) { SOCKET sock; ! char *host, *lhost = NULL, *opt, *val; ! int lport = 0, port, first, async = 0, timeout = -1; ! if (objc < 3 || objc > 9) { ! syntax: ! Tcl_WrongNumArgs(interp, 1, objv, ! "?(-nonblock | -async) | -timeout seconds? " ! "?-localhost host? ?-localport port? host port"); return TCL_ERROR; } ! ! /* ! * Parse optional arguments. Note that either the: ! * -nonblock | -async ! * or ! * -timeout seconds ! * combinations are accepted. ! */ ! for (first = 1; first < objc; first++) { ! opt= Tcl_GetString(objv[first]); ! if (*opt != '-') { ! break; /* End of options */ } + if (STREQ(opt, "-nonblock") || STREQ(opt, "-async")) { + if (timeout >= 0) { + goto syntax; + } + async = 1; + } else if (STREQ(opt, "-localhost")) { + if (++first >= objc) { + goto syntax; + } + lhost = Tcl_GetString(objv[first]); + if (*lhost == 0) { + Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), + "invalid hostname: must not be empty", NULL); + return TCL_ERROR; + } + } else if (STREQ(opt, "-timeout")) { + if (++first >= objc || async) { + goto syntax; + } + if (Tcl_GetIntFromObj(interp, objv[first], &timeout) != TCL_OK) { + return TCL_ERROR; + } + } else if (STREQ(opt, "-localport")) { + if (++first >= objc) { + goto syntax; + } + if (Tcl_GetIntFromObj(interp, objv[first], &lport) != TCL_OK) { + return TCL_ERROR; + } + if (lport < 0) { + val = Tcl_GetString(objv[first]); + Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), + "invalid port: ", val, "; must be > 0", NULL); + return TCL_ERROR; + } + } else { + Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), + "invalid option: \"", opt, "\"", NULL); + return TCL_ERROR; + } + } ! if ((objc - first) != 2) { ! goto syntax; ! } ! /* ! * Get the host to connect to. Bark on invalid entry. ! */ ! host = Tcl_GetString(objv[first]); ! if (*host == 0) { ! Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), ! "invalid hostname: must not be empty", NULL); ! return TCL_ERROR; } ! ! /* ! * Get the port to connect to. Bark on invalid entry. ! */ ! ! if (Tcl_GetIntFromObj(interp, objv[first+1], &port) != TCL_OK) { ! return TCL_ERROR; ! } else if (port < 0) { ! val = Tcl_GetString(objv[first+1]); ! Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), ! "invalid port: ", val, "; must be > 0", NULL); return TCL_ERROR; } *************** *** 444,461 **** * Perform the connection. */ ! if (async) { ! sock = Ns_SockAsyncConnect(Tcl_GetString(objv[first]), port); } else if (timeout < 0) { ! sock = Ns_SockConnect(Tcl_GetString(objv[first]), port); } else { ! sock = Ns_SockTimedConnect(Tcl_GetString(objv[first]), port, timeout); } if (sock == INVALID_SOCKET) { ! Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "could not connect to \"", ! Tcl_GetString(objv[first]), ":", ! Tcl_GetString(objv[first + 1]), "\"", NULL); return TCL_ERROR; } return EnterDupedSocks(interp, sock); } --- 476,496 ---- * Perform the connection. */ ! if (async) { ! sock = Ns_SockAsyncConnect2(host, port, lhost, lport); } else if (timeout < 0) { ! sock = Ns_SockConnect2(host, port, lhost, lport); } else { ! sock = Ns_SockTimedConnect2(host, port, lhost, lport, timeout); } + if (sock == INVALID_SOCKET) { ! char *why = Tcl_GetErrno() ? Tcl_PosixError(interp) : "reason unknown"; ! Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), ! "can't connect to \"", host, ":", ! Tcl_GetString(objv[first+1]), "\"; ", why, NULL); return TCL_ERROR; } + return EnterDupedSocks(interp, sock); } Index: binder.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/binder.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** binder.c 16 Feb 2005 08:39:19 -0000 1.1.1.1 --- binder.c 16 Feb 2005 15:05:46 -0000 1.2 *************** *** 38,42 **** #include "nsd.h" ! /* * Locals defined in this file --- 38,42 ---- #include "nsd.h" ! #include <sys/un.h> /* * Locals defined in this file *************** *** 44,51 **** static void PreBind(char *line); ! static Tcl_HashTable prebound; static Ns_Mutex lock; /* *---------------------------------------------------------------------- --- 44,55 ---- static void PreBind(char *line); ! static Tcl_HashTable preboundTcp; ! static Tcl_HashTable preboundUdp; ! static Tcl_HashTable preboundRaw; ! static Tcl_HashTable preboundUnix; static Ns_Mutex lock; + /* *---------------------------------------------------------------------- *************** *** 76,80 **** } Ns_MutexLock(&lock); ! hPtr = Tcl_FindHashEntry(&prebound, (char *) &sa); if (hPtr != NULL) { sock = (int) Tcl_GetHashValue(hPtr); --- 80,84 ---- } Ns_MutexLock(&lock); ! hPtr = Tcl_FindHashEntry(&preboundTcp, (char *) &sa); if (hPtr != NULL) { sock = (int) Tcl_GetHashValue(hPtr); *************** *** 94,97 **** --- 98,279 ---- } + /* + *---------------------------------------------------------------------- + * + * Ns_SockBindUdp -- + * + * Create a UDP socket and bind it to the passed-in address. + * + * Results: + * Socket descriptor or -1 on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + int + Ns_SockBindUdp(struct sockaddr_in *saPtr) + { + int sock, err, n = 1; + + if((sock = socket(AF_INET,SOCK_DGRAM,0)) < 0 || + setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &n, sizeof(n)) < 0 || + bind(sock,(struct sockaddr *)saPtr,sizeof(struct sockaddr_in)) < 0) { + err = errno; + close(sock); + Ns_SetSockErrno(err); + sock = -1; + } + return sock; + } + + /* + *---------------------------------------------------------------------- + * + * Ns_SockRaw -- + * + * Helper routine for creating a raw socket + * + * Results: + * Socket descriptor or -1 on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + int + Ns_SockRaw(int proto) + { + int sock, err; + + if((sock = socket(AF_INET,SOCK_RAW,proto)) < 0) { + err = errno; + close(sock); + Ns_SetSockErrno(err); + sock = -1; + } + return sock; + } + + /* + *---------------------------------------------------------------------- + * + * Ns_SockListenUdp -- + * + * Create a new UDP socket bound to the specified port and listening + * for new connections. + * + * Results: + * Socket descriptor or -1 on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + int + Ns_SockListenUdp(char *address, int port) + { + int sock = -1; + struct sockaddr_in sa; + Tcl_HashEntry *hPtr; + + if (Ns_GetSockAddr(&sa, address, port) != NS_OK) { + return -1; + } + Ns_MutexLock(&lock); + hPtr = Tcl_FindHashEntry(&preboundUdp, (char *) &sa); + if (hPtr != NULL) { + sock = (int) Tcl_GetHashValue(hPtr); + Tcl_DeleteHashEntry(hPtr); + } + Ns_MutexUnlock(&lock); + if (hPtr == NULL) { + sock = Ns_SockBindUdp(&sa); + } + return sock; + } + + /* + *---------------------------------------------------------------------- + * + * Ns_SockListenRaw -- + * + * Create a new RAW socket + * + * Results: + * Socket descriptor or -1 on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + int + Ns_SockListenRaw(int proto) + { + int sock = -1; + Tcl_HashEntry *hPtr; + Tcl_HashSearch search; + + Ns_MutexLock(&lock); + hPtr = Tcl_FirstHashEntry(&preboundRaw, &search); + while (hPtr != NULL) { + if(proto == (int)Tcl_GetHashValue(hPtr)) { + sock = (int)Tcl_GetHashKey(&preboundRaw, hPtr); + Tcl_DeleteHashEntry(hPtr); + break; + } + hPtr = Tcl_NextHashEntry(&search); + } + Ns_MutexUnlock(&lock); + if (hPtr == NULL) { + sock = Ns_SockRaw(proto); + } + return sock; + } + + /* + *---------------------------------------------------------------------- + * + * ListenUnix -- + * + * Helper routine for creating a listening UNIX domain socket. + * + * Results: + * Socket descriptor or -1 on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + static int + Ns_SockListenUnix(char *path) + { + int sock, err; + struct sockaddr_un addr; + + memset(&addr,0,sizeof(addr)); + addr.sun_family = AF_UNIX; + strncpy(addr.sun_path,path,sizeof(addr.sun_path)-1); + unlink(path); + if((sock = socket(AF_UNIX,SOCK_STREAM,0)) < 0 || + bind(sock,(struct sockaddr*)&addr,sizeof(addr)) < 0) { + err = errno; + close(sock); + Ns_SetSockErrno(err); + sock = -1; + } + return sock; + } + /* *************** *** 114,118 **** NsInitBinder(void) { ! Tcl_InitHashTable(&prebound, sizeof(struct sockaddr_in)/sizeof(int)); } --- 296,303 ---- NsInitBinder(void) { ! Tcl_InitHashTable(&preboundTcp, sizeof(struct sockaddr_in)/sizeof(int)); ! Tcl_InitHashTable(&preboundUdp, sizeof(struct sockaddr_in)/sizeof(int)); ! Tcl_InitHashTable(&preboundRaw, TCL_ONE_WORD_KEYS); ! Tcl_InitHashTable(&preboundUnix, TCL_STRING_KEYS); } *************** *** 178,193 **** Ns_MutexLock(&lock); ! hPtr = Tcl_FirstHashEntry(&prebound, &search); while (hPtr != NULL) { ! saPtr = (struct sockaddr_in *) Tcl_GetHashKey(&prebound, hPtr); addr = ns_inet_ntoa(saPtr->sin_addr); port = htons(saPtr->sin_port); ! sock = (int) Tcl_GetHashValue(hPtr); ! Ns_Log(Warning, "prebind: closed unused: %s:%d = %d", addr, port, sock); close(sock); hPtr = Tcl_NextHashEntry(&search); } ! Tcl_DeleteHashTable(&prebound); ! Tcl_InitHashTable(&prebound, sizeof(struct sockaddr_in)/sizeof(int)); Ns_MutexUnlock(&lock); } --- 363,410 ---- Ns_MutexLock(&lock); ! hPtr = Tcl_FirstHashEntry(&preboundTcp, &search); while (hPtr != NULL) { ! saPtr = (struct sockaddr_in *) Tcl_GetHashKey(&preboundTcp, hPtr); addr = ns_inet_ntoa(saPtr->sin_addr); port = htons(saPtr->sin_port); ! sock = (int)Tcl_GetHashValue(hPtr); ! Ns_Log(Warning, "prebind: closed unused TCP: %s:%d = %d", addr, port, sock); close(sock); hPtr = Tcl_NextHashEntry(&search); } ! Tcl_DeleteHashTable(&preboundTcp); ! Tcl_InitHashTable(&preboundTcp, sizeof(struct sockaddr_in)/sizeof(int)); ! hPtr = Tcl_FirstHashEntry(&preboundUdp, &search); ! while (hPtr != NULL) { ! saPtr = (struct sockaddr_in *) Tcl_GetHashKey(&preboundUdp, hPtr); ! addr = ns_inet_ntoa(saPtr->sin_addr); ! port = htons(saPtr->sin_port); ! sock = (int)Tcl_GetHashValue(hPtr); ! Ns_Log(Warning, "prebind: closed unused UDP: %s:%d = %d", addr, port, sock); ! close(sock); ! hPtr = Tcl_NextHashEntry(&search); ! } ! Tcl_DeleteHashTable(&preboundUdp); ! Tcl_InitHashTable(&preboundUdp, sizeof(struct sockaddr_in)/sizeof(int)); ! hPtr = Tcl_FirstHashEntry(&preboundRaw, &search); ! while (hPtr != NULL) { ! sock = (int)Tcl_GetHashKey(&preboundRaw, hPtr); ! port = (int)Tcl_GetHashValue(hPtr); ! Ns_Log(Warning, "prebind: closed unused RAW: %d = %d", port, sock); ! close(sock); ! hPtr = Tcl_NextHashEntry(&search); ! } ! Tcl_DeleteHashTable(&preboundRaw); ! Tcl_InitHashTable(&preboundRaw, TCL_ONE_WORD_KEYS); ! hPtr = Tcl_FirstHashEntry(&preboundUnix, &search); ! while (hPtr != NULL) { ! addr = (char *) Tcl_GetHashKey(&preboundUnix, hPtr); ! sock = (int)Tcl_GetHashValue(hPtr); ! Ns_Log(Warning, "prebind: closed unused Unix: %s = %d", addr, sock); ! close(sock); ! hPtr = Tcl_NextHashEntry(&search); ! } ! Tcl_DeleteHashTable(&preboundUnix); ! Tcl_InitHashTable(&preboundUnix, TCL_STRING_KEYS); Ns_MutexUnlock(&lock); } *************** *** 200,204 **** * * Pre-bind to one or more ports in a comma-separated list. ! * * Results: * None. --- 417,424 ---- * * Pre-bind to one or more ports in a comma-separated list. ! * addr:port[/protocol] ! * port[/protocol] ! * 0/icmp[/count] ! * /path * Results: * None. *************** *** 217,266 **** int new, sock, port; struct sockaddr_in sa; ! char *err, *ent, *p, *q, *addr, *baddr; ! ent = line; ! do { ! p = strchr(ent, ','); ! if (p != NULL) { ! *p = '\0'; ! } ! baddr = NULL; ! addr = "0.0.0.0"; ! q = strchr(ent, ':'); ! if (q == NULL) { ! port = atoi(ent); ! } else { ! *q = '\0'; ! port = atoi(q+1); ! baddr = addr = ent; ! } ! if (port == 0) { ! err = "invalid port"; ! } else if (Ns_GetSockAddr(&sa, baddr, port) != NS_OK) { ! err = "invalid address"; ! } else { ! hPtr = Tcl_CreateHashEntry(&prebound, (char *) &sa, &new); ! if (!new) { ! err = "duplicate entry"; ! } else if ((sock = Ns_SockBind(&sa)) == -1) { ! Tcl_DeleteHashEntry(hPtr); ! err = strerror(errno); ! } else { ! Tcl_SetHashValue(hPtr, sock); ! err = NULL; ! } ! } ! if (q != NULL) { ! *q = ':'; ! } ! if (p != NULL) { ! *p++ = ','; ! } ! if (err != NULL) { ! Ns_Log(Error, "prebind: invalid entry: %s: %s", ent, err); ! } else { ! Ns_Log(Notice, "prebind: bound: %s", ent); ! } ! ent = p; ! } while (ent != NULL); } --- 437,539 ---- int new, sock, port; struct sockaddr_in sa; ! char *next, *str, *addr, *proto; ! for(;line != NULL;line = next) { ! if((next = strchr(line, ','))) { ! *next++ = '\0'; ! } ! proto = "tcp"; ! addr = "0.0.0.0"; ! /* Parse port */ ! if((str = strchr(line, ':'))) { ! *str++ = '\0'; ! port = atoi(str); ! addr = line; ! line = str; ! } else { ! port = atoi(line); ! } ! /* Parse protocol */ ! if(*line != '/' && (str = strchr(line,'/'))) { ! *str++ = '\0'; ! proto = str; ! } ! ! if(!strcmp(proto,"tcp") && port > 0) { ! if(Ns_GetSockAddr(&sa, addr, port) != NS_OK) { ! Ns_Log(Error, "prebind: tcp: invalid address: %s:%d",addr,port); ! continue; ! } ! hPtr = Tcl_CreateHashEntry(&preboundTcp, (char *) &sa, &new); ! if(!new) { ! Ns_Log(Error, "prebind: tcp: duplicate entry: %s:%d",addr,port); ! continue; ! } ! if((sock = Ns_SockBind(&sa)) == -1) { ! Ns_Log(Error, "prebind: tcp: %s:%d: %s",addr,port,strerror(errno)); ! Tcl_DeleteHashEntry(hPtr); ! continue; ! } ! Tcl_SetHashValue(hPtr, sock); ! Ns_Log(Notice, "prebind: tcp: %s:%d = %d", addr, port, sock); ! } ! ! if(!strcmp(proto,"udp") && port > 0) { ! if(Ns_GetSockAddr(&sa, addr, port) != NS_OK) { ! Ns_Log(Error, "prebind: udp: invalid address: %s:%d",addr,port); ! continue; ! } ! hPtr = Tcl_CreateHashEntry(&preboundUdp, (char *) &sa, &new); ! if(!new) { ! Ns_Log(Error, "prebind: udp: duplicate entry: %s:%d",addr,port); ! continue; ! } ! if((sock = Ns_SockBindUdp(&sa)) == -1) { ! Ns_Log(Error, "prebind: udp: %s:%d: %s",addr,port,strerror(errno)); ! Tcl_DeleteHashEntry(hPtr); ! continue; ! } ! Tcl_SetHashValue(hPtr, sock); ! Ns_Log(Notice, "prebind: udp: %s:%d = %d", addr, port, sock); ! } ! ! if(!strncmp(proto,"icmp",4)) { ! int count = 1; ! /* Parse count */ ! if((str = strchr(str,'/'))) { ! *(str++) = '\0'; ! count = atoi(str); ! } ! while(count--) { ! if((sock = Ns_SockRaw(IPPROTO_ICMP)) == -1) { ! Ns_Log(Error, "prebind: icmp: %s",strerror(errno)); ! continue; ! } ! hPtr = Tcl_CreateHashEntry(&preboundRaw, (char *) sock, &new); ! if(!new) { ! Ns_Log(Error, "prebind: icmp: duplicate entry"); ! close(sock); ! continue; ! } ! Tcl_SetHashValue(hPtr, IPPROTO_ICMP); ! Ns_Log(Notice, "prebind: icmp: %d", sock); ! } ! } ! ! if(*line == '/') { ! hPtr = Tcl_CreateHashEntry(&preboundUnix, (char *) line, &new); ! if(!new) { ! Ns_Log(Error, "prebind: unix: duplicate entry: %s",line); ! continue; ! } ! if((sock = Ns_SockListenUnix(line)) == -1) { ! Ns_Log(Error, "prebind: unix: %s: %s",proto,strerror(errno)); ! Tcl_DeleteHashEntry(hPtr); ! continue; ! } ! Tcl_SetHashValue(hPtr, sock); ! Ns_Log(Notice, "prebind: unix: %s = %d", line, sock); ! } ! } } + |
From: Vlad S. <ser...@us...> - 2005-02-16 15:06:00
|
Update of /cvsroot/naviserver/naviserver/nsdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13754/nsdb Modified Files: dbdrv.c Log Message: Binder suppport for different protocols added, supported TCP/UDP/ICMP/UNIX protocols. Added Ns_SockListenUdp,Ns_SockListenRaw,Ns_SockListenUnix functions. Backported sockopen command from 4.1 tree with -localhost/-localport options. db select will reuse exception which driver set otherwise will set standard error about wrong query. Index: dbdrv.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsdb/dbdrv.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** dbdrv.c 16 Feb 2005 08:40:44 -0000 1.1.1.1 --- dbdrv.c 16 Feb 2005 15:05:46 -0000 1.2 *************** *** 373,377 **** setPtr = Ns_DbBindRow(handle); } else { ! Ns_DbSetException(handle, "NSDB", "Query was not a statement returning rows."); } --- 373,378 ---- setPtr = Ns_DbBindRow(handle); } else { ! if(!handle->dsExceptionMsg.length) ! Ns_DbSetException(handle, "NSDB", "Query was not a statement returning rows."); } |
From: Vlad S. <ser...@us...> - 2005-02-16 15:05:59
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13754/include Modified Files: Makefile.global.in Makefile.module.in Log Message: Binder suppport for different protocols added, supported TCP/UDP/ICMP/UNIX protocols. Added Ns_SockListenUdp,Ns_SockListenRaw,Ns_SockListenUnix functions. Backported sockopen command from 4.1 tree with -localhost/-localport options. db select will reuse exception which driver set otherwise will set standard error about wrong query. Index: Makefile.global.in =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/Makefile.global.in,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile.global.in 16 Feb 2005 08:41:21 -0000 1.1.1.1 --- Makefile.global.in 16 Feb 2005 15:05:46 -0000 1.2 *************** *** 38,42 **** # ! AOLSERVER = @AOLSERVER@ srcdir = @SRCDIR@ --- 38,42 ---- # ! NAVISERVER = @NAVISERVER@ srcdir = @SRCDIR@ *************** *** 71,77 **** ifndef NSBUILD ! LDFLAGS += -L$(AOLSERVER)/lib LIBS += -lnsthread -lnsd ! INCDIR = $(AOLSERVER)/include else LDFLAGS += -L../nsthread -L../nsd --- 71,77 ---- ifndef NSBUILD ! LDFLAGS += -L$(NAVISERVER)/lib LIBS += -lnsthread -lnsd ! INCDIR = $(NAVISERVER)/include else LDFLAGS += -L../nsthread -L../nsd *************** *** 91,99 **** # Install directories ! INSTBIN = $(AOLSERVER)/bin ! INSTLIB = $(AOLSERVER)/lib ! INSTMOD = $(AOLSERVER)/modules ! INSTTCL = $(AOLSERVER)/modules/tcl ! INSTSRV = $(AOLSERVER)/servers/server1 INSTSRVMOD = $(INSTSRV)/modules INSTSRVPAG = $(INSTSRV)/pages --- 91,99 ---- # Install directories ! INSTBIN = $(NAVISERVER)/bin ! INSTLIB = $(NAVISERVER)/lib ! INSTMOD = $(NAVISERVER)/modules ! INSTTCL = $(NAVISERVER)/modules/tcl ! INSTSRV = $(NAVISERVER)/servers/server1 INSTSRVMOD = $(INSTSRV)/modules INSTSRVPAG = $(INSTSRV)/pages *************** *** 130,134 **** LDSO += -bundle_loader $(srcdir)/nsd/nsd else ! LDSO += -bundle_loader $(AOLSERVER)/bin/nsd endif endif --- 130,134 ---- LDSO += -bundle_loader $(srcdir)/nsd/nsd else ! LDSO += -bundle_loader $(NAVISERVER)/bin/nsd endif endif Index: Makefile.module.in =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/Makefile.module.in,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile.module.in 16 Feb 2005 08:41:20 -0000 1.1.1.1 --- Makefile.module.in 16 Feb 2005 15:05:46 -0000 1.2 *************** *** 36,40 **** # before including this file include: # ! # AOLSERVER AOLserver install directory. # MOD Name of module # MODOBJS List of module object files (required with MOD) --- 36,40 ---- # before including this file include: # ! # NAVISERVER naviserver install directory. # MOD Name of module # MODOBJS List of module object files (required with MOD) *************** *** 105,109 **** include ../include/Makefile.global else ! include $(AOLSERVER)/include/Makefile.global endif --- 105,109 ---- include ../include/Makefile.global else ! include $(NAVISERVER)/include/Makefile.global endif |
From: Vlad S. <ser...@us...> - 2005-02-16 15:05:54
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13754 Modified Files: configure Log Message: Binder suppport for different protocols added, supported TCP/UDP/ICMP/UNIX protocols. Added Ns_SockListenUdp,Ns_SockListenRaw,Ns_SockListenUnix functions. Backported sockopen command from 4.1 tree with -localhost/-localport options. db select will reuse exception which driver set otherwise will set standard error about wrong query. Index: configure =================================================================== RCS file: /cvsroot/naviserver/naviserver/configure,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** configure 16 Feb 2005 08:38:46 -0000 1.1.1.1 --- configure 16 Feb 2005 15:05:45 -0000 1.2 *************** *** 12,16 **** ac_default_prefix=/usr/local # Any additions from configure.in: ! ac_default_prefix=/usr/local/aolserver ac_help="$ac_help --with-tcl directory containing tcl configuration (tclConfig.sh)" --- 12,16 ---- ac_default_prefix=/usr/local # Any additions from configure.in: ! ac_default_prefix=/usr/local/ns ac_help="$ac_help --with-tcl directory containing tcl configuration (tclConfig.sh)" *************** *** 996,1003 **** # ! # TCL_SHLIB_LD from tclConfig.sh is not quite right for aolserver. # ! test "x$prefix" = "xNONE" && prefix="/usr/local/aolserver" system=`uname` case "$system" in --- 996,1003 ---- # ! # TCL_SHLIB_LD from tclConfig.sh is not quite right for naviserver. # ! test "x$prefix" = "xNONE" && prefix="/usr/local/ns" system=`uname` case "$system" in *************** *** 1043,1047 **** esac SRCDIR=`cd $srcdir; pwd` ! AOLSERVER=$prefix --- 1043,1047 ---- esac SRCDIR=`cd $srcdir; pwd` ! NAVISERVER=$prefix *************** *** 1056,1060 **** # ! # Additional AOLserver checks. # --- 1056,1060 ---- # ! # Additional naviserver checks. # *************** *** 2165,2169 **** s%@CCRPATHS@%$CCRPATHS%g s%@LDRPATHS@%$LDRPATHS%g ! s%@AOLSERVER@%$AOLSERVER%g s%@CPP@%$CPP%g s%@STATIC_BUILD@%$STATIC_BUILD%g --- 2165,2169 ---- s%@CCRPATHS@%$CCRPATHS%g s%@LDRPATHS@%$LDRPATHS%g ! s%@NAVISERVER@%$NAVISERVER%g s%@CPP@%$CPP%g s%@STATIC_BUILD@%$STATIC_BUILD%g |