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-07-10 07:27:23
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29430/include Modified Files: ns.h Log Message: See ChangeLog Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ns.h 9 Jul 2005 02:16:30 -0000 1.31 --- ns.h 10 Jul 2005 07:27:12 -0000 1.32 *************** *** 69,72 **** --- 69,73 ---- #define NS_CONN_KEEPALIVE 32 #define NS_CONN_WRITE_ENCODED 64 + #define NS_CONN_CHUNKED 128 #define NS_CONN_MAXCLS 16 *************** *** 647,650 **** --- 648,653 ---- NS_EXTERN int Ns_ConnGetWriteEncodedFlag(Ns_Conn *conn); NS_EXTERN void Ns_ConnSetWriteEncodedFlag(Ns_Conn *conn, int flag); + NS_EXTERN int Ns_ConnGetChunkedFlag(Ns_Conn *conn); + NS_EXTERN void Ns_ConnSetChunkedFlag(Ns_Conn *conn, int flag); NS_EXTERN void Ns_ConnSetUrlEncoding(Ns_Conn *conn, Tcl_Encoding encoding); NS_EXTERN int Ns_SetConnLocationProc(Ns_ConnLocationProc *proc, void *arg); |
From: Vlad S. <ser...@us...> - 2005-07-10 07:27:23
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29430 Modified Files: ChangeLog Log Message: See ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.158 retrieving revision 1.159 diff -C2 -d -r1.158 -r1.159 *** ChangeLog 9 Jul 2005 02:16:29 -0000 1.158 --- ChangeLog 10 Jul 2005 07:27:12 -0000 1.159 *************** *** 1,4 **** --- 1,16 ---- 2005-07-08 Vlad Seryakov <ser...@us...> + * include/ns.h: + * nsd/fastpath.c: + * nsd/return.c: + * nsd/connio.c: + * nsd/conn.c: Added support for chunked encoding using conn flag + NS_CONN_CHUNKED. Once set, output routines (Ns_ConnReturnOpenFd|File|Channel and + Ns_ReturnData) will perform chunked encoding automatically instead of + raw data output. From Tcl ns_conn chunked command is available and + if called with third parameter 0 or 1 can set/unset conn flag. + + 2005-07-08 Vlad Seryakov <ser...@us...> + * nsd/nsd.h: * nsd/fastpath.c: |
From: Vlad S. <ser...@us...> - 2005-07-10 07:27:22
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29430/nsd Modified Files: conn.c connio.c fastpath.c return.c Log Message: See ChangeLog Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** fastpath.c 9 Jul 2005 02:16:30 -0000 1.17 --- fastpath.c 10 Jul 2005 07:27:13 -0000 1.18 *************** *** 866,874 **** return Ns_ConnReturnOpenFd(conn, rnPtr->status, type, fd, len); } ! Ns_ConnSetRequiredHeaders(conn, type, len); ! Ns_ConnQueueHeaders(conn, rnPtr->status); ! bufs[0].iov_base = data; ! bufs[0].iov_len = len; ! result = Ns_ConnSend(conn, bufs, 1); break; --- 866,870 ---- return Ns_ConnReturnOpenFd(conn, rnPtr->status, type, fd, len); } ! result = Ns_ConnReturnData(conn, rnPtr->status, data, len, type); break; *************** *** 878,882 **** * included in the reply */ - Ns_ConnPrintfHeaders(conn, "Content-range", "bytes %lu-%lu/%i", rnPtr->offsets[0].start, rnPtr->offsets[0].end, len); --- 874,877 ---- *************** *** 887,893 **** Ns_ConnSetRequiredHeaders(conn, type, rnPtr->offsets[0].size); Ns_ConnQueueHeaders(conn, rnPtr->status); ! bufs[0].iov_base = data + rnPtr->offsets[0].start; ! bufs[0].iov_len = rnPtr->offsets[0].size; ! result = Ns_ConnSend(conn, bufs, 1); break; --- 882,888 ---- Ns_ConnSetRequiredHeaders(conn, type, rnPtr->offsets[0].size); Ns_ConnQueueHeaders(conn, rnPtr->status); ! iovPtr->iov_base = data + rnPtr->offsets[0].start; ! iovPtr->iov_len = rnPtr->offsets[0].size; ! result = Ns_ConnSend(conn, iovPtr, 1); break; Index: return.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/return.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** return.c 6 Jul 2005 09:15:44 -0000 1.11 --- return.c 10 Jul 2005 07:27:13 -0000 1.12 *************** *** 159,185 **** } - static int - IsSetupForChunkedEncoding(Ns_Conn *conn) - { - int headerCount = 0; - int i; - Ns_Set* outHeaders; - - if (conn == NULL) - return 0; - - outHeaders = Ns_ConnOutputHeaders(conn); - headerCount = Ns_SetSize (outHeaders); - - if (outHeaders && headerCount) { - for (i = 0 ; i < headerCount ; i++) { - if ( !strcasecmp(Ns_SetKey (outHeaders, i), HTTP11_HDR_TE) && - !strcasecmp(Ns_SetValue (outHeaders, i), HTTP11_TE_CHUNKED) ) - return 1; - } - } - return 0; - } - /* --- 159,162 ---- *************** *** 191,195 **** * * Results: ! * None. * * Side effects: --- 168,172 ---- * * Results: ! * None. * * Side effects: *************** *** 209,213 **** char *value, *keep; char *key, *lengthHdr; - int doChunkEncoding = 0; /* --- 186,189 ---- *************** *** 222,229 **** } } ! doChunkEncoding = IsSetupForChunkedEncoding(conn); Ns_DStringPrintf(dsPtr, "HTTP/%s %d %s\r\n", ! doChunkEncoding ? "1.1" : "1.0", connPtr->responseStatus, reason); --- 198,226 ---- } } ! ! /* ! * Perform some checks to ensure proper use of chunked ! * encoding ! */ ! ! if ((connPtr->responseStatus == 204 || ! connPtr->responseStatus == 206 || ! connPtr->responseStatus == 304)) { ! conn->flags &= ~NS_CONN_CHUNKED; ! Ns_SetIDeleteKey(conn->outputheaders, "Transfer-encoding"); ! } ! ! /* ! * This connection has been marked to return in chunked encoding ! */ ! ! if (conn->flags & NS_CONN_CHUNKED) { ! Ns_ConnCondSetHeaders(conn, "Transfer-encoding", "chunked"); ! Ns_SetIDeleteKey(conn->outputheaders, "Content-length"); ! connPtr->responseLength = 0; ! } Ns_DStringPrintf(dsPtr, "HTTP/%s %d %s\r\n", ! (conn->flags & NS_CONN_CHUNKED) ? "1.1" : "1.0", connPtr->responseStatus, reason); *************** *** 255,262 **** connPtr->headers != NULL && connPtr->request != NULL && ! (( (connPtr->responseStatus >= 200 && connPtr->responseStatus < 300) && ! ((lengthHdr != NULL && ! connPtr->responseLength == length) || doChunkEncoding)) || ! (connPtr->responseStatus == 304 || connPtr->responseStatus == 201 || connPtr->responseStatus == 207) ) && (drvPtr->keepallmethods == NS_TRUE || STREQ(connPtr->request->method, "GET")) && --- 252,261 ---- connPtr->headers != NULL && connPtr->request != NULL && ! (((connPtr->responseStatus >= 200 && connPtr->responseStatus < 300) && ! ((lengthHdr != NULL && connPtr->responseLength == length) || ! (conn->flags & NS_CONN_CHUNKED)) ) || ! (connPtr->responseStatus == 304 || ! connPtr->responseStatus == 201 || ! connPtr->responseStatus == 207) ) && (drvPtr->keepallmethods == NS_TRUE || STREQ(connPtr->request->method, "GET")) && *************** *** 339,343 **** { Ns_ConnQueueHeaders(conn, status); ! return Ns_WriteConn(conn, NULL, 0); } --- 338,342 ---- { Ns_ConnQueueHeaders(conn, status); ! return Ns_ConnSend(conn, NULL, 0); } *************** *** 825,828 **** --- 824,838 ---- result = Ns_WriteConn(conn, data, len); if (result == NS_OK) { + + /* + * In chunked mode we must send the last chunk with zero size + */ + + if (len > 0 && (conn->flags & NS_CONN_CHUNKED)) { + result = Ns_WriteConn(conn, 0, 0); + } + } + + if (result == NS_OK) { result = Ns_ConnClose(conn); } Index: connio.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/connio.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** connio.c 9 Jul 2005 02:16:30 -0000 1.5 --- connio.c 10 Jul 2005 07:27:13 -0000 1.6 *************** *** 219,223 **** * * Side effects: ! * Stuff may be written * *---------------------------------------------------------------------- --- 219,224 ---- * * Side effects: ! * Stuff may be written. In chunked mode writing 0 bytes means ! * terminating chunked stream with zero chunk and ending CRLF * *---------------------------------------------------------------------- *************** *** 227,235 **** Ns_ConnWrite(Ns_Conn *conn, void *vbuf, int towrite) { ! struct iovec buf; ! buf.iov_base = vbuf; ! buf.iov_len = towrite; ! return Ns_ConnSend(conn, &buf, 1); } --- 228,264 ---- Ns_ConnWrite(Ns_Conn *conn, void *vbuf, int towrite) { ! int nsend; ! char hdr[32]; ! struct iovec buf[3]; ! if (!(conn->flags & NS_CONN_CHUNKED)) { ! ! buf[0].iov_base = vbuf; ! buf[0].iov_len = towrite; ! return Ns_ConnSend(conn, buf, 1); ! } ! ! /* ! * Send data as chunked: size CRLF data CRLF ! */ ! ! buf[0].iov_base = hdr; ! buf[0].iov_len = sprintf(hdr, "%x\r\n", towrite); ! buf[1].iov_base = vbuf; ! buf[1].iov_len = towrite; ! buf[2].iov_base = "\r\n"; ! buf[2].iov_len = 2; ! ! nsend = Ns_ConnSend(conn, buf, 3); ! ! /* ! * In chunked mode we actually sent more data ! * but Ns_WriteConn does not know about that ! */ ! ! if (nsend == buf[0].iov_len + buf[1].iov_len + buf[2].iov_len) { ! nsend = towrite; ! } ! return nsend; } *************** *** 404,410 **** *---------------------------------------------------------------------- * ! * Ns_ConnSendChannel, Fp, Fd -- * ! * Send an open channel, FILE, or fd. * * Results: --- 433,439 ---- *---------------------------------------------------------------------- * ! * Ns_ConnSendChannel, Fp, Fd, Buf -- * ! * Send an open channel, FILE, fd or memory buffer. * * Results: *************** *** 769,785 **** static int ! ConnSend(Ns_Conn *conn, int nsend, Tcl_Channel chan, FILE *fp, int fd) { ! int toread, nread, status; char buf[IOBUFSZ]; ! /* ! * Even if nsend is 0, ensure all queued data (like HTTP response ! * headers) get flushed. ! */ ! if (nsend == 0) { ! Ns_WriteConn(conn, NULL, 0); ! } ! status = NS_OK; while (status == NS_OK && nsend > 0) { --- 798,807 ---- static int ! ConnSend(Ns_Conn *conn, int tosend, Tcl_Channel chan, FILE *fp, int fd) { ! int nsend, toread, nread, status; char buf[IOBUFSZ]; ! nsend = tosend; status = NS_OK; while (status == NS_OK && nsend > 0) { *************** *** 807,810 **** --- 829,841 ---- } + /* + * Even if nsend is 0, ensure all queued data (like HTTP response + * headers) get flushed. + * In chunked mode we must send the last chunk with zero size + */ + + if (tosend == 0 || (conn->flags & NS_CONN_CHUNKED)) { + Ns_WriteConn(conn, 0, 0); + } return status; } Index: conn.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/conn.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** conn.c 30 Jun 2005 07:57:41 -0000 1.18 --- conn.c 10 Jul 2005 07:27:13 -0000 1.19 *************** *** 868,871 **** --- 868,920 ---- } + /* + *---------------------------------------------------------------------- + * + * Ns_ConnGetChunkedFlag -- + * + * Is the given connection set for chunked encoded writes. + * + * Results: + * Boolean + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + + int + Ns_ConnGetChunkedFlag(Ns_Conn *conn) + { + return (conn->flags & NS_CONN_CHUNKED) ? NS_TRUE : NS_FALSE; + } + + + /* + *---------------------------------------------------------------------- + * + * Ns_ConnSetChunkedFlag -- + * + * Set the given connection chunked encoding flag per parameter. + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + + void + Ns_ConnSetChunkedFlag(Ns_Conn *conn, int flag) + { + if (flag) { + conn->flags |= NS_CONN_CHUNKED; + } else { + conn->flags &= ~NS_CONN_CHUNKED; + } + } + /* *************** *** 910,913 **** --- 959,963 ---- "query", "request", "server", "sock", "start", "status", "url", "urlc", "urlencoding", "urlv", "version", "write_encoded", + "chunked", NULL }; *************** *** 920,924 **** CPeerPortIdx, CPortIdx, CProtocolIdx, CQueryIdx, CRequestIdx, CServerIdx, CSockIdx, CStartIdx, CStatusIdx, CUrlIdx, ! CUrlcIdx, CUrlEncodingIdx, CUrlvIdx, CVersionIdx, CWriteEncodedIdx }; --- 970,975 ---- CPeerPortIdx, CPortIdx, CProtocolIdx, CQueryIdx, CRequestIdx, CServerIdx, CSockIdx, CStartIdx, CStatusIdx, CUrlIdx, ! CUrlcIdx, CUrlEncodingIdx, CUrlvIdx, CVersionIdx, CWriteEncodedIdx, ! CChunkedIdx }; *************** *** 1147,1150 **** --- 1198,1218 ---- break; + case CChunkedIdx: + if (objc > 2) { + int chunked_flag; + if (Tcl_GetIntFromObj(interp, objv[2], &chunked_flag) + != TCL_OK) { + Tcl_AppendResult(interp, "Invalid chunked flag", NULL ); + return TCL_ERROR; + } + Ns_ConnSetChunkedFlag(conn, chunked_flag); + } + if (Ns_ConnGetChunkedFlag(conn)) { + Tcl_SetIntObj(result, 1); + } else { + Tcl_SetIntObj(result, 0); + } + break; + case CRequestIdx: Tcl_SetResult(interp, request->line, TCL_STATIC); |
From: Vlad S. <ser...@us...> - 2005-07-09 02:16:59
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31471 Modified Files: ChangeLog Log Message: See ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.157 retrieving revision 1.158 diff -C2 -d -r1.157 -r1.158 *** ChangeLog 8 Jul 2005 18:09:37 -0000 1.157 --- ChangeLog 9 Jul 2005 02:16:29 -0000 1.158 *************** *** 11,14 **** --- 11,21 ---- Content-length header. + * include/ns.h: + * nsd/fastpath.c: + * nsd/connio.c: Introducing NS_CONN_MAXBUFS parameters which is set + to 16 by default. It defines how many iov buffers Ns_ConnSend can to use + simultaneously and max number of ranges nsd supports which is + NS_CONN_MAXBUFS/3 + 2005-07-06 Stephen Deasey <sd...@us...> |
From: Vlad S. <ser...@us...> - 2005-07-09 02:16:56
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31471/include Modified Files: ns.h Log Message: See ChangeLog Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ns.h 6 Jul 2005 08:45:52 -0000 1.30 --- ns.h 9 Jul 2005 02:16:30 -0000 1.31 *************** *** 71,74 **** --- 71,75 ---- #define NS_CONN_MAXCLS 16 + #define NS_CONN_MAXBUFS 16 #define NS_AOLSERVER_3_PLUS |
From: Vlad S. <ser...@us...> - 2005-07-09 02:16:43
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31471/nsd Modified Files: connio.c fastpath.c Log Message: See ChangeLog Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** fastpath.c 8 Jul 2005 18:18:03 -0000 1.16 --- fastpath.c 9 Jul 2005 02:16:30 -0000 1.17 *************** *** 41,48 **** /* * The following structure defines the offsets parsed ! * from Range: request heqder */ ! #define MAX_RANGES 5 typedef struct { --- 41,48 ---- /* * The following structure defines the offsets parsed ! * from Range: request header */ ! #define MAX_RANGES (NS_CONN_MAXBUFS/3) typedef struct { *************** *** 846,851 **** * Side effects: * May set numerous headers, will close connection. ! * MAX_RANGES*3 should be less than 16, because Ns_ConnSend ! * currently supports 16 iov buffers only. * *---------------------------------------------------------------------- --- 846,850 ---- * Side effects: * May set numerous headers, will close connection. ! * MAX_RANGES depends on NS_CONN_MAXBUFS which is used by Ns_ConnSend * *---------------------------------------------------------------------- Index: connio.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/connio.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** connio.c 6 Jul 2005 07:12:17 -0000 1.4 --- connio.c 9 Jul 2005 02:16:30 -0000 1.5 *************** *** 132,136 **** Conn *connPtr = (Conn *) conn; int nwrote, towrite, i, n; ! struct iovec sbufs[16]; if (connPtr->sockPtr == NULL) { --- 132,136 ---- Conn *connPtr = (Conn *) conn; int nwrote, towrite, i, n; ! struct iovec sbufs[NS_CONN_MAXBUFS]; if (connPtr->sockPtr == NULL) { *************** *** 139,143 **** /* ! * Send up to 16 buffers, including the queued output * buffer if necessary. */ --- 139,143 ---- /* ! * Send up to NS_CONN_MAXBUFS(16) buffers, including the queued output * buffer if necessary. */ *************** *** 151,155 **** ++n; } ! for (i = 0; i < nbufs && n < 16; ++i) { if (bufs[i].iov_len > 0 && bufs[i].iov_base != NULL) { sbufs[n].iov_base = bufs[i].iov_base; --- 151,155 ---- ++n; } ! for (i = 0; i < nbufs && n < NS_CONN_MAXBUFS; ++i) { if (bufs[i].iov_len > 0 && bufs[i].iov_base != NULL) { sbufs[n].iov_base = bufs[i].iov_base; |
From: Vlad S. <ser...@us...> - 2005-07-08 18:18:26
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1626/tests Modified Files: test.nscfg Log Message: small bufgfix for non-mmap mode Index: test.nscfg =================================================================== RCS file: /cvsroot/naviserver/naviserver/tests/test.nscfg,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test.nscfg 27 Apr 2005 00:13:42 -0000 1.4 --- test.nscfg 8 Jul 2005 18:18:13 -0000 1.5 *************** *** 69,72 **** --- 69,74 ---- ns_param serverdir testserver ns_param pagedir pages + #ns_param mmap false + #ns_param cache false ns_section "ns/server/test/tcl" |
From: Vlad S. <ser...@us...> - 2005-07-08 18:18:23
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1626/nsd Modified Files: fastpath.c Log Message: small bufgfix for non-mmap mode Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** fastpath.c 8 Jul 2005 18:09:38 -0000 1.15 --- fastpath.c 8 Jul 2005 18:18:03 -0000 1.16 *************** *** 884,888 **** if (fd != -1) { lseek(fd, rnPtr->offsets[0].start, SEEK_SET); ! return Ns_ConnReturnOpenFd(conn, rnPtr->status, type, fd, len); } Ns_ConnSetRequiredHeaders(conn, type, rnPtr->offsets[0].size); --- 884,888 ---- if (fd != -1) { lseek(fd, rnPtr->offsets[0].start, SEEK_SET); ! return Ns_ConnReturnOpenFd(conn, rnPtr->status, type, fd, rnPtr->offsets[0].size); } Ns_ConnSetRequiredHeaders(conn, type, rnPtr->offsets[0].size); |
From: Vlad S. <ser...@us...> - 2005-07-08 18:09:55
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29913 Modified Files: ChangeLog Log Message: See ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.156 retrieving revision 1.157 diff -C2 -d -r1.156 -r1.157 *** ChangeLog 8 Jul 2005 16:24:05 -0000 1.156 --- ChangeLog 8 Jul 2005 18:09:37 -0000 1.157 *************** *** 7,12 **** mmap and return from fd modes. ! * nsd/fastpath.c: Changed to use iovec buffers from ! stack instead of dynamically allocating them. 2005-07-06 Stephen Deasey <sd...@us...> --- 7,13 ---- mmap and return from fd modes. ! * nsd/fastpath.c: ! * tests/http_byteranges.test: Updated to return correct ! Content-length header. 2005-07-06 Stephen Deasey <sd...@us...> |
From: Vlad S. <ser...@us...> - 2005-07-08 18:09:55
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29913/tests Modified Files: http_byteranges.test Log Message: See ChangeLog Index: http_byteranges.test =================================================================== RCS file: /cvsroot/naviserver/naviserver/tests/http_byteranges.test,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** http_byteranges.test 8 Jul 2005 15:38:27 -0000 1.7 --- http_byteranges.test 8 Jul 2005 18:09:39 -0000 1.8 *************** *** 119,125 **** test byteranges-2.3 {Multiple non-contiguous ranges} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-2,7-9} \ ! -getheaders {Content-type Content-range} \ GET /10bytes ! } -match regexp -result [list 206 {multipart/byteranges; boundary=[^ ]+} {} \ {--[^ ]+\r Content-type: \*/\*\r --- 119,125 ---- test byteranges-2.3 {Multiple non-contiguous ranges} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-2,7-9} \ ! -getheaders {Content-type Content-range Content-length} \ GET /10bytes ! } -match regexp -result [list 206 {multipart/byteranges; boundary=[^ ]+} {} 154 \ {--[^ ]+\r Content-type: \*/\*\r *************** *** 137,143 **** test byteranges-2.4 {Multiple ranges, out of order} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=7-9,0-2} \ ! -getheaders {Content-type Content-range} \ GET /10bytes ! } -match regexp -result [list 206 {multipart/byteranges; boundary=[^ ]+} {} \ {--[^ ]+\r Content-type: \*/\*\r --- 137,143 ---- test byteranges-2.4 {Multiple ranges, out of order} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=7-9,0-2} \ ! -getheaders {Content-type Content-range Content-length} \ GET /10bytes ! } -match regexp -result [list 206 {multipart/byteranges; boundary=[^ ]+} {} 154 \ {--[^ ]+\r Content-type: \*/\*\r |
From: Vlad S. <ser...@us...> - 2005-07-08 18:09:55
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29913/nsd Modified Files: fastpath.c Log Message: See ChangeLog Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** fastpath.c 8 Jul 2005 16:24:17 -0000 1.14 --- fastpath.c 8 Jul 2005 18:09:38 -0000 1.15 *************** *** 894,919 **** default: sprintf(boundary,"%lu",now); /* Multiple ranges, return as multipart/byterange */ Ns_ConnPrintfHeaders(conn, "Content-type","multipart/byteranges; boundary=%s", boundary); ! Ns_ConnSetRequiredHeaders(conn, type, -1); ! Ns_ConnQueueHeaders(conn, rnPtr->status); ! Ns_DStringInit(&ds); ! /* ! * For mmap mode create 3 iovec structures for each range to ! * contain headers, data and closing boundary and send all ! * iov buffers for all ranges at once ! * ! * For fd mode, re-use the same iov struct and send headers and ! * file contents one after another for all ranges */ for (i = 0;i < rnPtr->count;i++) { ! if (fd == -1) { ! /* Point to first iov struct for the given index */ ! iovPtr = &bufs[i*3]; ! } /* First io vector in the triple will hold the headers */ iovPtr->iov_base = &ds.string[ds.length]; --- 894,916 ---- default: + Ns_DStringInit(&ds); sprintf(boundary,"%lu",now); /* Multiple ranges, return as multipart/byterange */ Ns_ConnPrintfHeaders(conn, "Content-type","multipart/byteranges; boundary=%s", boundary); ! /* ! * Use 3 iovec structures for each range to ! * contain starting boundary and headers, data and closing boundary ! * and send all iov buffers for all ranges at once in mmap mode or ! * in seperate calls for fd mode. */ + /* First pass, produce headers and calculate content length */ + rnPtr->size = 0; + for (i = 0;i < rnPtr->count;i++) { ! /* Point to first iov struct for the given index */ ! iovPtr = &bufs[i*3]; /* First io vector in the triple will hold the headers */ iovPtr->iov_base = &ds.string[ds.length]; *************** *** 923,932 **** rnPtr->offsets[i].start, rnPtr->offsets[i].end, len); iovPtr->iov_len = strlen(iovPtr->iov_base); ! /* In fd mode, we send headers and file contents */ ! if (fd != -1) { result = Ns_ConnSend(conn, iovPtr, 1); if (result == NS_ERROR) { break; } lseek(fd, rnPtr->offsets[i].start, SEEK_SET); result = Ns_ConnSendFd(conn, fd, rnPtr->offsets[i].size); --- 920,961 ---- rnPtr->offsets[i].start, rnPtr->offsets[i].end, len); iovPtr->iov_len = strlen(iovPtr->iov_base); ! rnPtr->size += iovPtr->iov_len; ! ! /* ! * Second io vector will contain actual range buffer offset and ! * size. It will be ignored in fd mode. ! */ ! ! iovPtr++; ! iovPtr->iov_base = data + rnPtr->offsets[i].start; ! iovPtr->iov_len = rnPtr->offsets[i].size; ! rnPtr->size += iovPtr->iov_len; ! ! /* Third io vector will hold closing boundary */ ! iovPtr++; ! iovPtr->iov_base = &ds.string[ds.length]; ! /* Last boundary should have trailing -- */ ! if (i == rnPtr->count - 1) { ! Ns_DStringPrintf(&ds,"\r\n--%s--",boundary); ! } ! Ns_DStringAppend(&ds,"\r\n"); ! iovPtr->iov_len = strlen(iovPtr->iov_base); ! rnPtr->size += iovPtr->iov_len; ! } ! ! /* Second pass, content length is ready, send http headers and data now */ ! Ns_ConnSetRequiredHeaders(conn, type, rnPtr->size); ! Ns_ConnQueueHeaders(conn, rnPtr->status); ! ! /* In fd mode, we send headers and file contents in separate calls */ ! if (fd != -1) { ! for (i = 0;i < rnPtr->count;i++) { ! /* Point iovPtr to headers iov buffer */ ! iovPtr = &bufs[i*3]; result = Ns_ConnSend(conn, iovPtr, 1); if (result == NS_ERROR) { break; } + /* Send file content directly from open fd */ lseek(fd, rnPtr->offsets[i].start, SEEK_SET); result = Ns_ConnSendFd(conn, fd, rnPtr->offsets[i].size); *************** *** 934,962 **** break; } ! } else { ! /* Second io vector will contain actual range buffer offset and size */ ! iovPtr++; ! iovPtr->iov_base = data + rnPtr->offsets[i].start; ! iovPtr->iov_len = rnPtr->offsets[i].size; ! iovPtr++; ! } ! /* Third io vector will hold closing boundary */ ! iovPtr->iov_base = &ds.string[ds.length]; ! /* Last boundary should have trailing -- */ ! if (i == rnPtr->count - 1) { ! Ns_DStringPrintf(&ds,"\r\n--%s--",boundary); ! } ! Ns_DStringAppend(&ds,"\r\n"); ! iovPtr->iov_len = strlen(iovPtr->iov_base); ! /* In fd mode send boundary immediately after the contents */ ! if (fd != -1) { result = Ns_ConnSend(conn, iovPtr, 1); if (result == NS_ERROR) { break; } ! } ! } ! /* In mmap mode we send all iov buffers at once */ ! if (fd == -1) { result = Ns_ConnSend(conn, bufs, rnPtr->count * 3); } --- 963,980 ---- break; } ! ! /* ! * Point iovPtr to the closing boundary iov buffer, ! * second iov buffer is not used in fd mode ! */ ! ! iovPtr += 2; result = Ns_ConnSend(conn, iovPtr, 1); if (result == NS_ERROR) { break; } ! } ! } else { ! /* In mmap mode we send all iov buffers at once */ result = Ns_ConnSend(conn, bufs, rnPtr->count * 3); } |
From: Vlad S. <ser...@us...> - 2005-07-08 16:24:27
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7852/nsd Modified Files: fastpath.c Log Message: using iovec buffers from stack instead of allocating them, size is not that big and memory fragmentation will cost more Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** fastpath.c 8 Jul 2005 15:38:27 -0000 1.13 --- fastpath.c 8 Jul 2005 16:24:17 -0000 1.14 *************** *** 855,859 **** ReturnRange(Ns_Conn *conn, Range *rnPtr, int fd, char *data, int len, char *type) { ! struct iovec buf, *bufs = 0, *iovPtr = &buf; int i,result = NS_ERROR; char boundary[32]; --- 855,859 ---- ReturnRange(Ns_Conn *conn, Range *rnPtr, int fd, char *data, int len, char *type) { ! struct iovec bufs[MAX_RANGES*3], *iovPtr = bufs; int i,result = NS_ERROR; char boundary[32]; *************** *** 869,875 **** Ns_ConnSetRequiredHeaders(conn, type, len); Ns_ConnQueueHeaders(conn, rnPtr->status); ! buf.iov_base = data; ! buf.iov_len = len; ! result = Ns_ConnSend(conn, &buf, 1); break; --- 869,875 ---- Ns_ConnSetRequiredHeaders(conn, type, len); Ns_ConnQueueHeaders(conn, rnPtr->status); ! bufs[0].iov_base = data; ! bufs[0].iov_len = len; ! result = Ns_ConnSend(conn, bufs, 1); break; *************** *** 888,894 **** Ns_ConnSetRequiredHeaders(conn, type, rnPtr->offsets[0].size); Ns_ConnQueueHeaders(conn, rnPtr->status); ! buf.iov_base = data + rnPtr->offsets[0].start; ! buf.iov_len = rnPtr->offsets[0].size; ! result = Ns_ConnSend(conn, &buf, 1); break; --- 888,894 ---- Ns_ConnSetRequiredHeaders(conn, type, rnPtr->offsets[0].size); Ns_ConnQueueHeaders(conn, rnPtr->status); ! bufs[0].iov_base = data + rnPtr->offsets[0].start; ! bufs[0].iov_len = rnPtr->offsets[0].size; ! result = Ns_ConnSend(conn, bufs, 1); break; *************** *** 911,917 **** */ - if (fd == -1) { - bufs = ns_malloc(sizeof(struct iovec) * rnPtr->count * 3); - } for (i = 0;i < rnPtr->count;i++) { if (fd == -1) { --- 911,914 ---- *************** *** 965,969 **** } Ns_DStringFree(&ds); - ns_free(bufs); break; } --- 962,965 ---- |
From: Vlad S. <ser...@us...> - 2005-07-08 16:24:26
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7852 Modified Files: ChangeLog Log Message: using iovec buffers from stack instead of allocating them, size is not that big and memory fragmentation will cost more Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.155 retrieving revision 1.156 diff -C2 -d -r1.155 -r1.156 *** ChangeLog 8 Jul 2005 15:38:26 -0000 1.155 --- ChangeLog 8 Jul 2005 16:24:05 -0000 1.156 *************** *** 7,10 **** --- 7,13 ---- mmap and return from fd modes. + * nsd/fastpath.c: Changed to use iovec buffers from + stack instead of dynamically allocating them. + 2005-07-06 Stephen Deasey <sd...@us...> |
From: Vlad S. <ser...@us...> - 2005-07-08 15:38:36
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16213/tests Modified Files: http_byteranges.test Log Message: See ChangeLog Index: http_byteranges.test =================================================================== RCS file: /cvsroot/naviserver/naviserver/tests/http_byteranges.test,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** http_byteranges.test 6 Jul 2005 00:47:36 -0000 1.6 --- http_byteranges.test 8 Jul 2005 15:38:27 -0000 1.7 *************** *** 105,119 **** ! test byteranges-2.1 {Multiple contiguous ranges} -constraints { ! serverListen knownBug ! } -body { nstest_http -getbody 1 -setheaders {Range bytes=0-2,3-6} \ -getheaders {Content-length Content-range} \ GET /10bytes ! } -result {206 6 {bytes 0-6/10} 012345} ! test byteranges-2.2 {Multiple contiguous ranges} -constraints { ! serverListen knownBug ! } -body { nstest_http -getbody 1 -setheaders {Range bytes=0-2,3-5,6-8} \ -getheaders {Content-length Content-range} \ --- 105,115 ---- ! test byteranges-2.1 {Multiple contiguous ranges} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-2,3-6} \ -getheaders {Content-length Content-range} \ GET /10bytes ! } -result {206 7 {bytes 0-6/10} 0123456} ! test byteranges-2.2 {Multiple contiguous ranges} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-2,3-5,6-8} \ -getheaders {Content-length Content-range} \ *************** *** 121,177 **** } -result {206 9 {bytes 0-8/10} 012345678} ! test byteranges-2.3 {Multiple non-canonical contiguous ranges} -constraints { ! serverListen knownBug ! } -body { ! nstest_http -getbody 1 -setheaders {Range bytes=0-2,3-6} \ ! -getheaders {Content-length Content-range} \ ! GET /10bytes ! } -result {206 6 {bytes 0-6/10} 012345} ! ! test byteranges-2.4 {Multiple non-contiguous ranges} -constraints { ! serverListen knownBug ! } -body { nstest_http -getbody 1 -setheaders {Range bytes=0-2,7-9} \ -getheaders {Content-type Content-range} \ GET /10bytes } -match regexp -result [list 206 {multipart/byteranges; boundary=[^ ]+} {} \ ! {[^ ]+\r Content-type: \*/\*\r Content-range: bytes 0-2/10\r 012\r --[^ ]+\r Content-type: \*/\*\r Content-range: bytes 7-9/10\r 789\r ! --[^ ]+-- }] ! test byteranges-2.5 {Multiple ranges, out of order} -constraints { ! serverListen knownBug ! } -body { nstest_http -getbody 1 -setheaders {Range bytes=7-9,0-2} \ ! -getheaders {Content-length Content-range} \ GET /10bytes } -match regexp -result [list 206 {multipart/byteranges; boundary=[^ ]+} {} \ ! {[^ ]+\r Content-type: \*/\*\r Content-range: bytes 7-9/10\r 789\r --[^ ]+\r Content-type: \*/\*\r Content-range: bytes 0-2/10\r 012\r ! --[^ ]+-- }] - test byteranges-2.6 { - Temporary: multiple ranges unsupported, just ignore. - } -constraints serverListen -body { - nstest_http -getbody 1 -setheaders {Range bytes=0-2,3-6} \ - -getheaders {Content-length Content-range} \ - GET /10bytes - } -result {200 10 {} 0123456789} - - test byteranges-3.1 {syntactically invalid} -constraints serverListen -body { --- 117,156 ---- } -result {206 9 {bytes 0-8/10} 012345678} ! test byteranges-2.3 {Multiple non-contiguous ranges} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-2,7-9} \ -getheaders {Content-type Content-range} \ GET /10bytes } -match regexp -result [list 206 {multipart/byteranges; boundary=[^ ]+} {} \ ! {--[^ ]+\r Content-type: \*/\*\r Content-range: bytes 0-2/10\r + \r 012\r --[^ ]+\r Content-type: \*/\*\r Content-range: bytes 7-9/10\r + \r 789\r ! --[^ ]+--\r }] ! test byteranges-2.4 {Multiple ranges, out of order} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=7-9,0-2} \ ! -getheaders {Content-type Content-range} \ GET /10bytes } -match regexp -result [list 206 {multipart/byteranges; boundary=[^ ]+} {} \ ! {--[^ ]+\r Content-type: \*/\*\r Content-range: bytes 7-9/10\r + \r 789\r --[^ ]+\r Content-type: \*/\*\r Content-range: bytes 0-2/10\r + \r 012\r ! --[^ ]+--\r }] test byteranges-3.1 {syntactically invalid} -constraints serverListen -body { |
From: Vlad S. <ser...@us...> - 2005-07-08 15:38:36
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16213/nsd Modified Files: fastpath.c nsd.h Log Message: See ChangeLog Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** fastpath.c 6 Jul 2005 00:47:36 -0000 1.12 --- fastpath.c 8 Jul 2005 15:38:27 -0000 1.13 *************** *** 39,43 **** NS_RCSID("@(#) $Header$"); ! #define MAX_RANGES 10 /* --- 39,60 ---- NS_RCSID("@(#) $Header$"); ! /* ! * The following structure defines the offsets parsed ! * from Range: request heqder ! */ ! ! #define MAX_RANGES 5 ! ! typedef struct { ! int status; /* Return status updated, 206 or 416 */ ! int count; /* Total number of valid ranges parsed */ ! struct { ! unsigned long start; /* Range start position */ ! unsigned long end; /* Range end position */ ! unsigned long size; /* Range absolute size in bytes */ ! } offsets[MAX_RANGES]; ! unsigned long size; /* Total file size */ ! unsigned long mtime; /* Last modification time */ ! } Range; /* *************** *** 63,68 **** static int FastReturn(NsServer *servPtr, Ns_Conn *conn, int status, char *type, char *file, struct stat *stPtr); ! static int ParseRange(Ns_Conn *conn, unsigned long size, unsigned long *offsets, ! int offsets_size); /* --- 80,85 ---- static int FastReturn(NsServer *servPtr, Ns_Conn *conn, int status, char *type, char *file, struct stat *stPtr); ! static int ParseRange(Ns_Conn *conn, Range *rnPtr); ! static int ReturnRange(Ns_Conn *conn, Range *rnPtr, int fd, char *data, int len, char *type); /* *************** *** 476,481 **** { int fd, new, nread; ! unsigned long size, offsets[MAX_RANGES*2]; ! int result = NS_ERROR, ranges = 0; char *key; Ns_Entry *entPtr; --- 493,498 ---- { int fd, new, nread; ! int result = NS_ERROR; ! Range range; char *key; Ns_Entry *entPtr; *************** *** 488,491 **** --- 505,516 ---- /* + * Initialize the structure for possible Range: requests + */ + + range.status = status; + range.size = stPtr->st_size; + range.mtime = stPtr->st_mtime; + + /* * Determine the mime type if not given. */ *************** *** 517,546 **** /* * Check if this is a Range: request, if so return requested ! * portion of the file. Range requests are not cached. */ ! size = stPtr->st_size; ! if (status == 200) { ! ranges = ParseRange(conn, stPtr->st_size, offsets, MAX_RANGES*2); ! } ! if (ranges == -1) { ! /* 416 Requested Range Not Satisfiable */ ! Ns_ConnPrintfHeaders(conn, "Content-Range", "bytes */%lu", ! stPtr->st_size); ! Ns_ConnSetRequiredHeaders(conn, type, (int) stPtr->st_size); ! return Ns_ConnFlushHeaders(conn, 416); ! } ! if (ranges == 1) { ! /* Continue with returning a portion of the file */ ! Ns_ConnPrintfHeaders(conn, "Content-Range", "bytes %lu-%lu/%lu", ! offsets[0], offsets[1], stPtr->st_size); ! size = (offsets[1] - offsets[0]) + 1; ! /* 206 Partial Content */ ! status = 206; } if (servPtr->fastpath.cache == NULL ! || stPtr->st_size > servPtr->fastpath.cachemaxentry ! || ranges == 1) { /* --- 542,555 ---- /* * Check if this is a Range: request, if so return requested ! * portion(s) of the file. */ ! if (ParseRange(conn, &range) == NS_ERROR) { ! Ns_ConnPrintfHeaders(conn, "Content-Range", "bytes */%lu", range.size); ! return Ns_ConnReturnStatus(conn, range.status); } if (servPtr->fastpath.cache == NULL ! || stPtr->st_size > servPtr->fastpath.cachemaxentry) { /* *************** *** 553,561 **** if (servPtr->fastpath.mmap && NsMemMap(file, stPtr->st_size, NS_MMAP_READ, &fmap) == NS_OK) { ! char *maddr = fmap.addr; ! if (ranges > 0) { ! maddr += offsets[0]; ! } ! result = Ns_ConnReturnData(conn,status, maddr, size, type); NsMemUmap(&fmap); } else { --- 562,566 ---- if (servPtr->fastpath.mmap && NsMemMap(file, stPtr->st_size, NS_MMAP_READ, &fmap) == NS_OK) { ! result = ReturnRange(conn, &range, -1, fmap.addr, fmap.size, type); NsMemUmap(&fmap); } else { *************** *** 566,573 **** goto notfound; } ! if (ranges > 0) { ! lseek(fd, offsets[0], SEEK_SET); ! } ! result = Ns_ConnReturnOpenFd(conn, status, type, fd, size); close(fd); } --- 571,575 ---- goto notfound; } ! result = ReturnRange(conn, &range, fd, 0, stPtr->st_size, type); close(fd); } *************** *** 642,647 **** ++filePtr->refcnt; Ns_CacheUnlock(servPtr->fastpath.cache); ! result = Ns_ConnReturnData(conn, status, filePtr->bytes, ! filePtr->size, type); Ns_CacheLock(servPtr->fastpath.cache); DecrEntry(filePtr); --- 644,648 ---- ++filePtr->refcnt; Ns_CacheUnlock(servPtr->fastpath.cache); ! result = ReturnRange(conn, &range, -1, filePtr->bytes, filePtr->size, type); Ns_CacheLock(servPtr->fastpath.cache); DecrEntry(filePtr); *************** *** 689,699 **** * * Checks for presence of Range: header, parses it and returns ! * the requested offsets * * Results: ! * -1 on error, number of byte ranges parsed * * Side effects: ! * First range specification is honored only * *---------------------------------------------------------------------- --- 690,705 ---- * * Checks for presence of Range: header, parses it and returns ! * the requested offsets. ! * * * Results: ! * NS_ERROR if byte-range is syntactically correct but unsatisfiable ! * NS_OK otherwise and rnPtr->count will contain number of byte ranges ! * parsed. * * Side effects: ! * - All byte-range-sets beyond MAX_RANGES will be ignored ! * - range->count will be updated with number of byte-range-sets parsed ! * - range->status may be updated with 206 or 416 codes * *---------------------------------------------------------------------- *************** *** 701,780 **** static int ! ParseRange(Ns_Conn *conn, unsigned long size, unsigned long *offsets, ! int offsets_size) { ! int count = 0; ! char *range; ! if ((range = Ns_SetIGet(conn->headers, "Range")) == NULL ! || (range = strstr(range,"bytes=")) == NULL) { ! return 0; } ! range += 6; ! memset(offsets,0,sizeof(unsigned long)*offsets_size); ! while(*range && count < offsets_size-1) { ! if (isdigit(*range)) { ! offsets[count] = atol(range); ! while (isdigit(*range)) range++; ! if (*range == '-') { ! range++; ! if (!isdigit(*range)) { ! offsets[count+1] = size - 1; } else { ! offsets[count+1] = atol(range); ! if (offsets[count] > offsets[count+1]) { ! return 0; } ! if (offsets[count+1] >= size) { ! offsets[count+1] = size - 1; } ! while (isdigit(*range)) range++; } ! switch (*range) { case ',': ! range++; case '\0': break; default: ! return 0; } ! if (offsets[count] > offsets[count+1]) { ! return -1; } ! count += 2; continue; } ! } else if (*range == '-') { ! range++; ! if (!isdigit(*range)) { ! return 0; } ! offsets[count+1] = atol(range); ! if (offsets[count+1] > size) { ! offsets[count+1] = size; } ! /* Size from the end requested, convert into offset */ ! offsets[count] = size - offsets[count+1]; ! offsets[count+1] = offsets[count] + offsets[count+1] - 1; ! while (isdigit(*range)) range++; ! switch (*range) { case ',': ! range++; case '\0': break; default: ! return 0; } ! if (offsets[count] > offsets[count+1]) { ! return -1; } ! count += 2; continue; } /* Invalid syntax */ ! return 0; } ! return count/2; } --- 707,975 ---- static int ! ParseRange(Ns_Conn *conn, Range *rnPtr) { ! int idx = 0; ! char *str; ! rnPtr->count = 0; ! if ((str = Ns_SetIGet(conn->headers, "Range")) == NULL ! || (str = strstr(str,"bytes=")) == NULL) { ! return NS_OK; } ! str += 6; ! while(*str && idx < MAX_RANGES-1) { ! /* ! * Parse the format: first-byte-pos "-" last-byte-pos ! * The byte positions specified are inclusive. Byte count start at zero. ! */ ! if (isdigit(*str)) { ! rnPtr->offsets[idx].start = atol(str); ! while (isdigit(*str)) str++; ! if (*str == '-') { ! str++; ! if (!isdigit(*str)) { ! rnPtr->offsets[idx].end = rnPtr->size - 1; } else { ! rnPtr->offsets[idx].end = atol(str); ! if (rnPtr->offsets[idx].start > rnPtr->offsets[idx].end) { ! return NS_OK; } ! if (rnPtr->offsets[idx].end >= rnPtr->size) { ! rnPtr->offsets[idx].end = rnPtr->size - 1; } ! while (isdigit(*str)) str++; } ! /* At this point we have syntactically valid byte-str-set */ ! switch (*str) { case ',': ! str++; case '\0': break; default: ! return NS_OK; } ! /* Range is unsatisfiable */ ! if (rnPtr->offsets[idx].start > rnPtr->offsets[idx].end) { ! rnPtr->status = 416; ! return NS_ERROR; } ! /* Calculate range size */ ! rnPtr->offsets[idx].size = (rnPtr->offsets[idx].end - rnPtr->offsets[idx].start) + 1; ! idx++; continue; } ! } else if (*str == '-') { ! /* ! * Parse the format: "-" suffix-length ! * Specifies the last suffix-length bytes of an entity-body ! */ ! str++; ! if (!isdigit(*str)) { ! return NS_OK; } ! rnPtr->offsets[idx].end = atol(str); ! if (rnPtr->offsets[idx].end > rnPtr->size) { ! rnPtr->offsets[idx].end = rnPtr->size; } ! /* Size from the end requested, convert into count */ ! rnPtr->offsets[idx].start = rnPtr->size - rnPtr->offsets[idx].end; ! rnPtr->offsets[idx].end = rnPtr->offsets[idx].start + rnPtr->offsets[idx].end - 1; ! /* At this point we have syntactically valid byte-range-set */ ! while (isdigit(*str)) str++; ! switch (*str) { case ',': ! str++; case '\0': break; default: ! return NS_OK; } ! /* Range is unsatisfiable */ ! if (rnPtr->offsets[idx].start > rnPtr->offsets[idx].end) { ! rnPtr->status = 416; ! return NS_ERROR; } ! /* Calculate range size */ ! rnPtr->offsets[idx].size = (rnPtr->offsets[idx].end - rnPtr->offsets[idx].start) + 1; ! idx++; continue; } /* Invalid syntax */ ! return NS_OK; } ! /* No valid ranges found */ ! if (idx == 0) { ! return NS_OK; ! } ! /* ! * Check for If-Range: header here because it depends on valid Range: ! * header, return the whole file if it has been changed ! */ ! str = Ns_SetIGet(conn->headers, "If-Range"); ! if (str != NULL && rnPtr->mtime > Ns_ParseHttpTime(str)) { ! return NS_OK; ! } ! /* ! * Tell the caller how many ranges are parsed and the what return code ! * should be used ! */ ! rnPtr->status = 206; ! rnPtr->count = idx; ! /* ! * Scan all offsets and see if they form one continious range ! */ ! for (idx = 1;idx < rnPtr->count;idx++) { ! if (rnPtr->offsets[idx].start - rnPtr->offsets[idx-1].end > 1) { ! break; ! } ! } ! /* It looks like they all one after another, use the first one */ ! if (idx == rnPtr->count) { ! rnPtr->offsets[0].end = rnPtr->offsets[idx - 1].end; ! rnPtr->offsets[0].size = (rnPtr->offsets[0].end - rnPtr->offsets[0].start) + 1; ! rnPtr->count = 1; ! } ! return NS_OK; } + /* + *---------------------------------------------------------------------- + * + * ReturnRange -- + * + * Sets required headers, dumps them, and then writes your data. + * + * Results: + * NS_OK/NS_ERROR + * + * Side effects: + * May set numerous headers, will close connection. + * MAX_RANGES*3 should be less than 16, because Ns_ConnSend + * currently supports 16 iov buffers only. + * + *---------------------------------------------------------------------- + */ + + static int + ReturnRange(Ns_Conn *conn, Range *rnPtr, int fd, char *data, int len, char *type) + { + struct iovec buf, *bufs = 0, *iovPtr = &buf; + int i,result = NS_ERROR; + char boundary[32]; + time_t now = time(0); + Ns_DString ds; + + switch (rnPtr->count) { + case 0: + /* No ranges, return all data */ + if (fd != -1) { + return Ns_ConnReturnOpenFd(conn, rnPtr->status, type, fd, len); + } + Ns_ConnSetRequiredHeaders(conn, type, len); + Ns_ConnQueueHeaders(conn, rnPtr->status); + buf.iov_base = data; + buf.iov_len = len; + result = Ns_ConnSend(conn, &buf, 1); + break; + + case 1: + /* + * For single byte-range-set, global Content-Range: header should be + * included in the reply + */ + + Ns_ConnPrintfHeaders(conn, "Content-range", "bytes %lu-%lu/%i", + rnPtr->offsets[0].start, rnPtr->offsets[0].end, len); + if (fd != -1) { + lseek(fd, rnPtr->offsets[0].start, SEEK_SET); + return Ns_ConnReturnOpenFd(conn, rnPtr->status, type, fd, len); + } + Ns_ConnSetRequiredHeaders(conn, type, rnPtr->offsets[0].size); + Ns_ConnQueueHeaders(conn, rnPtr->status); + buf.iov_base = data + rnPtr->offsets[0].start; + buf.iov_len = rnPtr->offsets[0].size; + result = Ns_ConnSend(conn, &buf, 1); + break; + + default: + sprintf(boundary,"%lu",now); + /* Multiple ranges, return as multipart/byterange */ + Ns_ConnPrintfHeaders(conn, "Content-type","multipart/byteranges; boundary=%s", + boundary); + Ns_ConnSetRequiredHeaders(conn, type, -1); + Ns_ConnQueueHeaders(conn, rnPtr->status); + Ns_DStringInit(&ds); + + /* + * For mmap mode create 3 iovec structures for each range to + * contain headers, data and closing boundary and send all + * iov buffers for all ranges at once + * + * For fd mode, re-use the same iov struct and send headers and + * file contents one after another for all ranges + */ + + if (fd == -1) { + bufs = ns_malloc(sizeof(struct iovec) * rnPtr->count * 3); + } + for (i = 0;i < rnPtr->count;i++) { + if (fd == -1) { + /* Point to first iov struct for the given index */ + iovPtr = &bufs[i*3]; + } + /* First io vector in the triple will hold the headers */ + iovPtr->iov_base = &ds.string[ds.length]; + Ns_DStringPrintf(&ds,"--%s\r\n",boundary); + Ns_DStringPrintf(&ds,"Content-type: %s\r\n",type); + Ns_DStringPrintf(&ds,"Content-range: bytes %lu-%lu/%i\r\n\r\n", + rnPtr->offsets[i].start, rnPtr->offsets[i].end, len); + iovPtr->iov_len = strlen(iovPtr->iov_base); + /* In fd mode, we send headers and file contents */ + if (fd != -1) { + result = Ns_ConnSend(conn, iovPtr, 1); + if (result == NS_ERROR) { + break; + } + lseek(fd, rnPtr->offsets[i].start, SEEK_SET); + result = Ns_ConnSendFd(conn, fd, rnPtr->offsets[i].size); + if (result == NS_ERROR) { + break; + } + } else { + /* Second io vector will contain actual range buffer offset and size */ + iovPtr++; + iovPtr->iov_base = data + rnPtr->offsets[i].start; + iovPtr->iov_len = rnPtr->offsets[i].size; + iovPtr++; + } + /* Third io vector will hold closing boundary */ + iovPtr->iov_base = &ds.string[ds.length]; + /* Last boundary should have trailing -- */ + if (i == rnPtr->count - 1) { + Ns_DStringPrintf(&ds,"\r\n--%s--",boundary); + } + Ns_DStringAppend(&ds,"\r\n"); + iovPtr->iov_len = strlen(iovPtr->iov_base); + /* In fd mode send boundary immediately after the contents */ + if (fd != -1) { + result = Ns_ConnSend(conn, iovPtr, 1); + if (result == NS_ERROR) { + break; + } + } + } + /* In mmap mode we send all iov buffers at once */ + if (fd == -1) { + result = Ns_ConnSend(conn, bufs, rnPtr->count * 3); + } + Ns_DStringFree(&ds); + ns_free(bufs); + break; + } + + if (result == NS_OK) { + result = Ns_ConnClose(conn); + } + return result; + } Index: nsd.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsd.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** nsd.h 6 Jul 2005 07:12:18 -0000 1.20 --- nsd.h 8 Jul 2005 15:38:27 -0000 1.21 *************** *** 1007,1010 **** --- 1007,1011 ---- extern int NsMemMap(char *path, int size, int mode, FileMap *mapPtr); extern void NsMemUmap(FileMap *mapPtr); + extern int Ns_ConnSend(Ns_Conn *conn, struct iovec *bufs, int nbufs); #ifndef _WIN32 |
From: Vlad S. <ser...@us...> - 2005-07-08 15:38:35
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16213 Modified Files: ChangeLog Log Message: See ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.154 retrieving revision 1.155 diff -C2 -d -r1.154 -r1.155 *** ChangeLog 7 Jul 2005 03:31:02 -0000 1.154 --- ChangeLog 8 Jul 2005 15:38:26 -0000 1.155 *************** *** 1,2 **** --- 1,10 ---- + 2005-07-08 Vlad Seryakov <ser...@us...> + + * nsd/nsd.h: + * nsd/fastpath.c: + * tests/http_byteranges.test: Implemented full byte ranges + support including If-Range and multiple ranges. Supports + mmap and return from fd modes. + 2005-07-06 Stephen Deasey <sd...@us...> |
From: Stephen D. <sd...@us...> - 2005-07-07 03:31:41
|
Update of /cvsroot/naviserver/naviserver/nsthread In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29273/nsthread Modified Files: tls.c Log Message: * nsd/tclinit.c: * nsthread/tls.c: Moved call to Tcl_FinalizeThread to end of TLS cleanup to better catch any cases of Tcl being used outside expected interfaces. Index: tls.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsthread/tls.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tls.c 10 Jun 2005 17:58:59 -0000 1.2 --- tls.c 7 Jul 2005 03:31:02 -0000 1.3 *************** *** 186,188 **** --- 186,189 ---- } } while (retry && trys++ < 5); + Tcl_FinalizeThread(); } |
From: Stephen D. <sd...@us...> - 2005-07-07 03:31:41
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29273/nsd Modified Files: tclinit.c Log Message: * nsd/tclinit.c: * nsthread/tls.c: Moved call to Tcl_FinalizeThread to end of TLS cleanup to better catch any cases of Tcl being used outside expected interfaces. Index: tclinit.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclinit.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tclinit.c 12 Jun 2005 14:42:44 -0000 1.7 --- tclinit.c 7 Jul 2005 03:31:02 -0000 1.8 *************** *** 1338,1343 **** Tcl_DeleteHashTable(tablePtr); ns_free(tablePtr); - - Tcl_FinalizeThread(); /* To call registered thread-exit handlers */ } --- 1338,1341 ---- |
From: Stephen D. <sd...@us...> - 2005-07-07 03:31:24
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29273 Modified Files: ChangeLog Log Message: * nsd/tclinit.c: * nsthread/tls.c: Moved call to Tcl_FinalizeThread to end of TLS cleanup to better catch any cases of Tcl being used outside expected interfaces. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.153 retrieving revision 1.154 diff -C2 -d -r1.153 -r1.154 *** ChangeLog 7 Jul 2005 01:29:02 -0000 1.153 --- ChangeLog 7 Jul 2005 03:31:02 -0000 1.154 *************** *** 1,4 **** --- 1,9 ---- 2005-07-06 Stephen Deasey <sd...@us...> + * nsd/tclinit.c: + * nsthread/tls.c: Moved call to Tcl_FinalizeThread to end of TLS + cleanup to better catch any cases of Tcl being used outside + expected interfaces. + * nsd/tclcmds.c: Alphabetize list of Tcl commands. |
From: Stephen D. <sd...@us...> - 2005-07-07 01:29:11
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27085/nsd Modified Files: tclcmds.c Log Message: Alphabetize list of Tcl commands. Index: tclcmds.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclcmds.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tclcmds.c 27 Jun 2005 17:46:56 -0000 1.16 --- tclcmds.c 7 Jul 2005 01:29:02 -0000 1.17 *************** *** 43,71 **** extern Tcl_ObjCmdProc NsTclAdpAppendObjCmd, ! NsTclAdpPutsObjCmd, NsTclAdpEvalObjCmd, ! NsTclAdpSafeEvalObjCmd, NsTclAdpIncludeObjCmd, NsTclAdpParseObjCmd, ! NsTclAdpDirObjCmd, NsTclAdpReturnObjCmd, ! NsTclAdpBreakObjCmd, ! NsTclAdpAbortObjCmd, NsTclAdpTellObjCmd, NsTclAdpTruncObjCmd, - NsTclAdpDumpObjCmd, - NsTclAdpArgcObjCmd, - NsTclAdpArgvObjCmd, - NsTclAdpBindArgsObjCmd, - NsTclAdpExceptionObjCmd, - NsTclAdpStreamObjCmd, - NsTclAdpMimeTypeObjCmd, - NsTclAdpCompressObjCmd, NsTclAfterObjCmd, NsTclAtExitObjCmd, - NsTclAtStartupObjCmd, NsTclAtShutdownObjCmd, NsTclAtSignalObjCmd, NsTclCancelObjCmd, NsTclChanObjCmd, --- 43,71 ---- extern Tcl_ObjCmdProc + NsTclAdpAbortObjCmd, NsTclAdpAppendObjCmd, ! NsTclAdpArgcObjCmd, ! NsTclAdpArgvObjCmd, ! NsTclAdpBindArgsObjCmd, ! NsTclAdpBreakObjCmd, ! NsTclAdpCompressObjCmd, ! NsTclAdpDirObjCmd, ! NsTclAdpDumpObjCmd, NsTclAdpEvalObjCmd, ! NsTclAdpExceptionObjCmd, NsTclAdpIncludeObjCmd, + NsTclAdpMimeTypeObjCmd, NsTclAdpParseObjCmd, ! NsTclAdpPutsObjCmd, NsTclAdpReturnObjCmd, ! NsTclAdpSafeEvalObjCmd, ! NsTclAdpStreamObjCmd, NsTclAdpTellObjCmd, NsTclAdpTruncObjCmd, NsTclAfterObjCmd, NsTclAtExitObjCmd, NsTclAtShutdownObjCmd, NsTclAtSignalObjCmd, + NsTclAtStartupObjCmd, NsTclCancelObjCmd, NsTclChanObjCmd, *************** *** 76,84 **** NsTclCpFpObjCmd, NsTclCpObjCmd, - NsTclCryptObjCmd, NsTclCritSecObjCmd, NsTclDeleteCookieObjCmd, NsTclDummyObjCmd, - NsTclICtlObjCmd, NsTclFTruncateObjCmd, NsTclGetAddrObjCmd, --- 76,83 ---- NsTclCpFpObjCmd, NsTclCpObjCmd, NsTclCritSecObjCmd, + NsTclCryptObjCmd, NsTclDeleteCookieObjCmd, NsTclDummyObjCmd, NsTclFTruncateObjCmd, NsTclGetAddrObjCmd, *************** *** 89,98 **** NsTclGmTimeObjCmd, NsTclGuessTypeObjCmd, - NsTclHashPathObjCmd, NsTclHTUUDecodeObjCmd, NsTclHTUUEncodeObjCmd, NsTclHeadersObjCmd, NsTclHttpObjCmd, NsTclHttpTimeObjCmd, NsTclInfoObjCmd, NsTclJobObjCmd, --- 88,98 ---- NsTclGmTimeObjCmd, NsTclGuessTypeObjCmd, NsTclHTUUDecodeObjCmd, NsTclHTUUEncodeObjCmd, + NsTclHashPathObjCmd, NsTclHeadersObjCmd, NsTclHttpObjCmd, NsTclHttpTimeObjCmd, + NsTclICtlObjCmd, NsTclInfoObjCmd, NsTclJobObjCmd, *************** *** 102,107 **** NsTclLocalTimeObjCmd, NsTclLocationProcObjCmd, - NsTclLogObjCmd, NsTclLogCtlObjCmd, NsTclLogRollObjCmd, NsTclMarkForDeleteObjCmd, --- 102,107 ---- NsTclLocalTimeObjCmd, NsTclLocationProcObjCmd, NsTclLogCtlObjCmd, + NsTclLogObjCmd, NsTclLogRollObjCmd, NsTclMarkForDeleteObjCmd, *************** *** 125,128 **** --- 125,129 ---- NsTclPauseObjCmd, NsTclPurgeFilesObjCmd, + NsTclRWLockObjCmd, NsTclRandObjCmd, NsTclRegisterAdpObjCmd, *************** *** 146,152 **** NsTclRmdirObjCmd, NsTclRollFileObjCmd, ! NsTclRWLockObjCmd, ! NsTclSchedObjCmd, NsTclSchedDailyObjCmd, NsTclSchedWeeklyObjCmd, NsTclSelectObjCmd, --- 147,153 ---- NsTclRmdirObjCmd, NsTclRollFileObjCmd, ! NsTclSHA1ObjCmd, NsTclSchedDailyObjCmd, + NsTclSchedObjCmd, NsTclSchedWeeklyObjCmd, NsTclSelectObjCmd, *************** *** 184,194 **** NsTclWriteContentObjCmd, NsTclWriteFpObjCmd, ! NsTclWriteObjCmd, ! NsTclSHA1ObjCmd; extern Tcl_CmdProc NsTclAdpDebugCmd, NsTclAdpRegisterAdpCmd, - NsTclAdpRegisterAdpCmd, NsTclAdpRegisterProcCmd, NsTclAdpStatsCmd, --- 185,193 ---- NsTclWriteContentObjCmd, NsTclWriteFpObjCmd, ! NsTclWriteObjCmd; extern Tcl_CmdProc NsTclAdpDebugCmd, NsTclAdpRegisterAdpCmd, NsTclAdpRegisterProcCmd, NsTclAdpStatsCmd, *************** *** 205,209 **** NsTclEncodingForCharsetCmd, NsTclEnvCmd, - NsTclEnvCmd, NsTclHrefsCmd, NsTclLibraryCmd, --- 204,207 ---- *************** *** 237,437 **** static Cmd cmds[] = { {"ns_crypt", NULL, NsTclCryptObjCmd}, ! {"ns_sleep", NULL, NsTclSleepObjCmd}, ! {"ns_localtime", NULL, NsTclLocalTimeObjCmd}, ! {"ns_gmtime", NULL, NsTclGmTimeObjCmd}, ! {"ns_time", NULL, NsTclTimeObjCmd}, {"ns_fmttime", NULL, NsTclStrftimeObjCmd}, {"ns_httptime", NULL, NsTclHttpTimeObjCmd}, - {"ns_parsehttptime", NULL, NsTclParseHttpTimeObjCmd}, - {"ns_parsequery", NULL, NsTclParseQueryObjCmd}, - - {"ns_rand", NULL, NsTclRandObjCmd}, - {"ns_info", NULL, NsTclInfoObjCmd}, ! ! {"ns_hashpath", NULL, NsTclHashPathObjCmd}, ! {"ns_modulepath", NULL, NsTclModulePathObjCmd}, ! {"ns_pagepath", NULL, NsTclPagePathObjCmd}, ! {"ns_serverpath", NULL, NsTclServerPathObjCmd}, ! ! {"ns_serverrootproc", NULL, NsTclServerRootProcObjCmd}, {"ns_locationproc", NULL, NsTclLocationProcObjCmd}, - - /* - * log.c - */ - {"ns_log", NULL, NsTclLogObjCmd}, {"ns_logctl", NULL, NsTclLogCtlObjCmd}, {"ns_logroll", NULL, NsTclLogRollObjCmd}, ! ! {"ns_urlencode", NULL, NsTclUrlEncodeObjCmd}, ! {"ns_urldecode", NULL, NsTclUrlDecodeObjCmd}, ! {"ns_uuencode", NULL, NsTclHTUUEncodeObjCmd}, ! {"ns_uudecode", NULL, NsTclHTUUDecodeObjCmd}, ! {"ns_base64encode", NULL, NsTclHTUUEncodeObjCmd}, ! {"ns_base64decode", NULL, NsTclHTUUDecodeObjCmd}, ! {"ns_gifsize", NULL, NsTclGifSizeObjCmd}, ! {"ns_jpegsize", NULL, NsTclJpegSizeObjCmd}, ! {"ns_guesstype", NULL, NsTclGuessTypeObjCmd}, ! ! /* ! * tclmisc.c ! */ ! ! {"ns_sha1", NULL, NsTclSHA1ObjCmd}, ! {"ns_striphtml", NsTclStripHtmlCmd, NULL}, ! {"ns_quotehtml", NsTclQuoteHtmlCmd, NULL}, ! {"ns_hrefs", NsTclHrefsCmd, NULL}, ! ! /* ! * tclcallbacks.c ! */ ! ! {"ns_atsignal", NULL, NsTclAtSignalObjCmd}, ! {"ns_atstartup", NULL, NsTclAtStartupObjCmd}, ! {"ns_atshutdown", NULL, NsTclAtShutdownObjCmd}, ! {"ns_atexit", NULL, NsTclAtExitObjCmd}, ! ! /* ! * tclconf.c ! */ ! ! {"ns_config", NsTclConfigCmd, NULL}, ! {"ns_configsection", NsTclConfigSectionCmd, NULL}, ! {"ns_configsections", NsTclConfigSectionsCmd, NULL}, ! ! /* ! * tclfile.c ! */ ! ! {"ns_unlink", NULL, NsTclUnlinkObjCmd}, {"ns_mkdir", NULL, NsTclMkdirObjCmd}, - {"ns_rmdir", NULL, NsTclRmdirObjCmd}, - {"ns_cp", NULL, NsTclCpObjCmd}, - {"ns_cpfp", NULL, NsTclCpFpObjCmd}, - {"ns_rollfile", NULL, NsTclRollFileObjCmd}, - {"ns_purgefiles", NULL, NsTclPurgeFilesObjCmd}, {"ns_mktemp", NsTclMkTempCmd, NULL}, ! {"ns_tmpnam", NULL, NsTclTmpNamObjCmd}, {"ns_normalizepath", NULL, NsTclNormalizePathObjCmd}, ! {"ns_link", NULL, NsTclLinkObjCmd}, ! {"ns_symlink", NULL, NsTclSymlinkObjCmd}, {"ns_rename", NULL, NsTclRenameObjCmd}, ! {"ns_kill", NULL, NsTclKillObjCmd}, ! {"ns_writefp", NULL, NsTclWriteFpObjCmd}, ! {"ns_truncate", NULL, NsTclTruncateObjCmd}, ! {"ns_ftruncate", NULL, NsTclFTruncateObjCmd}, ! {"ns_chmod", NULL, NsTclChmodObjCmd}, ! ! /* ! * tclenv.c ! */ ! ! {"ns_env", NsTclEnvCmd, NULL}, ! {"env", NsTclEnvCmd, NULL}, /* NB: Backwards compatible. */ ! ! /* ! * tcljob.c ! */ ! ! {"ns_job", NULL, NsTclJobObjCmd}, ! ! /* ! * tclhttp.c ! */ ! ! {"ns_http", NULL, NsTclHttpObjCmd}, ! ! /* ! * tclsched.c ! */ ! ! {"ns_schedule_proc", NULL, NsTclSchedObjCmd}, {"ns_schedule_daily", NULL, NsTclSchedDailyObjCmd}, {"ns_schedule_weekly", NULL, NsTclSchedWeeklyObjCmd}, ! {"ns_after", NULL, NsTclAfterObjCmd}, ! {"ns_cancel", NULL, NsTclCancelObjCmd}, ! {"ns_pause", NULL, NsTclPauseObjCmd}, ! {"ns_resume", NULL, NsTclResumeObjCmd}, ! {"ns_unschedule_proc", NULL, NsTclUnscheduleObjCmd}, ! ! /* ! * tclset.c ! */ ! {"ns_set", NULL, NsTclSetObjCmd}, ! {"ns_parseheader", NsTclParseHeaderCmd, NULL}, ! ! /* ! * tclsock.c ! */ ! {"ns_sockcallback", NULL, NsTclSockCallbackObjCmd}, {"ns_socklistencallback", NULL, NsTclSockListenCallbackObjCmd}, - {"ns_sockblocking", NULL, NsTclSockSetBlockingObjCmd}, {"ns_socknonblocking", NULL, NsTclSockSetNonBlockingObjCmd}, {"ns_socknread", NULL, NsTclSockNReadObjCmd}, {"ns_sockopen", NULL, NsTclSockOpenObjCmd}, {"ns_socklisten", NULL, NsTclSockListenObjCmd}, - {"ns_sockaccept", NULL, NsTclSockAcceptObjCmd}, - {"ns_sockcheck", NULL, NsTclSockCheckObjCmd}, {"ns_sockselect", NULL, NsTclSelectObjCmd}, ! {"ns_socketpair", NULL, NsTclSocketPairObjCmd}, ! {"ns_hostbyaddr", NULL, NsTclGetHostObjCmd}, ! {"ns_addrbyhost", NULL, NsTclGetAddrObjCmd}, ! ! /* ! * tclxkeylist.c ! */ ! ! {"keyldel", TclX_KeyldelObjCmd, NULL}, ! {"keylget", TclX_KeylgetObjCmd, NULL}, ! {"keylkeys", TclX_KeylkeysObjCmd, NULL}, ! {"keylset", TclX_KeylsetObjCmd, NULL}, ! ! /* ! * cache.c ! */ ! ! {"ns_cache_flush", NsTclCacheFlushCmd, NULL}, ! {"ns_cache_stats", NsTclCacheStatsCmd, NULL}, ! {"ns_cache_names", NsTclCacheNamesCmd, NULL}, ! {"ns_cache_size", NsTclCacheSizeCmd, NULL}, ! {"ns_cache_keys", NsTclCacheKeysCmd, NULL}, ! ! /* ! * tclthread.c ! */ ! {"ns_thread", NsTclThreadCmd, NULL}, ! {"ns_mutex", NULL, NsTclMutexObjCmd}, ! {"ns_cond", NULL, NsTclCondObjCmd}, ! {"ns_event", NULL, NsTclCondObjCmd}, ! {"ns_rwlock", NULL, NsTclRWLockObjCmd}, ! {"ns_sema", NULL, NsTclSemaObjCmd}, ! {"ns_critsec", NULL, NsTclCritSecObjCmd}, ! ! /* ! * tclinit.c ! */ ! ! {"ns_init", NULL, NsTclDummyObjCmd}, ! {"ns_cleanup", NULL, NsTclDummyObjCmd}, ! {"ns_markfordelete", NULL, NsTclMarkForDeleteObjCmd}, ! ! /* ! * encoding.c ! */ ! ! {"ns_charsets", NsTclCharsetsCmd, NULL}, ! {"ns_encodingforcharset", NsTclEncodingForCharsetCmd, NULL}, ! ! /* ! * tclobjv.c ! */ ! ! {"ns_parseargs", NULL, NsTclParseArgsObjCmd}, /* --- 235,345 ---- static Cmd cmds[] = { + {"env", NsTclEnvCmd, NULL}, + {"keyldel", TclX_KeyldelObjCmd, NULL}, + {"keylget", TclX_KeylgetObjCmd, NULL}, + {"keylkeys", TclX_KeylkeysObjCmd, NULL}, + {"keylset", TclX_KeylsetObjCmd, NULL}, + {"ns_addrbyhost", NULL, NsTclGetAddrObjCmd}, + {"ns_after", NULL, NsTclAfterObjCmd}, + {"ns_atexit", NULL, NsTclAtExitObjCmd}, + {"ns_atshutdown", NULL, NsTclAtShutdownObjCmd}, + {"ns_atsignal", NULL, NsTclAtSignalObjCmd}, + {"ns_atstartup", NULL, NsTclAtStartupObjCmd}, + {"ns_base64decode", NULL, NsTclHTUUDecodeObjCmd}, + {"ns_base64encode", NULL, NsTclHTUUEncodeObjCmd}, + {"ns_cache_flush", NsTclCacheFlushCmd, NULL}, + {"ns_cache_keys", NsTclCacheKeysCmd, NULL}, + {"ns_cache_names", NsTclCacheNamesCmd, NULL}, + {"ns_cache_size", NsTclCacheSizeCmd, NULL}, + {"ns_cache_stats", NsTclCacheStatsCmd, NULL}, + {"ns_cancel", NULL, NsTclCancelObjCmd}, + {"ns_charsets", NsTclCharsetsCmd, NULL}, + {"ns_chmod", NULL, NsTclChmodObjCmd}, + {"ns_cleanup", NULL, NsTclDummyObjCmd}, + {"ns_cond", NULL, NsTclCondObjCmd}, + {"ns_config", NsTclConfigCmd, NULL}, + {"ns_configsection", NsTclConfigSectionCmd, NULL}, + {"ns_configsections", NsTclConfigSectionsCmd, NULL}, + {"ns_cp", NULL, NsTclCpObjCmd}, + {"ns_cpfp", NULL, NsTclCpFpObjCmd}, + {"ns_critsec", NULL, NsTclCritSecObjCmd}, {"ns_crypt", NULL, NsTclCryptObjCmd}, ! {"ns_encodingforcharset", NsTclEncodingForCharsetCmd, NULL}, ! {"ns_env", NsTclEnvCmd, NULL}, ! {"ns_event", NULL, NsTclCondObjCmd}, ! {"ns_ftruncate", NULL, NsTclFTruncateObjCmd}, {"ns_fmttime", NULL, NsTclStrftimeObjCmd}, + {"ns_gifsize", NULL, NsTclGifSizeObjCmd}, + {"ns_gmtime", NULL, NsTclGmTimeObjCmd}, + {"ns_guesstype", NULL, NsTclGuessTypeObjCmd}, + {"ns_hashpath", NULL, NsTclHashPathObjCmd}, + {"ns_hostbyaddr", NULL, NsTclGetHostObjCmd}, + {"ns_hrefs", NsTclHrefsCmd, NULL}, + {"ns_http", NULL, NsTclHttpObjCmd}, {"ns_httptime", NULL, NsTclHttpTimeObjCmd}, {"ns_info", NULL, NsTclInfoObjCmd}, ! {"ns_init", NULL, NsTclDummyObjCmd}, ! {"ns_job", NULL, NsTclJobObjCmd}, ! {"ns_jpegsize", NULL, NsTclJpegSizeObjCmd}, ! {"ns_kill", NULL, NsTclKillObjCmd}, ! {"ns_link", NULL, NsTclLinkObjCmd}, ! {"ns_localtime", NULL, NsTclLocalTimeObjCmd}, {"ns_locationproc", NULL, NsTclLocationProcObjCmd}, {"ns_log", NULL, NsTclLogObjCmd}, {"ns_logctl", NULL, NsTclLogCtlObjCmd}, {"ns_logroll", NULL, NsTclLogRollObjCmd}, ! {"ns_markfordelete", NULL, NsTclMarkForDeleteObjCmd}, {"ns_mkdir", NULL, NsTclMkdirObjCmd}, {"ns_mktemp", NsTclMkTempCmd, NULL}, ! {"ns_modulepath", NULL, NsTclModulePathObjCmd}, ! {"ns_mutex", NULL, NsTclMutexObjCmd}, {"ns_normalizepath", NULL, NsTclNormalizePathObjCmd}, ! {"ns_pagepath", NULL, NsTclPagePathObjCmd}, ! {"ns_parseargs", NULL, NsTclParseArgsObjCmd}, ! {"ns_parseheader", NsTclParseHeaderCmd, NULL}, ! {"ns_parsehttptime", NULL, NsTclParseHttpTimeObjCmd}, ! {"ns_parsequery", NULL, NsTclParseQueryObjCmd}, ! {"ns_pause", NULL, NsTclPauseObjCmd}, ! {"ns_purgefiles", NULL, NsTclPurgeFilesObjCmd}, ! {"ns_quotehtml", NsTclQuoteHtmlCmd, NULL}, ! {"ns_rand", NULL, NsTclRandObjCmd}, {"ns_rename", NULL, NsTclRenameObjCmd}, ! {"ns_resume", NULL, NsTclResumeObjCmd}, ! {"ns_rmdir", NULL, NsTclRmdirObjCmd}, ! {"ns_rollfile", NULL, NsTclRollFileObjCmd}, ! {"ns_rwlock", NULL, NsTclRWLockObjCmd}, {"ns_schedule_daily", NULL, NsTclSchedDailyObjCmd}, + {"ns_schedule_proc", NULL, NsTclSchedObjCmd}, {"ns_schedule_weekly", NULL, NsTclSchedWeeklyObjCmd}, ! {"ns_sema", NULL, NsTclSemaObjCmd}, ! {"ns_serverpath", NULL, NsTclServerPathObjCmd}, ! {"ns_serverrootproc", NULL, NsTclServerRootProcObjCmd}, {"ns_set", NULL, NsTclSetObjCmd}, ! {"ns_sha1", NULL, NsTclSHA1ObjCmd}, ! {"ns_sleep", NULL, NsTclSleepObjCmd}, ! {"ns_sockaccept", NULL, NsTclSockAcceptObjCmd}, ! {"ns_sockblocking", NULL, NsTclSockSetBlockingObjCmd}, {"ns_sockcallback", NULL, NsTclSockCallbackObjCmd}, + {"ns_sockcheck", NULL, NsTclSockCheckObjCmd}, + {"ns_socketpair", NULL, NsTclSocketPairObjCmd}, {"ns_socklistencallback", NULL, NsTclSockListenCallbackObjCmd}, {"ns_socknonblocking", NULL, NsTclSockSetNonBlockingObjCmd}, {"ns_socknread", NULL, NsTclSockNReadObjCmd}, {"ns_sockopen", NULL, NsTclSockOpenObjCmd}, {"ns_socklisten", NULL, NsTclSockListenObjCmd}, {"ns_sockselect", NULL, NsTclSelectObjCmd}, ! {"ns_striphtml", NsTclStripHtmlCmd, NULL}, ! {"ns_symlink", NULL, NsTclSymlinkObjCmd}, {"ns_thread", NsTclThreadCmd, NULL}, ! {"ns_time", NULL, NsTclTimeObjCmd}, ! {"ns_tmpnam", NULL, NsTclTmpNamObjCmd}, ! {"ns_truncate", NULL, NsTclTruncateObjCmd}, ! {"ns_unlink", NULL, NsTclUnlinkObjCmd}, ! {"ns_unschedule_proc", NULL, NsTclUnscheduleObjCmd}, ! {"ns_urldecode", NULL, NsTclUrlDecodeObjCmd}, ! {"ns_urlencode", NULL, NsTclUrlEncodeObjCmd}, ! {"ns_uudecode", NULL, NsTclHTUUDecodeObjCmd}, ! {"ns_uuencode", NULL, NsTclHTUUEncodeObjCmd}, ! {"ns_writefp", NULL, NsTclWriteFpObjCmd}, /* *************** *** 448,587 **** static Cmd servCmds[] = { ! ! /* ! * tclrequest.c ! */ ! ! {"ns_register_filter", NULL, NsTclRegisterFilterObjCmd}, ! {"ns_register_trace", NULL, NsTclRegisterTraceObjCmd}, {"ns_register_adp", NULL, NsTclRegisterAdpObjCmd}, {"ns_register_proc", NULL, NsTclRegisterProcObjCmd}, ! {"ns_unregister_adp", NULL, NsTclUnRegisterObjCmd}, ! {"ns_unregister_proc", NULL, NsTclUnRegisterObjCmd}, ! {"ns_atclose", NsTclAtCloseCmd, NULL}, ! ! /* ! * tclresp.c ! */ ! ! {"ns_return", NULL, NsTclReturnObjCmd}, {"ns_respond", NULL, NsTclRespondObjCmd}, ! {"ns_returnfile", NULL, NsTclReturnFileObjCmd}, ! {"ns_returnfp", NULL, NsTclReturnFpObjCmd}, {"ns_returnbadrequest", NULL, NsTclReturnBadRequestObjCmd}, {"ns_returnerror", NULL, NsTclReturnErrorObjCmd}, {"ns_returnnotice", NULL, NsTclReturnNoticeObjCmd}, - {"ns_returnadminnotice", NULL, NsTclReturnNoticeObjCmd}, {"ns_returnredirect", NULL, NsTclReturnRedirectObjCmd}, - {"ns_headers", NULL, NsTclHeadersObjCmd}, - {"ns_write", NULL, NsTclWriteObjCmd}, - {"ns_connsendfp", NULL, NsTclConnSendFpObjCmd}, - {"ns_returnforbidden", NULL, NsTclReturnForbiddenObjCmd}, {"ns_returnunauthorized", NULL, NsTclReturnUnauthorizedObjCmd}, ! {"ns_returnnotfound", NULL, NsTclReturnNotFoundObjCmd}, ! ! /* ! * tclfile.c ! */ ! ! {"ns_chan", NULL, NsTclChanObjCmd}, ! {"ns_url2file", NULL, NsTclUrl2FileObjCmd}, ! ! ! {"ns_library", NsTclLibraryCmd, NULL}, ! {"ns_geturl", NULL, NsTclGetUrlObjCmd}, ! ! {"ns_checkurl", NULL, NsTclRequestAuthorizeObjCmd}, ! {"ns_requestauthorize", NULL, NsTclRequestAuthorizeObjCmd}, ! ! /* ! * tcladmin.c ! */ ! ! {"ns_shutdown", NULL, NsTclShutdownObjCmd}, ! ! /* ! * conn.c ! */ ! ! {"ns_conncptofp", NULL, NsTclWriteContentObjCmd}, ! {"ns_writecontent", NULL, NsTclWriteContentObjCmd}, ! {"ns_conn", NULL, NsTclConnObjCmd}, ! {"ns_startcontent", NULL, NsTclStartContentObjCmd}, ! ! /* ! * cookies.c ! */ ! ! {"ns_deletecookie", NULL, NsTclDeleteCookieObjCmd}, ! {"ns_getcookie", NULL, NsTclGetCookieObjCmd}, {"ns_setcookie", NULL, NsTclSetCookieObjCmd}, - - /* - * adpparse.c - */ - - {"ns_register_adptag", NsTclRegisterTagCmd, NULL}, - {"ns_adp_registeradp", NsTclAdpRegisterAdpCmd, NULL}, - {"ns_adp_registertag", NsTclAdpRegisterAdpCmd, NULL}, - {"ns_adp_registerproc", NsTclAdpRegisterProcCmd, NULL}, - - /* - * adpcmds.c - */ - - {"ns_adp_stats", NsTclAdpStatsCmd, NULL}, - {"ns_adp_debug", NsTclAdpDebugCmd, NULL}, - - {"_ns_adp_include", NULL, NsTclAdpIncludeObjCmd}, - {"ns_adp_eval", NULL, NsTclAdpEvalObjCmd}, - {"ns_adp_safeeval", NULL, NsTclAdpSafeEvalObjCmd}, - {"ns_adp_parse", NULL, NsTclAdpParseObjCmd}, - {"ns_puts", NULL, NsTclAdpPutsObjCmd}, - {"ns_adp_puts", NULL, NsTclAdpPutsObjCmd}, - {"ns_adp_append", NULL, NsTclAdpAppendObjCmd}, - {"ns_adp_dir", NULL, NsTclAdpDirObjCmd}, - {"ns_adp_return", NULL, NsTclAdpReturnObjCmd}, - {"ns_adp_break", NULL, NsTclAdpBreakObjCmd}, - {"ns_adp_abort", NULL, NsTclAdpAbortObjCmd}, - {"ns_adp_tell", NULL, NsTclAdpTellObjCmd}, - {"ns_adp_trunc", NULL, NsTclAdpTruncObjCmd}, - {"ns_adp_dump", NULL, NsTclAdpDumpObjCmd}, - {"ns_adp_argc", NULL, NsTclAdpArgcObjCmd}, - {"ns_adp_argv", NULL, NsTclAdpArgvObjCmd}, - {"ns_adp_bind_args", NULL, NsTclAdpBindArgsObjCmd}, - {"ns_adp_exception", NULL, NsTclAdpExceptionObjCmd}, - {"ns_adp_stream", NULL, NsTclAdpStreamObjCmd}, - {"ns_adp_mime", NULL, NsTclAdpMimeTypeObjCmd}, - {"ns_adp_mimetype", NULL, NsTclAdpMimeTypeObjCmd}, - {"ns_adp_compress", NULL, NsTclAdpCompressObjCmd}, - - /* - * tclvar.c - */ - {"ns_share", NsTclShareCmd, NULL}, {"ns_var", NULL, NsTclVarObjCmd}, ! {"nsv_get", NULL, NsTclNsvGetObjCmd}, {"nsv_exists", NULL, NsTclNsvExistsObjCmd}, ! {"nsv_set", NULL, NsTclNsvSetObjCmd}, {"nsv_incr", NULL, NsTclNsvIncrObjCmd}, - {"nsv_append", NULL, NsTclNsvAppendObjCmd}, {"nsv_lappend", NULL, NsTclNsvLappendObjCmd}, - {"nsv_array", NULL, NsTclNsvArrayObjCmd}, - {"nsv_unset", NULL, NsTclNsvUnsetObjCmd}, {"nsv_names", NULL, NsTclNsvNamesObjCmd}, ! ! /* ! * serv.c ! */ ! ! {"ns_server", NULL, NsTclServerObjCmd}, ! ! /* ! * tclinit.c ! */ ! ! {"ns_ictl", NULL, NsTclICtlObjCmd}, /* --- 356,436 ---- static Cmd servCmds[] = { ! {"_ns_adp_include", NULL, NsTclAdpIncludeObjCmd}, ! {"ns_adp_abort", NULL, NsTclAdpAbortObjCmd}, ! {"ns_adp_append", NULL, NsTclAdpAppendObjCmd}, ! {"ns_adp_argc", NULL, NsTclAdpArgcObjCmd}, ! {"ns_adp_argv", NULL, NsTclAdpArgvObjCmd}, ! {"ns_adp_bind_args", NULL, NsTclAdpBindArgsObjCmd}, ! {"ns_adp_break", NULL, NsTclAdpBreakObjCmd}, ! {"ns_adp_compress", NULL, NsTclAdpCompressObjCmd}, ! {"ns_adp_debug", NsTclAdpDebugCmd, NULL}, ! {"ns_adp_dir", NULL, NsTclAdpDirObjCmd}, ! {"ns_adp_dump", NULL, NsTclAdpDumpObjCmd}, ! {"ns_adp_eval", NULL, NsTclAdpEvalObjCmd}, ! {"ns_adp_exception", NULL, NsTclAdpExceptionObjCmd}, ! {"ns_adp_mime", NULL, NsTclAdpMimeTypeObjCmd}, ! {"ns_adp_mimetype", NULL, NsTclAdpMimeTypeObjCmd}, ! {"ns_adp_parse", NULL, NsTclAdpParseObjCmd}, ! {"ns_adp_puts", NULL, NsTclAdpPutsObjCmd}, ! {"ns_adp_registeradp", NsTclAdpRegisterAdpCmd, NULL}, ! {"ns_adp_registerproc", NsTclAdpRegisterProcCmd, NULL}, ! {"ns_adp_registertag", NsTclAdpRegisterAdpCmd, NULL}, ! {"ns_adp_return", NULL, NsTclAdpReturnObjCmd}, ! {"ns_adp_safeeval", NULL, NsTclAdpSafeEvalObjCmd}, ! {"ns_adp_stats", NsTclAdpStatsCmd, NULL}, ! {"ns_adp_stream", NULL, NsTclAdpStreamObjCmd}, ! {"ns_adp_tell", NULL, NsTclAdpTellObjCmd}, ! {"ns_adp_trunc", NULL, NsTclAdpTruncObjCmd}, ! {"ns_atclose", NsTclAtCloseCmd, NULL}, ! {"ns_chan", NULL, NsTclChanObjCmd}, ! {"ns_checkurl", NULL, NsTclRequestAuthorizeObjCmd}, ! {"ns_conn", NULL, NsTclConnObjCmd}, ! {"ns_conncptofp", NULL, NsTclWriteContentObjCmd}, ! {"ns_connsendfp", NULL, NsTclConnSendFpObjCmd}, ! {"ns_deletecookie", NULL, NsTclDeleteCookieObjCmd}, ! {"ns_getcookie", NULL, NsTclGetCookieObjCmd}, ! {"ns_geturl", NULL, NsTclGetUrlObjCmd}, ! {"ns_headers", NULL, NsTclHeadersObjCmd}, ! {"ns_ictl", NULL, NsTclICtlObjCmd}, ! {"ns_library", NsTclLibraryCmd, NULL}, ! {"ns_puts", NULL, NsTclAdpPutsObjCmd}, {"ns_register_adp", NULL, NsTclRegisterAdpObjCmd}, + {"ns_register_adptag", NsTclRegisterTagCmd, NULL}, + {"ns_register_filter", NULL, NsTclRegisterFilterObjCmd}, {"ns_register_proc", NULL, NsTclRegisterProcObjCmd}, ! {"ns_register_trace", NULL, NsTclRegisterTraceObjCmd}, ! {"ns_requestauthorize", NULL, NsTclRequestAuthorizeObjCmd}, {"ns_respond", NULL, NsTclRespondObjCmd}, ! {"ns_return", NULL, NsTclReturnObjCmd}, ! {"ns_returnadminnotice", NULL, NsTclReturnNoticeObjCmd}, {"ns_returnbadrequest", NULL, NsTclReturnBadRequestObjCmd}, {"ns_returnerror", NULL, NsTclReturnErrorObjCmd}, + {"ns_returnfile", NULL, NsTclReturnFileObjCmd}, + {"ns_returnforbidden", NULL, NsTclReturnForbiddenObjCmd}, + {"ns_returnfp", NULL, NsTclReturnFpObjCmd}, + {"ns_returnnotfound", NULL, NsTclReturnNotFoundObjCmd}, {"ns_returnnotice", NULL, NsTclReturnNoticeObjCmd}, {"ns_returnredirect", NULL, NsTclReturnRedirectObjCmd}, {"ns_returnunauthorized", NULL, NsTclReturnUnauthorizedObjCmd}, ! {"ns_server", NULL, NsTclServerObjCmd}, {"ns_setcookie", NULL, NsTclSetCookieObjCmd}, {"ns_share", NsTclShareCmd, NULL}, + {"ns_shutdown", NULL, NsTclShutdownObjCmd}, + {"ns_startcontent", NULL, NsTclStartContentObjCmd}, + {"ns_unregister_adp", NULL, NsTclUnRegisterObjCmd}, + {"ns_unregister_proc", NULL, NsTclUnRegisterObjCmd}, + {"ns_url2file", NULL, NsTclUrl2FileObjCmd}, {"ns_var", NULL, NsTclVarObjCmd}, ! {"ns_write", NULL, NsTclWriteObjCmd}, ! {"ns_writecontent", NULL, NsTclWriteContentObjCmd}, ! {"nsv_append", NULL, NsTclNsvAppendObjCmd}, ! {"nsv_array", NULL, NsTclNsvArrayObjCmd}, {"nsv_exists", NULL, NsTclNsvExistsObjCmd}, ! {"nsv_get", NULL, NsTclNsvGetObjCmd}, {"nsv_incr", NULL, NsTclNsvIncrObjCmd}, {"nsv_lappend", NULL, NsTclNsvLappendObjCmd}, {"nsv_names", NULL, NsTclNsvNamesObjCmd}, ! {"nsv_set", NULL, NsTclNsvSetObjCmd}, ! {"nsv_unset", NULL, NsTclNsvUnsetObjCmd}, /* |
From: Stephen D. <sd...@us...> - 2005-07-07 01:29:11
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27085 Modified Files: ChangeLog Log Message: Alphabetize list of Tcl commands. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** ChangeLog 6 Jul 2005 09:15:44 -0000 1.152 --- ChangeLog 7 Jul 2005 01:29:02 -0000 1.153 *************** *** 1,4 **** --- 1,6 ---- 2005-07-06 Stephen Deasey <sd...@us...> + * nsd/tclcmds.c: Alphabetize list of Tcl commands. + * nsd/return.c: Clean up some string buffer usage. |
From: Stephen D. <sd...@us...> - 2005-07-06 09:15:53
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9380/nsd Modified Files: return.c Log Message: Clean up some string buffer usage. Index: return.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/return.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** return.c 6 Jul 2005 07:12:18 -0000 1.10 --- return.c 6 Jul 2005 09:15:44 -0000 1.11 *************** *** 203,213 **** Ns_ConnConstructHeaders(Ns_Conn *conn, Ns_DString *dsPtr) { int i, length; char *reason; - char buf[100]; char *value, *keep; char *key, *lengthHdr; - Conn *connPtr; - Driver *drvPtr; int doChunkEncoding = 0; --- 203,212 ---- Ns_ConnConstructHeaders(Ns_Conn *conn, Ns_DString *dsPtr) { + Conn *connPtr = (Conn *) conn; + Driver *drvPtr = (Driver *) connPtr->drvPtr; int i, length; char *reason; char *value, *keep; char *key, *lengthHdr; int doChunkEncoding = 0; *************** *** 216,236 **** */ - connPtr = (Conn *) conn; - drvPtr = connPtr->drvPtr; - sprintf(buf, "%d", connPtr->responseStatus); reason = "Unknown Reason"; for (i = 0; i < nreasons; i++) { ! if (reasons[i].status == connPtr->responseStatus) { ! reason = reasons[i].reason; ! break; ! } } - doChunkEncoding = IsSetupForChunkedEncoding(conn); ! if (!doChunkEncoding) ! Ns_DStringVarAppend(dsPtr, "HTTP/1.0 ", buf, " ", reason, "\r\n", NULL); ! else ! Ns_DStringVarAppend(dsPtr, "HTTP/1.1 ", buf, " ", reason, "\r\n", NULL); /* --- 215,231 ---- */ reason = "Unknown Reason"; for (i = 0; i < nreasons; i++) { ! if (reasons[i].status == connPtr->responseStatus) { ! reason = reasons[i].reason; ! break; ! } } doChunkEncoding = IsSetupForChunkedEncoding(conn); ! Ns_DStringPrintf(dsPtr, "HTTP/%s %d %s\r\n", ! doChunkEncoding ? "1.1" : "1.0", ! connPtr->responseStatus, ! reason); /* *************** *** 543,553 **** Ns_ConnSetLengthHeader(Ns_Conn *conn, int length) { ! char buf[100]; ! Conn *connPtr; - connPtr = (Conn *) conn; connPtr->responseLength = length; ! sprintf(buf, "%d", length); ! Ns_ConnSetHeaders(conn, "Content-Length", buf); } --- 538,545 ---- Ns_ConnSetLengthHeader(Ns_Conn *conn, int length) { ! Conn *connPtr = (Conn *) conn; connPtr->responseLength = length; ! Ns_ConnPrintfHeaders(conn, "Content-Length", "%d", length); } |
From: Stephen D. <sd...@us...> - 2005-07-06 09:15:53
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9380 Modified Files: ChangeLog Log Message: Clean up some string buffer usage. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.151 retrieving revision 1.152 diff -C2 -d -r1.151 -r1.152 *** ChangeLog 6 Jul 2005 08:45:52 -0000 1.151 --- ChangeLog 6 Jul 2005 09:15:44 -0000 1.152 *************** *** 1,4 **** --- 1,6 ---- 2005-07-06 Stephen Deasey <sd...@us...> + * nsd/return.c: Clean up some string buffer usage. + * include/ns.h: * nsd/driver.c: |
From: Stephen D. <sd...@us...> - 2005-07-06 08:46:05
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26965 Modified Files: ChangeLog Log Message: * include/ns.h: * nsd/driver.c: * nsd/binder.c: Add backlog arg to Ns_SockListenUnix(). Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.150 retrieving revision 1.151 diff -C2 -d -r1.150 -r1.151 *** ChangeLog 6 Jul 2005 08:35:04 -0000 1.150 --- ChangeLog 6 Jul 2005 08:45:52 -0000 1.151 *************** *** 1,4 **** --- 1,8 ---- 2005-07-06 Stephen Deasey <sd...@us...> + * include/ns.h: + * nsd/driver.c: + * nsd/binder.c: Add backlog arg to Ns_SockListenUnix(). + * nsd/binder.c: * nsd/driver.c: Localize Windows ifdefs as much as possible. |
From: Stephen D. <sd...@us...> - 2005-07-06 08:46:02
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26965/nsd Modified Files: binder.c driver.c Log Message: * include/ns.h: * nsd/driver.c: * nsd/binder.c: Add backlog arg to Ns_SockListenUnix(). Index: driver.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/driver.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** driver.c 6 Jul 2005 08:35:08 -0000 1.17 --- driver.c 6 Jul 2005 08:45:53 -0000 1.18 *************** *** 449,453 **** drvPtr->sock = Ns_SockListenUdp(drvPtr->bindaddr, drvPtr->port); } else if (drvPtr->opts & NS_DRIVER_UNIX) { ! drvPtr->sock = Ns_SockListenUnix(drvPtr->bindaddr); } else { drvPtr->sock = Ns_SockListenEx(drvPtr->bindaddr, drvPtr->port, --- 449,453 ---- drvPtr->sock = Ns_SockListenUdp(drvPtr->bindaddr, drvPtr->port); } else if (drvPtr->opts & NS_DRIVER_UNIX) { ! drvPtr->sock = Ns_SockListenUnix(drvPtr->bindaddr, drvPtr->backlog); } else { drvPtr->sock = Ns_SockListenEx(drvPtr->bindaddr, drvPtr->port, Index: binder.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/binder.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** binder.c 6 Jul 2005 08:35:07 -0000 1.11 --- binder.c 6 Jul 2005 08:45:52 -0000 1.12 *************** *** 211,215 **** SOCKET ! Ns_SockListenUnix(char *path) { int sock = -1; --- 211,215 ---- SOCKET ! Ns_SockListenUnix(char *path, int backlog) { int sock = -1; *************** *** 233,237 **** sock = Ns_SockBindUnix(path); } ! if (sock >= 0 && listen(sock, nsconf.backlog) == -1) { /* Can't listen; close the opened socket */ int err = errno; --- 233,237 ---- sock = Ns_SockBindUnix(path); } ! if (sock >= 0 && listen(sock, backlog) == -1) { /* Can't listen; close the opened socket */ int err = errno; |