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-06-30 01:14:13
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4535/nsd Modified Files: fastpath.c Log Message: see ChangeLog Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** fastpath.c 29 Jun 2005 23:27:50 -0000 1.9 --- fastpath.c 30 Jun 2005 01:14:02 -0000 1.10 *************** *** 39,42 **** --- 39,44 ---- NS_RCSID("@(#) $Header$"); + #define MAX_RANGES 10 + /* * The following structure defines the contents of a file *************** *** 61,66 **** 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 *offset1, unsigned long *offset2); /* --- 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); /* *************** *** 474,479 **** { int fd, new, nread; ! unsigned long size, offset1, offset2; ! int result = NS_ERROR, range = NS_ERROR; char *key; Ns_Entry *entPtr; --- 476,481 ---- { int fd, new, nread; ! unsigned long size, offsets[MAX_RANGES*2]; ! int result = NS_ERROR, ranges = 0; char *key; Ns_Entry *entPtr; *************** *** 520,537 **** size = stPtr->st_size; if (status == 200) { ! range = ParseRange(conn, stPtr->st_size, &offset1, &offset2); } ! if (range != NS_ERROR) { ! if (offset1 > offset2) { ! /* 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); ! } /* Continue with returning a portion of the file */ Ns_ConnPrintfHeaders(conn, "Content-Range", "bytes %lu-%lu/%lu", ! offset1, offset2, stPtr->st_size); ! size = (offset2 - offset1) + 1; /* 206 Partial Content */ status = 206; --- 522,539 ---- 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; *************** *** 540,544 **** if (servPtr->fastpath.cache == NULL || stPtr->st_size > servPtr->fastpath.cachemaxentry ! || range == NS_OK) { /* --- 542,546 ---- if (servPtr->fastpath.cache == NULL || stPtr->st_size > servPtr->fastpath.cachemaxentry ! || ranges == 1) { /* *************** *** 552,557 **** && NsMemMap(file, stPtr->st_size, NS_MMAP_READ, &fmap) == NS_OK) { char *maddr = fmap.addr; ! if (range == NS_OK) { ! maddr += offset1; } result = Ns_ConnReturnData(conn,status, maddr, size, type); --- 554,559 ---- && 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); *************** *** 564,569 **** goto notfound; } ! if (range == NS_OK) { ! lseek(fd, offset1, SEEK_SET); } result = Ns_ConnReturnOpenFd(conn, status, type, fd, size); --- 566,571 ---- goto notfound; } ! if (ranges > 0) { ! lseek(fd, offsets[0], SEEK_SET); } result = Ns_ConnReturnOpenFd(conn, status, type, fd, size); *************** *** 690,694 **** * * Results: ! * NS_OK or NS_ERROR * * Side effects: --- 692,696 ---- * * Results: ! * -1 on error, number of byte ranges parsed * * Side effects: *************** *** 699,755 **** static int ! ParseRange(Ns_Conn *conn, unsigned long size, ! unsigned long *offset1, unsigned long *offset2) { char *range; ! *offset1 = *offset2 = 0; ! if ((range = Ns_SetIGet(conn->headers, "Range")) != NULL ! && (range = strstr(range,"bytes=")) != NULL) { ! range += 6; ! /* Multiple ranges are not supported yet */ ! if (strchr(range,',') != NULL) { ! return NS_ERROR; ! } if (isdigit(*range)) { ! *offset1 = atol(range); while (isdigit(*range)) range++; if (*range == '-') { range++; if (!isdigit(*range)) { ! if (*range != '\0') { ! return NS_ERROR; ! } ! *offset2 = size - 1; } else { ! *offset2 = atol(range); ! if (*offset1 > *offset2) { ! return NS_ERROR; } ! if (*offset2 >= size) { ! *offset2 = size - 1; } } ! return NS_OK; ! } else { ! return NS_ERROR; } } else if (*range == '-') { range++; if (!isdigit(*range)) { ! return NS_ERROR; } ! *offset2 = atol(range); ! if (*offset2 > size) { ! *offset2 = size; } /* Size from the end requested, convert into offset */ ! *offset1 = size - *offset2; ! *offset2 = *offset1 + *offset2 - 1; ! return NS_OK; } } ! return NS_ERROR; } --- 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; } |
From: Vlad S. <ser...@us...> - 2005-06-29 23:28:02
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14522/nsd Modified Files: fastpath.c Log Message: see ChangeLog Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** fastpath.c 29 Jun 2005 15:53:21 -0000 1.8 --- fastpath.c 29 Jun 2005 23:27:50 -0000 1.9 *************** *** 709,712 **** --- 709,716 ---- && (range = strstr(range,"bytes=")) != NULL) { range += 6; + /* Multiple ranges are not supported yet */ + if (strchr(range,',') != NULL) { + return NS_ERROR; + } if (isdigit(*range)) { *offset1 = atol(range); *************** *** 721,727 **** } else { *offset2 = atol(range); ! } ! if (*offset2 >= size) { ! *offset2 = size - 1; } return NS_OK; --- 725,734 ---- } else { *offset2 = atol(range); ! if (*offset1 > *offset2) { ! return NS_ERROR; ! } ! if (*offset2 >= size) { ! *offset2 = size - 1; ! } } return NS_OK; |
From: Vlad S. <ser...@us...> - 2005-06-29 23:27:58
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14522 Modified Files: ChangeLog Log Message: see ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.135 retrieving revision 1.136 diff -C2 -d -r1.135 -r1.136 *** ChangeLog 29 Jun 2005 22:27:16 -0000 1.135 --- ChangeLog 29 Jun 2005 23:27:50 -0000 1.136 *************** *** 1,2 **** --- 1,6 ---- + 2005-06-29 Vlad Seryakov <ser...@us...> + + * nsd/fastpath.c: Made all tests pass successfully + 2005-06-29 Stephen Deasey <sd...@us...> |
From: Stephen D. <sd...@us...> - 2005-06-29 22:27:25
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12777/tests Modified Files: http_byteranges.test Log Message: * tests/http_byteranges.test: Use the 'knownBug' test contraint to dissable multiple-range tests so that they are counted in the 'Skipped' column of the test results and are not forgottena about. Added a new, temporary test for multiple ranges to ensure that multiple-range requests are ignored, not half fulfilled. Re-added test 2.3 which tests multiple, overlapping ranges (non canonical in RFC speak); dissabled as a 'knownBug'. Reverted tests 3.1 and 3.2 which check syntactically invalid requests are ignored by the server. An end byte before the start byte is never going to work and so is a syntactic error, not an unsatisfiable request. Renamed tests byteranges- from http-. Index: http_byteranges.test =================================================================== RCS file: /cvsroot/naviserver/naviserver/tests/http_byteranges.test,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** http_byteranges.test 29 Jun 2005 15:53:21 -0000 1.3 --- http_byteranges.test 29 Jun 2005 22:27:16 -0000 1.4 *************** *** 49,53 **** ! test http-1.1 {Simple range, beginning} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-4} \ -getheaders {Content-length Content-range} \ --- 49,53 ---- ! test byteranges-1.1 {Simple range, beginning} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-4} \ -getheaders {Content-length Content-range} \ *************** *** 55,59 **** } -result {206 5 {bytes 0-4/10} 01234} ! test http-1.2 {Simple range, end} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=5-9} \ -getheaders {Content-length Content-range} \ --- 55,59 ---- } -result {206 5 {bytes 0-4/10} 01234} ! test byteranges-1.2 {Simple range, end} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=5-9} \ -getheaders {Content-length Content-range} \ *************** *** 61,65 **** } -result {206 5 {bytes 5-9/10} 56789} ! test http-1.3 {Relative range} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=5-} \ -getheaders {Content-length Content-range} \ --- 61,65 ---- } -result {206 5 {bytes 5-9/10} 56789} ! test byteranges-1.3 {Relative range} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=5-} \ -getheaders {Content-length Content-range} \ *************** *** 67,71 **** } -result {206 5 {bytes 5-9/10} 56789} ! test http-1.4 {Relative range} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=-5} \ -getheaders {Content-length Content-range} \ --- 67,71 ---- } -result {206 5 {bytes 5-9/10} 56789} ! test byteranges-1.4 {Relative range} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=-5} \ -getheaders {Content-length Content-range} \ *************** *** 73,77 **** } -result {206 5 {bytes 5-9/10} 56789} ! test http-1.5 {Single byte (1st)} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-0} \ -getheaders {Content-length Content-range} \ --- 73,77 ---- } -result {206 5 {bytes 5-9/10} 56789} ! test byteranges-1.5 {Single byte (1st)} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-0} \ -getheaders {Content-length Content-range} \ *************** *** 79,83 **** } -result {206 1 {bytes 0-0/10} 0} ! test http-1.6 {Single byte (2nd)} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=1-1} \ -getheaders {Content-length Content-range} \ --- 79,83 ---- } -result {206 1 {bytes 0-0/10} 0} ! test byteranges-1.6 {Single byte (2nd)} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=1-1} \ -getheaders {Content-length Content-range} \ *************** *** 85,89 **** } -result {206 1 {bytes 1-1/10} 1} ! test http-1.6 {Single byte (last)} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=9-9} \ -getheaders {Content-length Content-range} \ --- 85,89 ---- } -result {206 1 {bytes 1-1/10} 1} ! test byteranges-1.6 {Single byte (last)} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=9-9} \ -getheaders {Content-length Content-range} \ *************** *** 91,95 **** } -result {206 1 {bytes 9-9/10} 9} ! test http-1.7 {Request more than exists} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-10} \ -getheaders {Content-length Content-range} \ --- 91,95 ---- } -result {206 1 {bytes 9-9/10} 9} ! test byteranges-1.7 {Request more than exists} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-10} \ -getheaders {Content-length Content-range} \ *************** *** 97,101 **** } -result {206 10 {bytes 0-9/10} 0123456789} ! test http-1.8 {Request more than exists} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=-10} \ -getheaders {Content-length Content-range} \ --- 97,101 ---- } -result {206 10 {bytes 0-9/10} 0123456789} ! test byteranges-1.8 {Request more than exists} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=-10} \ -getheaders {Content-length Content-range} \ *************** *** 104,110 **** - if { "MultipleSupported" == "NotYet" } { ! test http-2.1 {Multiple contiguous ranges} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-2,3-6} \ -getheaders {Content-length Content-range} \ --- 104,111 ---- ! 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} \ *************** *** 112,116 **** } -result {206 6 {bytes 0-6/10} 012345} ! test http-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} \ --- 113,119 ---- } -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} \ *************** *** 118,122 **** } -result {206 9 {bytes 0-8/10} 012345678} ! test http-2.4 {Multiple non-contiguous ranges} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-2,7-9} \ -getheaders {Content-type Content-range} \ --- 121,135 ---- } -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} \ *************** *** 134,142 **** }] ! test http-2.5 {Multiple ranges, out of order} -constraints serverListen -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 --- 147,157 ---- }] ! 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 *************** *** 150,168 **** }] ! } ! test http-3.1 {invalid offsets} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=3-2} \ -getheaders {Content-length Content-range} \ GET /10bytes ! } -result {416 10 {bytes */10} {}} ! test http-3.2 {invalid offsets} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=11-10} \ -getheaders {Content-length Content-range} \ GET /10bytes ! } -result {416 10 {bytes */10} {}} ! test http-3.3 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=} \ -getheaders {Content-length Content-range} \ --- 165,191 ---- }] ! 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 { nstest_http -getbody 1 -setheaders {Range bytes=3-2} \ -getheaders {Content-length Content-range} \ GET /10bytes ! } -result {200 10 {} 0123456789} ! test byteranges-3.2 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=11-10} \ -getheaders {Content-length Content-range} \ GET /10bytes ! } -result {200 10 {} 0123456789} ! test byteranges-3.3 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=} \ -getheaders {Content-length Content-range} \ *************** *** 170,174 **** } -result {200 10 {} 0123456789} ! test http-3.4 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes 0-1} \ -getheaders {Content-length Content-range} \ --- 193,197 ---- } -result {200 10 {} 0123456789} ! test byteranges-3.4 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes 0-1} \ -getheaders {Content-length Content-range} \ *************** *** 176,180 **** } -result {200 10 {} 0123456789} ! test http-3.5 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range 0-1} \ -getheaders {Content-length Content-range} \ --- 199,203 ---- } -result {200 10 {} 0123456789} ! test byteranges-3.5 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range 0-1} \ -getheaders {Content-length Content-range} \ *************** *** 182,186 **** } -result {200 10 {} 0123456789} ! test http-3.6 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range =} \ -getheaders {Content-length Content-range} \ --- 205,209 ---- } -result {200 10 {} 0123456789} ! test byteranges-3.6 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range =} \ -getheaders {Content-length Content-range} \ *************** *** 188,192 **** } -result {200 10 {} 0123456789} ! test http-3.7 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range =-} \ -getheaders {Content-length Content-range} \ --- 211,215 ---- } -result {200 10 {} 0123456789} ! test byteranges-3.7 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range =-} \ -getheaders {Content-length Content-range} \ *************** *** 194,198 **** } -result {200 10 {} 0123456789} ! test http-3.8 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=--6-9} \ -getheaders {Content-length Content-range} \ --- 217,221 ---- } -result {200 10 {} 0123456789} ! test byteranges-3.8 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=--6-9} \ -getheaders {Content-length Content-range} \ *************** *** 200,204 **** } -result {200 10 {} 0123456789} ! test http-3.9 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=1--6} \ -getheaders {Content-length Content-range} \ --- 223,227 ---- } -result {200 10 {} 0123456789} ! test byteranges-3.9 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=1--6} \ -getheaders {Content-length Content-range} \ *************** *** 208,217 **** ! test http-4.1 {unsatisfiable} -constraints serverListen -body { nstest_http -setheaders {Range bytes=10-10} -getheaders {Content-range} \ GET /10bytes } -result {416 {bytes */10}} ! test http-4.2 {unsatisfiable} -constraints serverListen -body { nstest_http -setheaders {Range bytes=10-} -getheaders {Content-range} \ GET /10bytes --- 231,240 ---- ! test byteranges-4.1 {unsatisfiable} -constraints serverListen -body { nstest_http -setheaders {Range bytes=10-10} -getheaders {Content-range} \ GET /10bytes } -result {416 {bytes */10}} ! test byteranges-4.2 {unsatisfiable} -constraints serverListen -body { nstest_http -setheaders {Range bytes=10-} -getheaders {Content-range} \ GET /10bytes |
From: Stephen D. <sd...@us...> - 2005-06-29 22:27:24
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12777 Modified Files: ChangeLog Log Message: * tests/http_byteranges.test: Use the 'knownBug' test contraint to dissable multiple-range tests so that they are counted in the 'Skipped' column of the test results and are not forgottena about. Added a new, temporary test for multiple ranges to ensure that multiple-range requests are ignored, not half fulfilled. Re-added test 2.3 which tests multiple, overlapping ranges (non canonical in RFC speak); dissabled as a 'knownBug'. Reverted tests 3.1 and 3.2 which check syntactically invalid requests are ignored by the server. An end byte before the start byte is never going to work and so is a syntactic error, not an unsatisfiable request. Renamed tests byteranges- from http-. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.134 retrieving revision 1.135 diff -C2 -d -r1.134 -r1.135 *** ChangeLog 29 Jun 2005 15:53:20 -0000 1.134 --- ChangeLog 29 Jun 2005 22:27:16 -0000 1.135 *************** *** 1,2 **** --- 1,16 ---- + 2005-06-29 Stephen Deasey <sd...@us...> + + * tests/http_byteranges.test: Use the 'knownBug' test contraint to + dissable multiple-range tests so that they are counted in the 'Skipped' + column of the test results and are not forgottena about. Added a new, + temporary test for multiple ranges to ensure that multiple-range + requests are ignored, not half fulfilled. Re-added test 2.3 which + tests multiple, overlapping ranges (non canonical in RFC speak); + dissabled as a 'knownBug'. Reverted tests 3.1 and 3.2 which check + syntactically invalid requests are ignored by the server. An end + byte before the start byte is never going to work and so is a + syntactic error, not an unsatisfiable request. Renamed tests + byteranges- from http-. + 2005-06-29 Vlad Seryakov <ser...@us...> |
From: Vlad S. <ser...@us...> - 2005-06-29 15:53:39
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23300/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.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** http_byteranges.test 29 Jun 2005 03:45:50 -0000 1.2 --- http_byteranges.test 29 Jun 2005 15:53:21 -0000 1.3 *************** *** 104,107 **** --- 104,108 ---- + if { "MultipleSupported" == "NotYet" } { test http-2.1 {Multiple contiguous ranges} -constraints serverListen -body { *************** *** 117,126 **** } -result {206 9 {bytes 0-8/10} 012345678} - test http-2.3 {Multiple non-canonical 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 6 {bytes 0-6/10} 012345} - test http-2.4 {Multiple non-contiguous ranges} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-2,7-9} \ --- 118,121 ---- *************** *** 155,159 **** }] ! test http-3.1 {invalid offsets} -constraints serverListen -body { --- 150,154 ---- }] ! } test http-3.1 {invalid offsets} -constraints serverListen -body { |
From: Vlad S. <ser...@us...> - 2005-06-29 15:53:32
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23300/nsd Modified Files: fastpath.c Log Message: see ChangeLog Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** fastpath.c 29 Jun 2005 03:45:49 -0000 1.7 --- fastpath.c 29 Jun 2005 15:53:21 -0000 1.8 *************** *** 521,525 **** if (status == 200) { range = ParseRange(conn, stPtr->st_size, &offset1, &offset2); - Ns_Log(Debug,"bytes %lu-%lu/%lu",offset1,offset2,stPtr->st_size); } if (range != NS_ERROR) { --- 521,524 ---- |
From: Vlad S. <ser...@us...> - 2005-06-29 15:53:31
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23300 Modified Files: ChangeLog Log Message: see ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.133 retrieving revision 1.134 diff -C2 -d -r1.133 -r1.134 *** ChangeLog 29 Jun 2005 03:45:49 -0000 1.133 --- ChangeLog 29 Jun 2005 15:53:20 -0000 1.134 *************** *** 1,2 **** --- 1,7 ---- + 2005-06-29 Vlad Seryakov <ser...@us...> + + * tests/http_byteranges.test: Disabled mutiple ranges + test. This can be supported in the future. + 2005-06-28 Vlad Seryakov <ser...@us...> |
From: Vlad S. <ser...@us...> - 2005-06-29 14:39:14
|
Update of /cvsroot/naviserver/modules/nsaccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16435/nsaccess Modified Files: README nsaccess.c Log Message: Index: README =================================================================== RCS file: /cvsroot/naviserver/modules/nsaccess/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** README 29 Jun 2005 02:26:02 -0000 1.1.1.1 --- README 29 Jun 2005 14:39:06 -0000 1.2 *************** *** 14,18 **** Usage ! ns_access check daemonname client_ippaddr verifies daemon name with connection from ipaddr agains host_access --- 14,18 ---- Usage ! ns_access check daemonname client_ippaddr ?username? verifies daemon name with connection from ipaddr agains host_access Index: nsaccess.c =================================================================== RCS file: /cvsroot/naviserver/modules/nsaccess/nsaccess.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** nsaccess.c 29 Jun 2005 02:26:02 -0000 1.1.1.1 --- nsaccess.c 29 Jun 2005 14:39:06 -0000 1.2 *************** *** 160,167 **** case cmdCheck: if (objc != 4) { ! Tcl_WrongNumArgs(interp, 2, objv, "daemon_name client_ipaddr"); return TCL_ERROR; } ! rc = hosts_ctl(Tcl_GetString(objv[2]), STRING_UNKNOWN, Tcl_GetString(objv[3]), STRING_UNKNOWN); Tcl_SetObjResult(interp,Tcl_NewIntObj(rc)); break; --- 160,169 ---- case cmdCheck: if (objc != 4) { ! Tcl_WrongNumArgs(interp, 2, objv, "daemon_name client_ipaddr ?client_username?"); return TCL_ERROR; } ! rc = hosts_ctl(Tcl_GetString(objv[2]), STRING_UNKNOWN, ! Tcl_GetString(objv[3]), ! objc > 4 ? Tcl_GetString(objv[4]) : STRING_UNKNOWN); Tcl_SetObjResult(interp,Tcl_NewIntObj(rc)); break; |
From: Vlad S. <ser...@us...> - 2005-06-29 14:38:50
|
Update of /cvsroot/naviserver/modules/nssnmp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16212/nssnmp Modified Files: Makefile Log Message: Index: Makefile =================================================================== RCS file: /cvsroot/naviserver/modules/nssnmp/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 20 May 2005 20:47:20 -0000 1.1.1.1 --- Makefile 29 Jun 2005 14:38:41 -0000 1.2 *************** *** 29,33 **** INSTALL += install-procs ! CFLAGS = -I$(SNMPINC) -I/usr/local/aolserver/include MODLIBS = $(SNMPLIB) --- 29,33 ---- INSTALL += install-procs ! CFLAGS += -I$(SNMPINC) MODLIBS = $(SNMPLIB) |
From: Vlad S. <ser...@us...> - 2005-06-29 03:46:14
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14098/nsd Modified Files: fastpath.c return.c Log Message: see ChangeLog Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** fastpath.c 28 Jun 2005 20:15:44 -0000 1.6 --- fastpath.c 29 Jun 2005 03:45:49 -0000 1.7 *************** *** 521,529 **** if (status == 200) { range = ParseRange(conn, stPtr->st_size, &offset1, &offset2); } if (range != NS_ERROR) { if (offset1 > offset2) { /* 416 Requested Range Not Satisfiable */ ! Ns_ConnVSetHeaders(conn, "Content-Range", "bytes */%lu", stPtr->st_size); Ns_ConnSetRequiredHeaders(conn, type, (int) stPtr->st_size); --- 521,530 ---- if (status == 200) { range = ParseRange(conn, stPtr->st_size, &offset1, &offset2); + Ns_Log(Debug,"bytes %lu-%lu/%lu",offset1,offset2,stPtr->st_size); } if (range != NS_ERROR) { if (offset1 > offset2) { /* 416 Requested Range Not Satisfiable */ ! Ns_ConnPrintfHeaders(conn, "Content-Range", "bytes */%lu", stPtr->st_size); Ns_ConnSetRequiredHeaders(conn, type, (int) stPtr->st_size); *************** *** 531,535 **** } /* Continue with returning a portion of the file */ ! Ns_ConnVSetHeaders(conn, "Content-Range", "bytes %lu-%lu/%lu", offset1, offset2, stPtr->st_size); size = (offset2 - offset1) + 1; --- 532,536 ---- } /* Continue with returning a portion of the file */ ! Ns_ConnPrintfHeaders(conn, "Content-Range", "bytes %lu-%lu/%lu", offset1, offset2, stPtr->st_size); size = (offset2 - offset1) + 1; *************** *** 707,712 **** if ((range = Ns_SetIGet(conn->headers, "Range")) != NULL ! && (range = strchr(range,'=')) != NULL) { ! range++; if (isdigit(*range)) { *offset1 = atol(range); --- 708,713 ---- if ((range = Ns_SetIGet(conn->headers, "Range")) != NULL ! && (range = strstr(range,"bytes=")) != NULL) { ! range += 6; if (isdigit(*range)) { *offset1 = atol(range); *************** *** 714,724 **** if (*range == '-') { range++; ! *offset2 = atol(range); ! if (*offset2 == 0 || *offset2 >= size) { *offset2 = size - 1; } } } else if (*range == '-') { range++; *offset2 = atol(range); if (*offset2 > size) { --- 715,738 ---- if (*range == '-') { range++; ! if (!isdigit(*range)) { ! if (*range != '\0') { ! return NS_ERROR; ! } ! *offset2 = size - 1; ! } else { ! *offset2 = atol(range); ! } ! if (*offset2 >= size) { *offset2 = size - 1; } + return NS_OK; + } else { + return NS_ERROR; } } else if (*range == '-') { range++; + if (!isdigit(*range)) { + return NS_ERROR; + } *offset2 = atol(range); if (*offset2 > size) { *************** *** 728,737 **** *offset1 = size - *offset2; *offset2 = *offset1 + *offset2 - 1; } } ! if (*offset2 == 0) { ! return NS_ERROR; ! } ! return NS_OK; } --- 742,749 ---- *offset1 = size - *offset2; *offset2 = *offset1 + *offset2 - 1; + return NS_OK; } } ! return NS_ERROR; } Index: return.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/return.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** return.c 28 Jun 2005 20:15:44 -0000 1.8 --- return.c 29 Jun 2005 03:45:49 -0000 1.9 *************** *** 371,375 **** *---------------------------------------------------------------------- * ! * Ns_ConnVSetHeaders -- * * Add a printf-style string as an output header. --- 371,375 ---- *---------------------------------------------------------------------- * ! * Ns_ConnPrintfHeaders -- * * Add a printf-style string as an output header. *************** *** 385,389 **** void ! Ns_ConnVSetHeaders(Ns_Conn *conn, char *field, char *fmt,...) { Ns_DString ds; --- 385,389 ---- void ! Ns_ConnPrintfHeaders(Ns_Conn *conn, char *field, char *fmt,...) { Ns_DString ds; *************** *** 604,644 **** *---------------------------------------------------------------------- * - * Ns_ConnPrintfHeader -- - * - * Write a printf-style string right to the conn. - * - * Results: - * NS_OK/NS_ERROR - * - * Side effects: - * Will write to the conn; you're expected to format this like a - * header (like "foo: bar\n"). - * - *---------------------------------------------------------------------- - */ - - int - Ns_ConnPrintfHeader(Ns_Conn *conn, char *fmt,...) - { - int result; - Ns_DString ds; - va_list ap; - - if (conn->request == NULL || conn->request->version < 1.0) { - return NS_OK; - } - Ns_DStringInit(&ds); - va_start(ap, fmt); - Ns_DStringVPrintf(&ds, fmt, ap); - va_end(ap); - result = Ns_ConnSendDString(conn, &ds); - Ns_DStringFree(&ds); - return result; - } - - - /* - *---------------------------------------------------------------------- - * * Ns_ConnResetReturn -- * --- 604,607 ---- |
From: Vlad S. <ser...@us...> - 2005-06-29 03:46:14
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14098/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.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** http_byteranges.test 29 Jun 2005 01:56:44 -0000 1.1 --- http_byteranges.test 29 Jun 2005 03:45:50 -0000 1.2 *************** *** 157,171 **** ! test http-3.1 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=3-2} \ -getheaders {Content-length Content-range} \ GET /10bytes ! } -result {200 10 {} 0123456789} ! test http-3.2 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=11-10} \ -getheaders {Content-length Content-range} \ GET /10bytes ! } -result {200 10 {} 0123456789} test http-3.3 {syntactically invalid} -constraints serverListen -body { --- 157,171 ---- ! test http-3.1 {invalid offsets} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=3-2} \ -getheaders {Content-length Content-range} \ GET /10bytes ! } -result {416 10 {bytes */10} {}} ! test http-3.2 {invalid offsets} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=11-10} \ -getheaders {Content-length Content-range} \ GET /10bytes ! } -result {416 10 {bytes */10} {}} test http-3.3 {syntactically invalid} -constraints serverListen -body { |
From: Vlad S. <ser...@us...> - 2005-06-29 03:46:14
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14098/include Modified Files: ns.h Log Message: see ChangeLog Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ns.h 28 Jun 2005 20:15:43 -0000 1.28 --- ns.h 29 Jun 2005 03:45:49 -0000 1.29 *************** *** 1014,1018 **** NS_EXTERN int Ns_ConnFlushHeaders(Ns_Conn *conn, int status); NS_EXTERN void Ns_ConnSetHeaders(Ns_Conn *conn, char *field, char *value); - NS_EXTERN void Ns_ConnVSetHeaders(Ns_Conn *conn, char *field, char *fmt,...); NS_EXTERN void Ns_ConnCondSetHeaders(Ns_Conn *conn, char *field, char *value); NS_EXTERN void Ns_ConnReplaceHeaders(Ns_Conn *conn, Ns_Set *newheaders); --- 1014,1017 ---- *************** *** 1022,1026 **** NS_EXTERN void Ns_ConnSetLastModifiedHeader(Ns_Conn *conn, time_t *mtime); NS_EXTERN void Ns_ConnSetExpiresHeader(Ns_Conn *conn, char *expires); ! NS_EXTERN int Ns_ConnPrintfHeader(Ns_Conn *conn, char *fmt, ...) NS_GNUC_PRINTF(2, 3); NS_EXTERN int Ns_ConnResetReturn(Ns_Conn *conn) NS_GNUC_DEPRECATED; NS_EXTERN int Ns_ConnReturnAdminNotice(Ns_Conn *conn, int status, char *title, --- 1021,1025 ---- NS_EXTERN void Ns_ConnSetLastModifiedHeader(Ns_Conn *conn, time_t *mtime); NS_EXTERN void Ns_ConnSetExpiresHeader(Ns_Conn *conn, char *expires); ! NS_EXTERN void Ns_ConnPrintfHeaders(Ns_Conn *conn, char *field, char *fmt, ...) NS_GNUC_PRINTF(3, 4); NS_EXTERN int Ns_ConnResetReturn(Ns_Conn *conn) NS_GNUC_DEPRECATED; NS_EXTERN int Ns_ConnReturnAdminNotice(Ns_Conn *conn, int status, char *title, *************** *** 1362,1366 **** #define Ns_ResetReturn(c) Ns_ConnResetReturn(c) #define Ns_PutsConn(c,s) Ns_ConnPuts(c,s) - #define Ns_PrintfHeader Ns_ConnPrintfHeader #define Ns_ExpiresHeader(c,h) Ns_ConnSetExpiresHeader(c,h) #define Ns_ReturnHtml(c,s,h,l) Ns_ConnReturnHtml(c,s,h,l) --- 1361,1364 ---- |
From: Vlad S. <ser...@us...> - 2005-06-29 03:46:14
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14098 Modified Files: ChangeLog NEWS Log Message: see ChangeLog Index: NEWS =================================================================== RCS file: /cvsroot/naviserver/naviserver/NEWS,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NEWS 10 Jun 2005 07:35:58 -0000 1.4 --- NEWS 29 Jun 2005 03:45:49 -0000 1.5 *************** *** 21,24 **** --- 21,25 ---- * New routines for listening on UDP and UNIX domain sockets * Add -localhost -localport options to ns_sockopen + * Add support for Range: header to return partial content Bug Fixes: Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** ChangeLog 29 Jun 2005 01:56:44 -0000 1.132 --- ChangeLog 29 Jun 2005 03:45:49 -0000 1.133 *************** *** 1,2 **** --- 1,14 ---- + 2005-06-28 Vlad Seryakov <ser...@us...> + + * tests/http_byteranges.test: Updated to reflect + actual range support. Multiple ranges are not supported. + + * nsd/fastpath.c: improved detection of invalid syntax + + * ns/include: + nsd/return.c: removed unsed NsConnPrintfHeader. Renamed + Ns_ConnVSetHeaders into Ns_ConnPrintfHeaders. + + 2005-06-28 Stephen Deasey <sd...@us...> |
From: Vlad S. <ser...@us...> - 2005-06-29 02:30:23
|
Update of /cvsroot/naviserver/naviserver/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7853 Removed Files: LICENSE Makefile README nsaccess.c Log Message: wrong import --- README DELETED --- --- Makefile DELETED --- --- nsaccess.c DELETED --- --- LICENSE DELETED --- |
From: Stephen D. <sd...@us...> - 2005-06-29 01:56:54
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23671/tests Added Files: http_byteranges.test Log Message: Test HTTP byte ranges. --- NEW FILE: http_byteranges.test --- # # The contents of this file are subject to the AOLserver Public License # Version 1.1 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://aolserver.com/. # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. # # The Original Code is AOLserver Code and related documentation # distributed by AOL. # # The Initial Developer of the Original Code is America Online, # Inc. Portions created by AOL are Copyright (C) 1999 America Online, # Inc. All Rights Reserved. # # Alternatively, the contents of this file may be used under the terms # of the GNU General Public License (the "GPL"), in which case the # provisions of GPL are applicable instead of those above. If you wish # to allow use of your version of this file only under the terms of the # GPL and not to allow others to use your version of this file under the # License, indicate your decision by deleting the provisions above and # replace them with the notice and other provisions required by the GPL. # If you do not delete the provisions above, a recipient may use your # version of this file under either the License or the GPL. # # # $Header: /cvsroot/naviserver/naviserver/tests/http_byteranges.test,v 1.1 2005/06/29 01:56:44 sdeasey Exp $ # # # HTTP 1.1 Byte Ranges: RFC 2616 14.35.1, 14.6, 19.3 # package require tcltest 2.2 namespace import -force ::tcltest::* eval ::tcltest::configure $argv if {[ns_config test listenport]} { testConstraint serverListen true } test http-1.1 {Simple range, beginning} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-4} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {206 5 {bytes 0-4/10} 01234} test http-1.2 {Simple range, end} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=5-9} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {206 5 {bytes 5-9/10} 56789} test http-1.3 {Relative range} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=5-} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {206 5 {bytes 5-9/10} 56789} test http-1.4 {Relative range} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=-5} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {206 5 {bytes 5-9/10} 56789} test http-1.5 {Single byte (1st)} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-0} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {206 1 {bytes 0-0/10} 0} test http-1.6 {Single byte (2nd)} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=1-1} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {206 1 {bytes 1-1/10} 1} test http-1.6 {Single byte (last)} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=9-9} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {206 1 {bytes 9-9/10} 9} test http-1.7 {Request more than exists} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=0-10} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {206 10 {bytes 0-9/10} 0123456789} test http-1.8 {Request more than exists} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=-10} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {206 10 {bytes 0-9/10} 0123456789} test http-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 6 {bytes 0-6/10} 012345} test http-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} \ GET /10bytes } -result {206 9 {bytes 0-8/10} 012345678} test http-2.3 {Multiple non-canonical 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 6 {bytes 0-6/10} 012345} test http-2.4 {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 012\r --[^ ]+\r Content-type: \*/\*\r Content-range: bytes 7-9/10\r 789\r --[^ ]+-- }] test http-2.5 {Multiple ranges, out of order} -constraints serverListen -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 http-3.1 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=3-2} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {200 10 {} 0123456789} test http-3.2 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=11-10} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {200 10 {} 0123456789} test http-3.3 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {200 10 {} 0123456789} test http-3.4 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes 0-1} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {200 10 {} 0123456789} test http-3.5 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range 0-1} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {200 10 {} 0123456789} test http-3.6 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range =} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {200 10 {} 0123456789} test http-3.7 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range =-} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {200 10 {} 0123456789} test http-3.8 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=--6-9} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {200 10 {} 0123456789} test http-3.9 {syntactically invalid} -constraints serverListen -body { nstest_http -getbody 1 -setheaders {Range bytes=1--6} \ -getheaders {Content-length Content-range} \ GET /10bytes } -result {200 10 {} 0123456789} test http-4.1 {unsatisfiable} -constraints serverListen -body { nstest_http -setheaders {Range bytes=10-10} -getheaders {Content-range} \ GET /10bytes } -result {416 {bytes */10}} test http-4.2 {unsatisfiable} -constraints serverListen -body { nstest_http -setheaders {Range bytes=10-} -getheaders {Content-range} \ GET /10bytes } -result {416 {bytes */10}} cleanupTests |
From: Stephen D. <sd...@us...> - 2005-06-29 01:56:53
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23671 Modified Files: ChangeLog Log Message: Test HTTP byte ranges. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.131 retrieving revision 1.132 diff -C2 -d -r1.131 -r1.132 *** ChangeLog 28 Jun 2005 20:15:43 -0000 1.131 --- ChangeLog 29 Jun 2005 01:56:44 -0000 1.132 *************** *** 1,2 **** --- 1,6 ---- + 2005-06-28 Stephen Deasey <sd...@us...> + + * tests/http_byteranges.test: Test HTTP byte ranges. + 2005-06-28 Vlad Seryakov <ser...@us...> |
From: Vlad S. <ser...@us...> - 2005-06-28 20:15:53
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3191/nsd Modified Files: fastpath.c return.c Log Message: Added Ns_ConnVSetHeaders function to add headers to the output in printf-style way Added support for Range: header for returning partial content Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** fastpath.c 11 Jun 2005 18:40:31 -0000 1.5 --- fastpath.c 28 Jun 2005 20:15:44 -0000 1.6 *************** *** 61,65 **** static int FastReturn(NsServer *servPtr, Ns_Conn *conn, int status, char *type, char *file, struct stat *stPtr); ! /* --- 61,66 ---- 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 *offset1, unsigned long *offset2); /* *************** *** 472,479 **** char *type, char *file, struct stat *stPtr) { ! int result = NS_ERROR, fd, new, nread; ! File *filePtr; char *key; Ns_Entry *entPtr; FileMap fmap; --- 473,482 ---- char *type, char *file, struct stat *stPtr) { ! int fd, new, nread; ! unsigned long size, offset1, offset2; ! int result = NS_ERROR, range = NS_ERROR; char *key; Ns_Entry *entPtr; + File *filePtr; FileMap fmap; *************** *** 510,515 **** } if (servPtr->fastpath.cache == NULL ! || stPtr->st_size > servPtr->fastpath.cachemaxentry) { /* --- 513,544 ---- } + /* + * 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) { + range = ParseRange(conn, stPtr->st_size, &offset1, &offset2); + } + if (range != NS_ERROR) { + if (offset1 > offset2) { + /* 416 Requested Range Not Satisfiable */ + Ns_ConnVSetHeaders(conn, "Content-Range", "bytes */%lu", + stPtr->st_size); + Ns_ConnSetRequiredHeaders(conn, type, (int) stPtr->st_size); + return Ns_ConnFlushHeaders(conn, 416); + } + /* Continue with returning a portion of the file */ + Ns_ConnVSetHeaders(conn, "Content-Range", "bytes %lu-%lu/%lu", + offset1, offset2, stPtr->st_size); + size = (offset2 - offset1) + 1; + /* 206 Partial Content */ + status = 206; + } + if (servPtr->fastpath.cache == NULL ! || stPtr->st_size > servPtr->fastpath.cachemaxentry ! || range == NS_OK) { /* *************** *** 522,526 **** if (servPtr->fastpath.mmap && NsMemMap(file, stPtr->st_size, NS_MMAP_READ, &fmap) == NS_OK) { ! result = Ns_ConnReturnData(conn,status, fmap.addr,fmap.size, type); NsMemUmap(&fmap); } else { --- 551,559 ---- if (servPtr->fastpath.mmap && NsMemMap(file, stPtr->st_size, NS_MMAP_READ, &fmap) == NS_OK) { ! char *maddr = fmap.addr; ! if (range == NS_OK) { ! maddr += offset1; ! } ! result = Ns_ConnReturnData(conn,status, maddr, size, type); NsMemUmap(&fmap); } else { *************** *** 531,535 **** goto notfound; } ! result = Ns_ConnReturnOpenFd(conn, status,type, fd,stPtr->st_size); close(fd); } --- 564,571 ---- goto notfound; } ! if (range == NS_OK) { ! lseek(fd, offset1, SEEK_SET); ! } ! result = Ns_ConnReturnOpenFd(conn, status, type, fd, size); close(fd); } *************** *** 643,644 **** --- 679,737 ---- return status; } + + + /* + *---------------------------------------------------------------------- + * + * ParseRange -- + * + * Checks for presence of Range: header, parses it and returns + * the requested offsets + * + * Results: + * NS_OK or NS_ERROR + * + * Side effects: + * First range specification is honored only + * + *---------------------------------------------------------------------- + */ + + static int + ParseRange(Ns_Conn *conn, unsigned long size, + unsigned long *offset1, unsigned long *offset2) + { + char *range; + + *offset1 = *offset2 = 0; + + if ((range = Ns_SetIGet(conn->headers, "Range")) != NULL + && (range = strchr(range,'=')) != NULL) { + range++; + if (isdigit(*range)) { + *offset1 = atol(range); + while (isdigit(*range)) range++; + if (*range == '-') { + range++; + *offset2 = atol(range); + if (*offset2 == 0 || *offset2 >= size) { + *offset2 = size - 1; + } + } + } else if (*range == '-') { + range++; + *offset2 = atol(range); + if (*offset2 > size) { + *offset2 = size; + } + /* Size from the end requested, convert into offset */ + *offset1 = size - *offset2; + *offset2 = *offset1 + *offset2 - 1; + } + } + if (*offset2 == 0) { + return NS_ERROR; + } + return NS_OK; + } + Index: return.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/return.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** return.c 27 Jun 2005 17:48:57 -0000 1.7 --- return.c 28 Jun 2005 20:15:44 -0000 1.8 *************** *** 368,371 **** --- 368,401 ---- } + /* + *---------------------------------------------------------------------- + * + * Ns_ConnVSetHeaders -- + * + * Add a printf-style string as an output header. + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + + void + Ns_ConnVSetHeaders(Ns_Conn *conn, char *field, char *fmt,...) + { + Ns_DString ds; + va_list ap; + + Ns_DStringInit(&ds); + va_start(ap, fmt); + Ns_DStringVPrintf(&ds, fmt, ap); + va_end(ap); + Ns_SetPut(conn->outputheaders, field, ds.string); + Ns_DStringFree(&ds); + } + /* |
From: Vlad S. <ser...@us...> - 2005-06-28 20:15:52
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3191/include Modified Files: ns.h Log Message: Added Ns_ConnVSetHeaders function to add headers to the output in printf-style way Added support for Range: header for returning partial content Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ns.h 13 Jun 2005 06:14:26 -0000 1.27 --- ns.h 28 Jun 2005 20:15:43 -0000 1.28 *************** *** 1014,1017 **** --- 1014,1018 ---- NS_EXTERN int Ns_ConnFlushHeaders(Ns_Conn *conn, int status); NS_EXTERN void Ns_ConnSetHeaders(Ns_Conn *conn, char *field, char *value); + NS_EXTERN void Ns_ConnVSetHeaders(Ns_Conn *conn, char *field, char *fmt,...); NS_EXTERN void Ns_ConnCondSetHeaders(Ns_Conn *conn, char *field, char *value); NS_EXTERN void Ns_ConnReplaceHeaders(Ns_Conn *conn, Ns_Set *newheaders); |
From: Vlad S. <ser...@us...> - 2005-06-28 20:15:52
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3191 Modified Files: ChangeLog Log Message: Added Ns_ConnVSetHeaders function to add headers to the output in printf-style way Added support for Range: header for returning partial content Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** ChangeLog 27 Jun 2005 17:50:53 -0000 1.130 --- ChangeLog 28 Jun 2005 20:15:43 -0000 1.131 *************** *** 1,2 **** --- 1,11 ---- + 2005-06-28 Vlad Seryakov <ser...@us...> + + * include/ns.h: + * nsd/return.c: Added Ns_ConnVSetHeaders function to add + headers to the output in printf-style way. + + * nsd/fastpath.c: Added support for Range: headers in the + requests to return partial content + 2005-06-27 Zoran Vasiljevic <vas...@us...> |
From: Zoran V. <vas...@us...> - 2005-06-27 17:51:16
|
Update of /cvsroot/naviserver/naviserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12453 Modified Files: ChangeLog Log Message: See file. Index: ChangeLog =================================================================== RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** ChangeLog 27 Jun 2005 16:22:29 -0000 1.129 --- ChangeLog 27 Jun 2005 17:50:53 -0000 1.130 *************** *** 1,2 **** --- 1,24 ---- + 2005-06-27 Zoran Vasiljevic <vas...@us...> + + * nsd/nsmain.c: improved clarity of code handling nsconf.home + path rewriting for Windows platform. + + * nsd/tclcmds.c: + * nsd/nswin32.c: removed NsTclFailServiceObjCmd() and tied the + processing to the NS_SIGINT signal as sent by the -restart + option of the "ns_shutdown" command, hence avoiding different + ways to force server restarts on different platforms. + Removed experimental ReportException() call since it does + not really seem to prevent the default handling in Windows where + a Window pops up and the user has to confirm. Such behaviour + prevents the service control manager to restart the service. + + * nsd/return.c: removed unneeded Ns_ConnReturnPath() added by + latest Win changes. The Ns_ConnReturnFile() should be used instead. + + * include/nscheck.h: define __GNUC_PREREQ to false if + not using GCC compiler. This will automatically disable + all GCC-related optimizations. + 2005-06-27 Vlad Seryakov <ser...@us...> |
From: Zoran V. <vas...@us...> - 2005-06-27 17:50:31
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11902/include Modified Files: nscheck.h Log Message: Define __GNUC_PREREQ to false if not using GCC compiler. This will automatically disable all GCC-related optimizations. Index: nscheck.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/nscheck.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nscheck.h 24 Jun 2005 08:35:14 -0000 1.3 --- nscheck.h 27 Jun 2005 17:50:18 -0000 1.4 *************** *** 39,48 **** #define NSCHECK_H - #ifndef _WIN32 - #undef __GNUC_PREREQ #if defined __GNUC__ && defined __GNUC_MINOR__ # define __GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #endif --- 39,48 ---- #define NSCHECK_H #undef __GNUC_PREREQ #if defined __GNUC__ && defined __GNUC_MINOR__ # define __GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) + #else + # define __GNUC_PREREQ(maj, min) (0) #endif *************** *** 110,132 **** #endif - #else /* _WIN32 */ - - # define NS_GNUC_SENTINEL - # define NS_GNUC_NONNULL - # define NS_GNUC_WARN_UNUSED_RESULT - # define NS_GNUC_MAYALIAS - # define NS_GNUC_DEPRECATED - # define NS_GNUC_USED - # define NS_GNUC_FORMAT(m) - # define NS_GNUC_UNUSED - # define NS_GNUC_NORETURN - # define NS_GNUC_PRINTF(fmtarg, firstvararg) - # define NS_GNUC_SCANF(fmtarg, firstvararg) - # define NS_GNUC_MALLOC - # define NS_GNUC_PURE - # define NS_GNUC_CONST - - #endif /* _WIN32 */ - /* * Ensure static RCSID strings aren't optimised away. --- 110,113 ---- |
From: Zoran V. <vas...@us...> - 2005-06-27 17:49:20
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11323/nsd Modified Files: return.c Log Message: Removed unneeded Ns_ConnReturnPath() added by the latest Win changes. The Ns_ConnReturnFile() should be used instead. Index: return.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/return.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** return.c 24 Jun 2005 08:42:02 -0000 1.6 --- return.c 27 Jun 2005 17:48:57 -0000 1.7 *************** *** 1362,1397 **** return result; } - - /* - *---------------------------------------------------------------------- - * - * Ns_ConnReturnPath -- - * - * Open a path and send contents out the conn. - * - * Results: - * See ReturnOpen. - * - * Side effects: - * See ReturnOpen. - * - * Note: - * Added by Archiware - * - *---------------------------------------------------------------------- - */ - - NS_EXPORT int - Ns_ConnReturnPath(Ns_Conn *conn, int status, char *type, char *path, int len); - - int - Ns_ConnReturnPath(Ns_Conn *conn, int status, char *type, char *path, int len) - { - int fd = open(path, O_RDONLY|O_BINARY); - int rv; - - if (fd < 0) return -1; - rv = ReturnOpen(conn, status, type, NULL, NULL, fd, len); - close(fd); - return rv; - } --- 1362,1363 ---- |
From: Zoran V. <vas...@us...> - 2005-06-27 17:48:13
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10889/nsd Modified Files: nsmain.c Log Message: Improved clarity of code handling nsconf.home path rewriting for the Windows platform. Index: nsmain.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsmain.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** nsmain.c 24 Jun 2005 08:38:27 -0000 1.14 --- nsmain.c 27 Jun 2005 17:47:57 -0000 1.15 *************** *** 111,115 **** int i, fd, sig, optind, cmdargc; char **cmdargv; ! char *config, *tcp; Ns_Time timeout; --- 111,115 ---- int i, fd, sig, optind, cmdargc; char **cmdargv; ! char *config; Ns_Time timeout; *************** *** 129,132 **** --- 129,133 ---- struct rlimit rl; #else + char *cwd; /* * The following variables are declared static so they *************** *** 591,610 **** * home, ensuring forward slashes and lowercase. */ ! ! tcp = nsconf.home = getcwd(NULL, _MAX_PATH); if (nsconf.home == NULL) { Ns_Fatal("nsmain: getcwd failed: '%s'", strerror(errno)); } ! while (*nsconf.home != '\0') { ! if (*nsconf.home == '\\') { ! *nsconf.home = '/'; ! } else if (isupper(*nsconf.home)) { ! *nsconf.home = tolower(*nsconf.home); } - ++nsconf.home; } ! nsconf.home = tcp; ! /* * Then, connect to the service control manager if running --- 592,608 ---- * home, ensuring forward slashes and lowercase. */ ! nsconf.home = getcwd(NULL, _MAX_PATH); if (nsconf.home == NULL) { Ns_Fatal("nsmain: getcwd failed: '%s'", strerror(errno)); } ! for (cwd = nsconf.home; *cwd != '\0'; cwd++) { ! if (*cwd == '\\') { ! *cwd = '/'; ! } else if (isupper(*cwd)) { ! *cwd = tolower(*cwd); } } ! /* * Then, connect to the service control manager if running |
From: Zoran V. <vas...@us...> - 2005-06-27 17:47:14
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10075/nsd Modified Files: tclcmds.c nswin32.c Log Message: Removed NsTclFailServiceObjCmd() and tied the processing to the NS_SIGINT signal as sent by the -restart option of the "ns_shutdown" command, hence avoiding different ways to force server restarts on different platforms. Removed experimental ReportException() call since it does not really seem to prevent the default handling in Windows where a Window pops up and the user has to confirm (such behaviour prevents the service control manager to restart the service). Index: nswin32.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nswin32.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nswin32.c 24 Jun 2005 08:40:27 -0000 1.7 --- nswin32.c 27 Jun 2005 17:46:58 -0000 1.8 *************** *** 51,55 **** static void ExitService(void); static char *GetServiceName(Ns_DString *dsPtr, char *server); - static int ReportException(int ec, char *msg); static SERVICE_STATUS_HANDLE hStatus = 0; static SERVICE_STATUS curStatus; --- 51,54 ---- *************** *** 340,344 **** * * Loop endlessly, processing HUP signals until a TERM ! * signal arrives. * * Results: --- 339,343 ---- * * Loop endlessly, processing HUP signals until a TERM ! * signal arrives * * Results: *************** *** 354,358 **** NsHandleSignals(void) { ! int pending; /* --- 353,357 ---- NsHandleSignals(void) { ! int sig; /* *************** *** 374,384 **** Ns_CondWait(&cond, &lock); } ! pending = sigpending; sigpending = 0; Ns_MutexUnlock(&lock); ! if (pending & NS_SIGHUP) { NsRunSignalProcs(); } ! } while (!(pending & NS_SIGTERM)); /* --- 373,392 ---- Ns_CondWait(&cond, &lock); } ! sig = sigpending; sigpending = 0; + if ((sig & NS_SIGINT)) { + + /* + * Signalize the Service Control Manager + * to restart the service. + */ + + servicefailed = 1; + } Ns_MutexUnlock(&lock); ! if ((sig & NS_SIGHUP)) { NsRunSignalProcs(); } ! } while (sig == NS_SIGHUP); /* *************** *** 391,395 **** } ! return pending; } --- 399,403 ---- } ! return sig; } *************** *** 937,963 **** ServiceMain(DWORD argc, LPTSTR *argv) { ! __try { ! hStatus = RegisterServiceCtrlHandler(argv[0], ServiceHandler); ! if (hStatus == 0) { ! Ns_Fatal("nswin32: RegisterServiceCtrlHandler() failed: '%s'", ! SysErrMsg()); ! } ! curStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; ! curStatus.dwServiceSpecificExitCode = 0; ! StartTicker(SERVICE_START_PENDING); ! Ns_Main(argc, argv, NULL); ! StopTicker(); ! ReportStatus(SERVICE_STOP_PENDING, NO_ERROR, 100); ! if (!servicefailed) { ! ReportStatus(SERVICE_STOPPED, 0, 0); ! } ! Ns_Log(Notice, "nswin32: service exiting"); ! ! if(servicefailed) { ! exit(-1); ! } } ! __except (ReportException(GetExceptionCode(), "ServiceMain")) { ! // No code; this block is never executed. } } --- 945,965 ---- ServiceMain(DWORD argc, LPTSTR *argv) { ! hStatus = RegisterServiceCtrlHandler(argv[0], ServiceHandler); ! if (hStatus == 0) { ! Ns_Fatal("nswin32: RegisterServiceCtrlHandler() failed: '%s'", ! SysErrMsg()); } ! curStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; ! curStatus.dwServiceSpecificExitCode = 0; ! StartTicker(SERVICE_START_PENDING); ! Ns_Main(argc, argv, NULL); ! StopTicker(); ! ReportStatus(SERVICE_STOP_PENDING, NO_ERROR, 100); ! if (!servicefailed) { ! ReportStatus(SERVICE_STOPPED, 0, 0); ! } ! Ns_Log(Notice, "nswin32: service exiting"); ! if(servicefailed) { ! exit(-1); } } *************** *** 1108,1163 **** return rc; } - - - /* - *---------------------------------------------------------------------- - * - * NsTclFailServiceObjCmd -- - * - * Tell the server not to unregister from the Service Control Manager - * (SCM) when exiting, effectively leaving SCM wondering about the - * service, thinking it failed and restarting it - * (provided restarting the serice is configured in SCM). - * - * Results: - * None. - * - *---------------------------------------------------------------------- - */ - - int - NsTclFailServiceObjCmd(ClientData dummy, Tcl_Interp *interp, int argc, char **argv) - { - servicefailed = 1; - - return TCL_OK; - } - - /* - *---------------------------------------------------------------------- - * - * reportException -- - * - * Handle expecptions - cause the server to terminate abruptly - * and leave a log trace. It is intended to prevents the default - * handling in Windows where a Window pops up and the user has to - * confirm - which then prevents the service control manager to - * restart the service. (The idea, however, does not seem to work - * as intended - Windows still brings up the popup for reporting - * the "bug" to Microsoft). - * - * Results: - * None. - * - * Side effects: - * Exits the server - * - *---------------------------------------------------------------------- - */ - - static int ReportException(int ec, char *msg) - { - fprintf(stderr, "EXCEPTION %x in %s\n", ec, msg); fflush(stderr); - exit(-1); - return EXCEPTION_EXECUTE_HANDLER; - } --- 1110,1111 ---- Index: tclcmds.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/tclcmds.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tclcmds.c 27 Jun 2005 16:22:30 -0000 1.15 --- tclcmds.c 27 Jun 2005 17:46:56 -0000 1.16 *************** *** 81,85 **** NsTclDummyObjCmd, NsTclICtlObjCmd, - NsTclFailServiceObjCmd, NsTclFTruncateObjCmd, NsTclGetAddrObjCmd, --- 81,84 ---- *************** *** 587,596 **** /* - * nswin32.c - */ - #ifdef WIN32 - {"ns_failservice", NULL, NsTclFailServiceObjCmd}, - #endif - /* * Add more server Tcl commands here. */ --- 586,589 ---- |