cvs commit: apache-1.3/src/main http_protocol.c util.c
jim 00/02/19 17:14:49 Modified:.STATUS src/include ap_mmn.h httpd.h src/main http_protocol.c util.c Log: Hrm Revision ChangesPath 1.808 +3 -5 apache-1.3/STATUS Index: STATUS === RCS file: /home/cvs/apache-1.3/STATUS,v retrieving revision 1.807 retrieving revision 1.808 diff -u -r1.807 -r1.808 --- STATUS2000/02/19 12:51:11 1.807 +++ STATUS2000/02/20 01:14:45 1.808 @@ -1,5 +1,5 @@ 1.3 STATUS: - Last modified at [$Date: 2000/02/19 12:51:11 $] + Last modified at [$Date: 2000/02/20 01:14:45 $] Release: @@ -28,10 +28,8 @@ RELEASE SHOWSTOPPERS: * general/5766: AddDefaultCharset bug with CGI scripts - STATUS: Still not fixed. Jim has a patch that adds the -default charset iff AddDefaultCharset is enabled AND - the type is text/plain or text/html, but he's not sure - if that's correct... Comments? + STATUS: Patch available. +Message-ID: [EMAIL PROTECTED] general/5760: Use of text type t in fopen call... RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: 1.44 +2 -1 apache-1.3/src/include/ap_mmn.h Index: ap_mmn.h === RCS file: /home/cvs/apache-1.3/src/include/ap_mmn.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- ap_mmn.h 2000/01/12 15:54:56 1.43 +++ ap_mmn.h 2000/02/20 01:14:46 1.44 @@ -226,6 +226,7 @@ *ap_base64encode_len(), ap_base64decode(), *ap_base64decode_binary(), ap_base64decode_len(), *ap_pbase64decode(), ap_pbase64encode() + * 19990320.7 - add ap_strcasestr() */ #define MODULE_MAGIC_COOKIE 0x41503133UL /* AP13 */ @@ -233,7 +234,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 19990320 #endif -#define MODULE_MAGIC_NUMBER_MINOR 6 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 7 /* 0...n */ #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR/* backward compat */ /* Useful for testing for features. */ 1.305 +1 -0 apache-1.3/src/include/httpd.h Index: httpd.h === RCS file: /home/cvs/apache-1.3/src/include/httpd.h,v retrieving revision 1.304 retrieving revision 1.305 diff -u -r1.304 -r1.305 --- httpd.h 2000/02/02 20:43:43 1.304 +++ httpd.h 2000/02/20 01:14:46 1.305 @@ -1008,6 +1008,7 @@ API_EXPORT(int) ap_is_matchexp(const char *str); API_EXPORT(int) ap_strcmp_match(const char *str, const char *exp); API_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp); +API_EXPORT(char *) ap_strcasestr(const char *s1, const char *s2); API_EXPORT(char *) ap_pbase64decode(pool *p, const char *bufcoded); API_EXPORT(char *) ap_pbase64encode(pool *p, char *string); API_EXPORT(char *) ap_uudecode(pool *p, const char *bufcoded); 1.289 +17 -9 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.288 retrieving revision 1.289 diff -u -r1.288 -r1.289 --- http_protocol.c 2000/02/08 00:34:36 1.288 +++ http_protocol.c 2000/02/20 01:14:47 1.289 @@ -112,22 +112,30 @@ *- return type */ static const char *make_content_type(request_rec *r, const char *type) { -const char *i; +char *needcset[] = { + text/plain, + text/html, + NULL }; +char **pcset; core_dir_config *conf = (core_dir_config *)ap_get_module_config( r-per_dir_config, core_module); if (!type) type = ap_default_type(r); if (conf-add_default_charset != ADD_DEFAULT_CHARSET_ON) return type; -i = type; -while (*i *i != ';') i++; -if (*i *i == ';') { +if (ap_strcasestr(type, charset=) != NULL) { /* already has parameter, do nothing */ - /* XXX should check for actual charset=, but then we need real - * parsing code - */ + /* XXX we don't check the validity */ + ; } else { - type = ap_pstrcat(r-pool, type, ; charset=, - conf-add_default_charset_name, NULL); + /* see if it makes sense to add the charset. At present, + * we only add it if the Content-type is one of needcset[] + */ + for (pcset = needcset; *pcset ; pcset++) + if (ap_strcasestr(type, *pcset) != NULL) { + type = ap_pstrcat(r-pool, type, ; charset=, + conf-add_default_charset_name, NULL); +
cvs commit: apache-1.3/src/main http_protocol.c
martin 99/12/06 04:41:42 Modified:src CHANGES src/main http_protocol.c Log: EBCDIC: Fixed binary upload capability (plain and chunked) for all methods using the ap_*_client_block() functions, most notably POST and PUT. The functionality to switch input between protocol parts (chunks) and (possibly binary) data had been missing all the time, making chunked PUT impossible until now. Hello TPF developers: I think these five lines in os/tpf/os.c ought to be removed: else{ if (r-method_number == M_PUT) ap_bsetflag(r-connection-client, B_ASCII2EBCDIC, 0); /* don't translate non-text files to EBCDIC */ } Also, your change to Vincent's mod_put should be undone. In a next step, I will try to make EBCDIC conversion completely configurable. Any volunteers for helping (designing/implementing)? Revision ChangesPath 1.1470+7 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1469 retrieving revision 1.1470 diff -u -r1.1469 -r1.1470 --- CHANGES 1999/12/04 11:43:12 1.1469 +++ CHANGES 1999/12/06 12:41:35 1.1470 @@ -1,5 +1,12 @@ Changes with Apache 1.3.10 + *) EBCDIC: Fixed binary upload capability (plain and chunked) for + all methods using the ap_*_client_block() functions, most notably + POST and PUT. The functionality to switch input between protocol + parts (chunks) and (possibly binary) data had been missing all + the time, making chunked PUT impossible until now. + [Martin Kraemer] + *) Fixed a recently introduced off-by-one-character bug in mod_rewrite's expansion of expression back-references. [Cliff Woolley [EMAIL PROTECTED]] PR#4766 PR#5389 1.282 +78 -23apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.281 retrieving revision 1.282 diff -u -r1.281 -r1.282 --- http_protocol.c 1999/12/01 20:45:41 1.281 +++ http_protocol.c 1999/12/06 12:41:39 1.282 @@ -81,6 +81,27 @@ ap_bgetopt (r-connection-client, BO_BYTECT, r-bytes_sent); \ } while (0) +#ifdef CHARSET_EBCDIC +/* Save Restore the current conversion settings + * input means: ASCII - EBCDIC (when reading MIME Headers and PUT/POST data) + * output means: EBCDIC - ASCII (when sending MIME Headers and Chunks) + */ + +#define PUSH_EBCDIC_INPUTCONVERSION_STATE(_buff, _onoff) \ +int _convert_in = ap_bgetflag(_buff, B_ASCII2EBCDIC); \ +ap_bsetflag(_buff, B_ASCII2EBCDIC, _onoff); + +#define POP_EBCDIC_INPUTCONVERSION_STATE(_buff) \ +ap_bsetflag(_buff, B_ASCII2EBCDIC, _convert_in); + +#define PUSH_EBCDIC_OUTPUTCONVERSION_STATE(_buff, _onoff) \ +int _convert_out = ap_bgetflag(_buff, B_EBCDIC2ASCII); \ +ap_bsetflag(_buff, B_EBCDIC2ASCII, _onoff); + +#define POP_EBCDIC_OUTPUTCONVERSION_STATE(_buff) \ +ap_bsetflag(_buff, B_EBCDIC2ASCII, _convert_out); + +#endif /*CHARSET_EBCDIC*/ static int parse_byterange(char *range, long clength, long *start, long *end) { @@ -217,8 +238,7 @@ * set to ON (protocol strings MUST be converted) * and reset to original setting before returning */ -int convert = ap_bgetflag(r-connection-client, B_EBCDIC2ASCII); -ap_bsetflag(r-connection-client, B_EBCDIC2ASCII, 1); +PUSH_EBCDIC_OUTPUTCONVERSION_STATE(r-connection-client, 1); #endif /*CHARSET_EBCDIC*/ if (!**r_range) { @@ -229,8 +249,7 @@ *tlength += 4 + strlen(r-boundary) + 4; } #ifdef CHARSET_EBCDIC - if (!convert) - ap_bsetflag(r-connection-client, B_EBCDIC2ASCII, convert); +POP_EBCDIC_OUTPUTCONVERSION_STATE(r-connection-client); #endif /*CHARSET_EBCDIC*/ return 0; } @@ -238,8 +257,7 @@ range = ap_getword(r-pool, r_range, ','); if (!parse_byterange(range, r-clength, range_start, range_end)) { #ifdef CHARSET_EBCDIC - if (!convert) - ap_bsetflag(r-connection-client, B_EBCDIC2ASCII, convert); +POP_EBCDIC_OUTPUTCONVERSION_STATE(r-connection-client); #endif /*CHARSET_EBCDIC*/ /* Skip this one */ return internal_byterange(realreq, tlength, r, r_range, offset, @@ -269,8 +287,7 @@ *tlength += range_end - range_start + 1; } #ifdef CHARSET_EBCDIC -if (!convert) - ap_bsetflag(r-connection-client, B_EBCDIC2ASCII, convert); +POP_EBCDIC_OUTPUTCONVERSION_STATE(r-connection-client); #endif /*CHARSET_EBCDIC*/ return 1; } @@ -685,14 +702,27 @@ char
cvs commit: apache-1.3/src/main http_protocol.c
martin 99/12/01 12:45:47 Modified:src CHANGES src/main http_protocol.c Log: EBCDIC: Fix Byte Ranges for EBCDIC platforms. The necessary switch between implied conversion for protocol parts and configured conversion for document data was missing. The effect of this was that PDF files could not be read by Acrobat Reader (which sends long lists of byte ranges in each request) when the server was apache on ebcdic machines. Submitted by: Oliver Reh [EMAIL PROTECTED] Reviewed by: Martin Kraemer Revision ChangesPath 1.1466+9 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1465 retrieving revision 1.1466 diff -u -r1.1465 -r1.1466 --- CHANGES 1999/12/01 20:33:58 1.1465 +++ CHANGES 1999/12/01 20:45:29 1.1466 @@ -1,5 +1,14 @@ Changes with Apache 1.3.10 + *) EBCDIC: Fix Byte Ranges for EBCDIC platforms. The necessary switch + between implied conversion for protocol parts and configured + conversion for document data was missing. The effect of this was that + PDF files could not be read by Acrobat Reader (which sends long + lists of byte ranges in each request) when the server was apache + on ebcdic machines. + [Noted by Oliver Reh [EMAIL PROTECTED], solved by + Martin Kraemer] + *) Add IndexOptions FoldersFirst to allow fancy-indexed directory listings to have the subdirectories always listed at the top. [Ken Coar] 1.281 +22 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.280 retrieving revision 1.281 diff -u -r1.280 -r1.281 --- http_protocol.c 1999/11/05 15:41:03 1.280 +++ http_protocol.c 1999/12/01 20:45:41 1.281 @@ -212,6 +212,14 @@ { long range_start, range_end; char *range; +#ifdef CHARSET_EBCDIC +/* determine current setting of conversion flag, + * set to ON (protocol strings MUST be converted) + * and reset to original setting before returning + */ +int convert = ap_bgetflag(r-connection-client, B_EBCDIC2ASCII); +ap_bsetflag(r-connection-client, B_EBCDIC2ASCII, 1); +#endif /*CHARSET_EBCDIC*/ if (!**r_range) { if (r-byterange 1) { @@ -220,14 +228,23 @@ else *tlength += 4 + strlen(r-boundary) + 4; } +#ifdef CHARSET_EBCDIC + if (!convert) + ap_bsetflag(r-connection-client, B_EBCDIC2ASCII, convert); +#endif /*CHARSET_EBCDIC*/ return 0; } range = ap_getword(r-pool, r_range, ','); -if (!parse_byterange(range, r-clength, range_start, range_end)) +if (!parse_byterange(range, r-clength, range_start, range_end)) { +#ifdef CHARSET_EBCDIC + if (!convert) + ap_bsetflag(r-connection-client, B_EBCDIC2ASCII, convert); +#endif /*CHARSET_EBCDIC*/ /* Skip this one */ return internal_byterange(realreq, tlength, r, r_range, offset, length); +} if (r-byterange 1) { const char *ct = r-content_type ? r-content_type : ap_default_type(r); @@ -251,6 +268,10 @@ else { *tlength += range_end - range_start + 1; } +#ifdef CHARSET_EBCDIC +if (!convert) + ap_bsetflag(r-connection-client, B_EBCDIC2ASCII, convert); +#endif /*CHARSET_EBCDIC*/ return 1; }
cvs commit: apache-1.3/src/main http_protocol.c
fielding99/08/14 02:21:20 Modified:src CHANGES src/main http_protocol.c Log: Remove bogus error message when a redirect doesn't set Location. Instead, use an empty string to avoid coredump if the error message was supposed to include a location but doesn't. Revision ChangesPath 1.1422+4 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1421 retrieving revision 1.1422 diff -u -r1.1421 -r1.1422 --- CHANGES 1999/08/14 08:35:43 1.1421 +++ CHANGES 1999/08/14 09:21:15 1.1422 @@ -1,5 +1,9 @@ Changes with Apache 1.3.9 + *) Remove bogus error message when a redirect doesn't set Location. + Instead, use an empty string to avoid coredump if the error message + was supposed to include a location. [Roy Fielding] + *) Don't allow configure to include mod_auth_digest unless it is explicitly requested, even if the user asked for all modules. [Roy Fielding] 1.279 +7 -18 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.278 retrieving revision 1.279 diff -u -r1.278 -r1.279 --- http_protocol.c 1999/08/14 08:35:48 1.278 +++ http_protocol.c 1999/08/14 09:21:19 1.279 @@ -2450,24 +2450,13 @@ ap_clear_table(r-err_headers_out); if (ap_is_HTTP_REDIRECT(status) || (status == HTTP_CREATED)) { - if ((location != NULL) *location) { - ap_table_setn(r-headers_out, Location, location); - } - else { - /* - * We're supposed to tell the client to go somewhere, - * but the destination was omitted. Turn this into - * a 500 status with an explanatory note in the error log. - */ - ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, - resource created or redirection requested - (status=%03d) but no Location field set - (URI=%s), - r-status, r-unparsed_uri); - r-status = status = HTTP_INTERNAL_SERVER_ERROR; - r-status_line = NULL; - } - } +if ((location != NULL) *location) { + ap_table_setn(r-headers_out, Location, location); +} +else { +location = ; /* avoids coredump when printing, below */ +} +} r-content_language = NULL; r-content_languages = NULL;
cvs commit: apache-1.3/src/main http_protocol.c
fielding99/08/09 02:41:41 Modified:src CHANGES src/main http_protocol.c Log: Flush the output buffer immediately after sending an error or redirect response, since the result will be needed by the client to abort a long data transfer or restart a series of pipelined requests. Submitted by: Tom Vaughan [EMAIL PROTECTED], Roy Fielding Revision ChangesPath 1.1414+5 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1413 retrieving revision 1.1414 diff -u -r1.1413 -r1.1414 --- CHANGES 1999/08/09 07:38:36 1.1413 +++ CHANGES 1999/08/09 09:41:36 1.1414 @@ -1,5 +1,10 @@ Changes with Apache 1.3.8 + *) Flush the output buffer immediately after sending an error or redirect + response, since the result may be needed by the client to abort a + long data transfer or restart a series of pipelined requests. + [Tom Vaughan [EMAIL PROTECTED], Roy Fielding] + *) PORT: Improved compilation and DSO support on Sequent DYNIX/ptx. [Ian Turner [EMAIL PROTECTED]] PR#4735 1.277 +3 -5 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.276 retrieving revision 1.277 diff -u -r1.276 -r1.277 --- http_protocol.c 1999/08/08 11:45:18 1.276 +++ http_protocol.c 1999/08/09 09:41:39 1.277 @@ -949,7 +949,6 @@ ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, request failed: URI too long); ap_send_error_response(r, 0); -ap_rflush(r); ap_log_transaction(r); return r; } @@ -963,7 +962,6 @@ ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, request failed: error reading the headers); ap_send_error_response(r, 0); -ap_rflush(r); ap_log_transaction(r); return r; } @@ -983,7 +981,6 @@ r-header_only = 0; r-status = HTTP_BAD_REQUEST; ap_send_error_response(r, 0); -ap_rflush(r); ap_log_transaction(r); return r; } @@ -1016,7 +1013,6 @@ client sent HTTP/1.1 request without hostname (see RFC2068 section 9, and 14.23): %s, r-uri); ap_send_error_response(r, 0); -ap_rflush(r); ap_log_transaction(r); return r; } @@ -1037,7 +1033,6 @@ client sent an unrecognized expectation value of Expect: %s, expect); ap_send_error_response(r, 0); -ap_rflush(r); (void) ap_discard_request_body(r); ap_log_transaction(r); return r; @@ -2487,6 +2482,7 @@ if (r-header_only) { ap_finalize_request_protocol(r); +ap_rflush(r); return; } } @@ -2510,6 +2506,7 @@ ap_rputs(custom_response + 1, r); ap_kill_timeout(r); ap_finalize_request_protocol(r); +ap_rflush(r); return; } /* @@ -2773,4 +2770,5 @@ } ap_kill_timeout(r); ap_finalize_request_protocol(r); +ap_rflush(r); }
cvs commit: apache-1.3/src/main http_protocol.c
fielding99/07/30 17:37:27 Modified:src CHANGES src/main http_protocol.c Log: Fix SIGSEGV on some systems because the Vary fixup included a call to table_do with a variable argument list that was not NULL terminated. Other optimizations will follow. Revision ChangesPath 1.1405+13 -1 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1404 retrieving revision 1.1405 diff -u -r1.1404 -r1.1405 --- CHANGES 1999/07/29 22:58:09 1.1404 +++ CHANGES 1999/07/31 00:37:22 1.1405 @@ -1,6 +1,18 @@ Changes with Apache 1.3.8 -Changes with Apache 1.3.7 + *) Change for EBCDIC platforms (TPF and BS2000) to correctly deal + with ASCII/EBCDIC conversions in ident query. + [David McCreedy [EMAIL PROTECTED]] + + *) Get rid of redefinition warning on MAC_OS_X_SERVER platform. + Change Power Macintosh to Power* so if uname prints Power Book + we're still happy on Rhapsody platforms. [Wilfredo Sanchez] + + *) Fix SIGSEGV on some systems because the Vary fix below included + a call to table_do with a variable argument list that was not + NULL terminated. [Roy Fielding] + +Changes with Apache 1.3.7 [not released] *) The Vary response header field is now sanitised right before the header is sent back to the client. Multiple Vary fields 1.274 +1 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.273 retrieving revision 1.274 diff -u -r1.273 -r1.274 --- http_protocol.c 1999/07/29 22:22:04 1.273 +++ http_protocol.c 1999/07/31 00:37:25 1.274 @@ -1491,7 +1491,7 @@ return; } ap_table_do((int (*)(void *, const char *, const char *))merge_vary_fields, - (void *) r, r-headers_out, Vary); + (void *) r, r-headers_out, Vary, NULL); vary = ap_table_get(r-notes, Vary-list); /* XXX: we could make things a lot better, by having r-vary,
cvs commit: apache-1.3/src/main http_protocol.c
fielding99/07/30 20:30:19 Modified:src CHANGES src/main http_protocol.c Log: Replace the Vary fixup code with a single-pass, single-copy implementation that only adds the cost of a single ap_make_array when there is no Vary field. Revision ChangesPath 1.1406+1 -1 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1405 retrieving revision 1.1406 diff -u -r1.1405 -r1.1406 --- CHANGES 1999/07/31 00:37:22 1.1405 +++ CHANGES 1999/07/31 03:30:16 1.1406 @@ -10,7 +10,7 @@ *) Fix SIGSEGV on some systems because the Vary fix below included a call to table_do with a variable argument list that was not - NULL terminated. [Roy Fielding] + NULL terminated. Replaced with better implementation. [Roy Fielding] Changes with Apache 1.3.7 [not released] 1.275 +56 -85apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.274 retrieving revision 1.275 diff -u -r1.274 -r1.275 --- http_protocol.c 1999/07/31 00:37:25 1.274 +++ http_protocol.c 1999/07/31 03:30:18 1.275 @@ -1446,27 +1446,55 @@ strstr(ua, MSIE 3))); } -/* - * qsort comparison routine for fixup_vary(). +/* This routine is called by ap_table_do and merges all instances of + * the passed field values into a single array that will be further + * processed by some later routine. Originally intended to help split + * and recombine multiple Vary fields, though it is generic to any field + * consisting of comma/space-separated tokens. */ -static int compare_vary(const void *va, const void *vb) +static int uniq_field_values(void *d, const char *key, const char *val) { -return strcasecmp(*(const char **)va, *(const char **)vb); -} +array_header *values; +char *start; +char *e; +char **strpp; +int i; -/* - * ap_table_get() only picks up the first occurrence of a key, - * which means that if there's a Vary in r-headers_out and another - * in r-err_headers_out, one might get ignored. This routine - * is called by ap_table_do and merges all instances of Vary into - * a temporary list in r-notes. - */ -static int merge_vary_fields(void *d, const char *key, const char *val) -{ -request_rec *r; +values = (array_header *)d; + +e = ap_pstrdup(values-pool, val); -r = (request_rec *)d; -ap_table_merge(r-notes, Vary-list, val); +do { +/* Find a non-empty fieldname */ + +while (*e == ',' || ap_isspace(*e)) { +++e; +} +if (*e == '\0') { +break; +} +start = e; +while (*e != '\0' *e != ',' !ap_isspace(*e)) { +++e; +} +if (*e != '\0') { +*e++ = '\0'; +} + +/* Now add it to values if it isn't already represented. + * Could be replaced by a ap_array_strcasecmp() if we had one. + */ +for (i = 0, strpp = (char **) values-elts; i values-nelts; + ++i, ++strpp) { +if (*strpp strcasecmp(*strpp, start) == 0) { +break; +} +} +if (i == values-nelts) { /* if not found */ + *(char **)ap_push_array(values) = start; +} +} while (*e != '\0'); + return 1; } @@ -1477,80 +1505,23 @@ */ static void fixup_vary(request_rec *r) { -const char *vary; -array_header *arr; -char *start; -char *e; -char **ecur; -char **eend; -char **ekeep; +array_header *varies; -/* Don't do any unnecessary manipulations.. - */ -if (ap_table_get(r-headers_out, Vary) == NULL) { - return; -} -ap_table_do((int (*)(void *, const char *, const char *))merge_vary_fields, - (void *) r, r-headers_out, Vary, NULL); -vary = ap_table_get(r-notes, Vary-list); - -/* XXX: we could make things a lot better, by having r-vary, - * which is an array of char * -- which modules append to as they - * find things which the request varies on. This is probably - * better than a table, because a table would require O(n^2) - * string comparisons... another option would be to use a table - * but indicate that folks should use ap_table_add... - * at any rate, if we had such an array, we would just set - * arr = r-vary here (or arr = ap_table_elts(r-vary)). - */ -arr = ap_make_array(r-pool, 5, sizeof(char *)); +varies = ap_make_array(r-pool, 5,
cvs commit: apache-1.3/src/main http_protocol.c
fielding99/07/19 03:16:04 Modified:src CHANGES src/main http_protocol.c Log: Fix handling of case when a client has sent Expect: 100-continue and we are going to respond with an error, but get stuck waiting to discard the body in the pointless hope of preserving the connection. This remains less than satisfactory, since what we really should be doing is sending the response immediately and discarding the request body as some form of post-response cleanup. Something to consider. PR: 4499, 3806 Submitted by: Roy Fielding, Joe Orton [EMAIL PROTECTED] Revision ChangesPath 1.1397+5 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1396 retrieving revision 1.1397 diff -u -r1.1396 -r1.1397 --- CHANGES 1999/07/10 18:27:26 1.1396 +++ CHANGES 1999/07/19 10:15:53 1.1397 @@ -1,5 +1,10 @@ Changes with Apache 1.3.7 + *) Fix handling of case when a client has sent Expect: 100-continue + and we are going to respond with an error, but get stuck waiting to + discard the body in the pointless hope of preserving the connection. + [Roy Fielding, Joe Orton [EMAIL PROTECTED]] PR#4499, PR#3806 + *) Fix 'configure' to work correctly with SysV-based versions of 'tr' (consistent with Configure's use as well). [Jim Jagielski] 1.272 +9 -5 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.271 retrieving revision 1.272 diff -u -r1.271 -r1.272 --- http_protocol.c 1999/07/03 07:59:49 1.271 +++ http_protocol.c 1999/07/19 10:15:58 1.272 @@ -1881,14 +1881,18 @@ if ((rv = ap_setup_client_block(r, REQUEST_CHUNKED_PASS))) return rv; -/* If we are discarding the request body, then we must already know - * the final status code, therefore disable the sending of 100 continue. +/* In order to avoid sending 100 Continue when we already know the + * final response status, and yet not kill the connection if there is + * no request body to be read, we need to duplicate the test from + * ap_should_client_block() here negated rather than call it directly. */ -r-expecting_100 = 0; - -if (ap_should_client_block(r)) { +if ((r-read_length == 0) (r-read_chunked || (r-remaining 0))) { char dumpbuf[HUGE_STRING_LEN]; +if (r-expecting_100) { +r-connection-keepalive = -1; +return OK; +} ap_hard_timeout(reading request body, r); while ((rv = ap_get_client_block(r, dumpbuf, HUGE_STRING_LEN)) 0) continue;
cvs commit: apache-1.3/src/main http_protocol.c
coar99/06/02 13:11:20 Modified:src CHANGES src/main http_protocol.c Log: Trap (with an errorlog entry) malformed redirects from modules; i.e., that fail to set a Location field. Revision ChangesPath 1.1366+3 -2 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1365 retrieving revision 1.1366 diff -u -r1.1365 -r1.1366 --- CHANGES 1999/06/02 20:01:50 1.1365 +++ CHANGES 1999/06/02 20:11:16 1.1366 @@ -9,8 +9,9 @@ *) If a Location field was stored in r-err_headers_out rather than r-headers_out, redirect processing wouldn't find it and - the server would core dump on ap_escape_html(NULL). - [Doug MacEachern, Ken Coar] + the server would core dump on ap_escape_html(NULL). Check both + tables and raise HTTP_INTERNAL_SERVER_ERROR with a log message + if Location isn't set. [Doug MacEachern, Ken Coar] *) Add RULE_EXPAT, the src/lib/ directory structure, and a modified copy of the Expat 1.0.2 distribution. [Greg Stein] 1.269 +20 -4 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.268 retrieving revision 1.269 diff -u -r1.268 -r1.269 --- http_protocol.c 1999/05/26 18:28:06 1.268 +++ http_protocol.c 1999/06/02 20:11:19 1.269 @@ -2367,9 +2367,24 @@ r-err_headers_out = tmp; ap_clear_table(r-err_headers_out); -if ((location != NULL) *location - (ap_is_HTTP_REDIRECT(status) || status == HTTP_CREATED)) { -ap_table_setn(r-headers_out, Location, location); +if (ap_is_HTTP_REDIRECT(status) || (status == HTTP_CREATED)) { + if ((location != NULL) *location) { + ap_table_setn(r-headers_out, Location, location); + } + else { + /* + * We're supposed to tell the client to go somewhere, + * but the destination was omitted. Turn this into + * a 500 status with an explanatory note in the error log. + */ + ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, + resource created or redirection requested + (status=%03d) but no Location field set + (URI=%s), + r-status, r-unparsed_uri); + r-status = status = HTTP_INTERNAL_SERVER_ERROR; + r-status_line = NULL; + } } r-content_language = NULL; @@ -2631,7 +2646,8 @@ (h1 = ap_table_get(r-notes, verbose-error-to)) != NULL (strcmp(h1, *) == 0)) { ap_rvputs(r, error_notes, P\n, NULL); - } else { + } + else { ap_rvputs(r, The server encountered an internal error or\n misconfiguration and was unable to complete\n your request.P\n
cvs commit: apache-1.3/src/main http_protocol.c
coar99/05/26 11:28:16 Modified:src CHANGES src/main http_protocol.c Log: Make sure that redirect processing looks for the Location field in both headers_out and err_headers_out. Revision ChangesPath 1.1363+5 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1362 retrieving revision 1.1363 diff -u -r1.1362 -r1.1363 --- CHANGES 1999/05/25 10:23:15 1.1362 +++ CHANGES 1999/05/26 18:27:43 1.1363 @@ -1,5 +1,10 @@ Changes with Apache 1.3.7 + *) If a Location field was stored in r-err_headers_out rather + than r-headers_out, redirect processing wouldn't find it and + the server would core dump on ap_escape_html(NULL). + [Doug MacEachern, Ken Coar] + *) Add RULE_EXPAT, the src/lib/ directory structure, and a modified copy of the Expat 1.0.2 distribution. [Greg Stein] 1.268 +11 -2 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.267 retrieving revision 1.268 diff -u -r1.267 -r1.268 --- http_protocol.c 1999/05/03 15:09:07 1.267 +++ http_protocol.c 1999/05/26 18:28:06 1.268 @@ -2308,6 +2308,14 @@ char *custom_response; const char *location = ap_table_get(r-headers_out, Location); +/* + * It's possible that the Location field might be in r-err_headers_out + * instead of r-headers_out; use the latter if possible, else the + * former. + */ +if (location == NULL) { + location = ap_table_get(r-err_headers_out, Location); +} /* We need to special-case the handling of 204 and 304 responses, * since they have specific HTTP requirements and do not include a * message body. Note that being assbackwards here is not an option. @@ -2359,9 +2367,10 @@ r-err_headers_out = tmp; ap_clear_table(r-err_headers_out); -if (location *location - (ap_is_HTTP_REDIRECT(status) || status == HTTP_CREATED)) +if ((location != NULL) *location + (ap_is_HTTP_REDIRECT(status) || status == HTTP_CREATED)) { ap_table_setn(r-headers_out, Location, location); + } r-content_language = NULL; r-content_languages = NULL;
cvs commit: apache-1.3/src/main http_protocol.c
coar99/05/03 08:09:08 Modified:src CHANGES src/main http_protocol.c Log: If we're removing Vary from the response header, force the response to HTTP/1.0 for cache friendliness. Submitted by: Dmitry Khrustalev [EMAIL PROTECTED] Reviewed by: Ken Coar Revision ChangesPath 1.1341+1 -1 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1340 retrieving revision 1.1341 diff -u -r1.1340 -r1.1341 --- CHANGES 1999/05/03 10:23:44 1.1340 +++ CHANGES 1999/05/03 15:09:04 1.1341 @@ -34,7 +34,7 @@ *) Add force-no-vary envariable to allow servers to work around clients that choke on Vary fields in the response header. - [Ken Coar] PR#4118 + [Ken Coar, Dmitry Khrustalev [EMAIL PROTECTED]] PR#4118 *) Fixed a bug in mod_dir that causes a child process will infinitely recurse when it attemps to handle a request for a directory wnd the 1.267 +4 -0 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.266 retrieving revision 1.267 diff -u -r1.266 -r1.267 --- http_protocol.c 1999/04/29 15:06:52 1.266 +++ http_protocol.c 1999/05/03 15:09:07 1.267 @@ -1476,9 +1476,13 @@ /* * Remove the 'Vary' header field if the client can't handle it. + * Since this will have nasty effects on HTTP/1.1 caches, force + * the response into HTTP/1.0 mode. */ if (ap_table_get(r-subprocess_env, force-no-vary) != NULL) { ap_table_unset(r-headers_out, Vary); + r-proto_num = HTTP_VERSION(1,0); + ap_table_set(r-subprocess_env, force-response-1.0, 1); } ap_hard_timeout(send headers, r);
cvs commit: apache-1.3/src/main http_protocol.c
dgaudet 99/04/20 10:51:40 Modified:src CHANGES src/include ap_mmn.h http_protocol.h src/main http_protocol.c Log: Add ap_vrprintf() function PR: 4246 Submitted by: John Tobey [EMAIL PROTECTED] Revision ChangesPath 1.1311+2 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1310 retrieving revision 1.1311 diff -u -r1.1310 -r1.1311 --- CHANGES 1999/04/20 17:27:47 1.1310 +++ CHANGES 1999/04/20 17:51:35 1.1311 @@ -1,5 +1,7 @@ Changes with Apache 1.3.7 + *) Add ap_vrprintf() function. [John Tobey [EMAIL PROTECTED]] PR#4246 + *) Fix the mod_mime hash table to work properly with locales other than C. [Dean Gaudet] PR#3427 1.33 +2 -1 apache-1.3/src/include/ap_mmn.h Index: ap_mmn.h === RCS file: /home/cvs/apache-1.3/src/include/ap_mmn.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- ap_mmn.h 1999/03/20 23:43:23 1.32 +++ ap_mmn.h 1999/04/20 17:51:37 1.33 @@ -214,6 +214,7 @@ * 19990108.6 - SIGPIPE is now ignored by the core server. * 19990108.7 - ap_isxdigit added * 19990320 - METHODS and M_INVALID symbol values modified + * 19990320.1 - add ap_vrprintf() */ #define MODULE_MAGIC_COOKIE 0x41503133UL /* AP13 */ @@ -221,7 +222,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 19990320 #endif -#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */ #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR/* backward compat */ /* Useful for testing for features. */ 1.49 +1 -0 apache-1.3/src/include/http_protocol.h Index: http_protocol.h === RCS file: /home/cvs/apache-1.3/src/include/http_protocol.h,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- http_protocol.h 1999/01/01 19:04:40 1.48 +++ http_protocol.h 1999/04/20 17:51:37 1.49 @@ -148,6 +148,7 @@ API_EXPORT(int) ap_rputs(const char *str, request_rec *r); API_EXPORT(int) ap_rwrite(const void *buf, int nbyte, request_rec *r); API_EXPORT_NONSTD(int) ap_rvputs(request_rec *r,...); +API_EXPORT(int) ap_vrprintf(request_rec *r, const char *fmt, va_list vlist); API_EXPORT_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt,...) __attribute__((format(printf,2,3))); API_EXPORT(int) ap_rflush(request_rec *r); 1.262 +22 -0 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.261 retrieving revision 1.262 diff -u -r1.261 -r1.262 --- http_protocol.c 1999/03/10 17:42:42 1.261 +++ http_protocol.c 1999/04/20 17:51:38 1.262 @@ -2173,6 +2173,28 @@ return n; } +API_EXPORT(int) ap_vrprintf(request_rec *r, const char *fmt, va_list ap) +{ +int n; + +if (r-connection-aborted) +return -1; + +n = ap_vbprintf(r-connection-client, fmt, ap); + +if (n 0) { +if (!r-connection-aborted) { +ap_log_rerror(APLOG_MARK, APLOG_INFO, r, +client stopped connection before vrprintf completed); +ap_bsetflag(r-connection-client, B_EOUT, 1); +r-connection-aborted = 1; +} +return -1; +} +SET_BYTES_SENT(r); +return n; +} + API_EXPORT(int) ap_rprintf(request_rec *r, const char *fmt,...) { va_list vlist;
cvs commit: apache-1.3/src/main http_protocol.c
dgaudet 99/04/20 11:36:10 Modified:src CHANGES src/main http_protocol.c Log: deal with UTS compiler error PR: 4189 Submitted by: Dave Dykstra [EMAIL PROTECTED] Revision ChangesPath 1.1312+3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1311 retrieving revision 1.1312 diff -u -r1.1311 -r1.1312 --- CHANGES 1999/04/20 17:51:35 1.1311 +++ CHANGES 1999/04/20 18:36:01 1.1312 @@ -1,5 +1,8 @@ Changes with Apache 1.3.7 + *) PORT: deal with UTS compiler error in http_protocol.c + [Dave Dykstra [EMAIL PROTECTED]] PR#4189 + *) Add ap_vrprintf() function. [John Tobey [EMAIL PROTECTED]] PR#4246 *) Fix the mod_mime hash table to work properly with locales other 1.263 +10 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.262 retrieving revision 1.263 diff -u -r1.262 -r1.263 --- http_protocol.c 1999/04/20 17:51:38 1.262 +++ http_protocol.c 1999/04/20 18:36:07 1.263 @@ -1170,7 +1170,16 @@ * and must be listed in order. */ -static const char * const status_lines[RESPONSE_CODES] = { +#ifdef UTS21 +/* The second const triggers an assembler bug on UTS 2.1. + * Another workaround is to move some code out of this file into another, + * but this is easier. Dave Dykstra, 3/31/99 + */ +static const char * status_lines[RESPONSE_CODES] = +#else +static const char * const status_lines[RESPONSE_CODES] = +#endif +{ 100 Continue, 101 Switching Protocols, 102 Processing,
cvs commit: apache-1.3/src/main http_protocol.c
dgaudet 99/02/22 09:13:06 Modified:src/include httpd.h src/main http_protocol.c Log: Fix a compile warning -- there was a const discarded with the recent verbose-errors-to change. Also move status_lines[] to constant storage (better mem behaviour for kernels that do the right thing)... and let the const be propagated through r-status_line (anything which didn't treat that as a const before was broken -- now it'll be a compile warning). Revision ChangesPath 1.270 +1 -1 apache-1.3/src/include/httpd.h Index: httpd.h === RCS file: /home/cvs/apache-1.3/src/include/httpd.h,v retrieving revision 1.269 retrieving revision 1.270 diff -u -r1.269 -r1.270 --- httpd.h 1999/02/09 16:57:22 1.269 +++ httpd.h 1999/02/22 17:13:02 1.270 @@ -661,7 +661,7 @@ time_t request_time; /* When the request started */ -char *status_line; /* Status line, if set by script */ +const char *status_line; /* Status line, if set by script */ int status; /* In any case */ /* Request method, two ways; also, protocol, etc.. Outside of protocol.c, 1.259 +3 -3 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.258 retrieving revision 1.259 diff -u -r1.258 -r1.259 --- http_protocol.c 1999/02/16 14:29:51 1.258 +++ http_protocol.c 1999/02/22 17:13:03 1.259 @@ -1170,7 +1170,7 @@ * and must be listed in order. */ -static char *status_lines[RESPONSE_CODES] = { +static const char * const status_lines[RESPONSE_CODES] = { 100 Continue, 101 Switching Protocols, 102 Processing, @@ -2317,8 +2317,8 @@ r = r-prev; } { -char *title = status_lines[idx]; -char *h1; +const char *title = status_lines[idx]; +const char *h1; const char *error_notes; /* Accept a status_line set by a module, but only if it begins
cvs commit: apache-1.3/src/main http_protocol.c
fielding98/12/28 04:51:10 Modified:src/main http_protocol.c Log: Oops, stupid missing commas in auto static array. PR: 3541 Revision ChangesPath 1.250 +4 -4 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.249 retrieving revision 1.250 diff -u -r1.249 -r1.250 --- http_protocol.c 1998/11/10 07:30:08 1.249 +++ http_protocol.c 1998/12/28 12:51:09 1.250 @@ -1107,7 +1107,7 @@ * and must be listed in order. */ -static char *status_lines[] = { +static char *status_lines[RESPONSE_CODES] = { 100 Continue, 101 Switching Protocols, 102 Processing, @@ -1162,11 +1162,11 @@ 503 Service Temporarily Unavailable, 504 Gateway Time-out, 505 HTTP Version Not Supported, -506 Variant Also Negotiates -507 Insufficient Storage +506 Variant Also Negotiates, +507 Insufficient Storage, 508 unused, 509 unused, -510 Not Extended, +510 Not Extended }; /* The index is found by its offset from the x00 code of each level.
cvs commit: apache-1.3/src/main http_protocol.c
fielding98/11/09 23:30:09 Modified:.STATUS src CHANGES src/include httpd.h src/main http_protocol.c Log: Added the last two WebDAV status codes of 424 (Failed Dependency) and 507 (Insufficient Storage) for use by third-party modules. Revision ChangesPath 1.536 +0 -2 apache-1.3/STATUS Index: STATUS === RCS file: /home/cvs/apache-1.3/STATUS,v retrieving revision 1.535 retrieving revision 1.536 diff -u -r1.535 -r1.536 --- STATUS1998/11/10 06:10:24 1.535 +++ STATUS1998/11/10 07:30:05 1.536 @@ -125,8 +125,6 @@ Needs patch: -* Roy: Need to add updated WebDAV status codes from latest draft. - * Ralf: mod_so doesn't correctly initialise modules. For instance the handlers of mod_perl are not initialised. An ap_init_modules() could be done from mod_so but this is too much. 1.1144+4 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1143 retrieving revision 1.1144 diff -u -r1.1143 -r1.1144 --- CHANGES 1998/11/10 06:10:25 1.1143 +++ CHANGES 1998/11/10 07:30:06 1.1144 @@ -13,6 +13,10 @@ was changed to show more information about the suEXEC setup. [Lars Eilebrecht] PR#3316, 3357, 3361 + *) Added the last two WebDAV status codes of 424 (Failed Dependency) + and 507 (Insufficient Storage) for use by third-party modules. + [Roy Fielding] + *) Enabled all of the WebDAV method names for use by third-party modules, Limit, and Script directives. That includes PATCH, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, and UNLOCK. 1.252 +3 -1 apache-1.3/src/include/httpd.h Index: httpd.h === RCS file: /home/cvs/apache-1.3/src/include/httpd.h,v retrieving revision 1.251 retrieving revision 1.252 diff -u -r1.251 -r1.252 --- httpd.h 1998/11/08 09:51:09 1.251 +++ httpd.h 1998/11/10 07:30:07 1.252 @@ -447,7 +447,7 @@ * all of the potential response status-lines (a sparse table). * A future version should dynamically generate the table at startup. */ -#define RESPONSE_CODES 54 +#define RESPONSE_CODES 55 #define HTTP_CONTINUE 100 #define HTTP_SWITCHING_PROTOCOLS 101 @@ -487,6 +487,7 @@ #define HTTP_EXPECTATION_FAILED417 #define HTTP_UNPROCESSABLE_ENTITY 422 #define HTTP_LOCKED423 +#define HTTP_FAILED_DEPENDENCY 424 #define HTTP_INTERNAL_SERVER_ERROR 500 #define HTTP_NOT_IMPLEMENTED 501 #define HTTP_BAD_GATEWAY 502 @@ -494,6 +495,7 @@ #define HTTP_GATEWAY_TIME_OUT 504 #define HTTP_VERSION_NOT_SUPPORTED 505 #define HTTP_VARIANT_ALSO_VARIES 506 +#define HTTP_INSUFFICIENT_STORAGE 507 #define HTTP_NOT_EXTENDED 510 #define DOCUMENT_FOLLOWSHTTP_OK 1.249 +15 -2 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.248 retrieving revision 1.249 diff -u -r1.248 -r1.249 --- http_protocol.c 1998/11/08 09:51:11 1.248 +++ http_protocol.c 1998/11/10 07:30:08 1.249 @@ -1154,7 +1154,8 @@ 421 unused, 422 Unprocessable Entity, 423 Locked, -#define LEVEL_500 43 +424 Failed Dependency, +#define LEVEL_500 44 500 Internal Server Error, 501 Method Not Implemented, 502 Bad Gateway, @@ -1162,7 +1163,7 @@ 504 Gateway Time-out, 505 HTTP Version Not Supported, 506 Variant Also Negotiates -507 unused, +507 Insufficient Storage 508 unused, 509 unused, 510 Not Extended, @@ -2425,6 +2426,18 @@ ap_bputs(The requested resource is currently locked.\n The lock must be released or proper identification\n given before the method can be applied.\n, fd); + break; + case HTTP_FAILED_DEPENDENCY: + ap_bputs(The method could not be performed on the resource\n + because the requested action depended on another\n + action and that other action failed.\n, fd); + break; + case HTTP_INSUFFICIENT_STORAGE: + ap_bputs(The method could not be performed on the resource\n + because the server is unable to store the\n + representation needed to successfully complete
cvs commit: apache-1.3/src/main http_protocol.c
marc98/10/18 22:59:36 Modified:src/main http_protocol.c Log: After telling people to read the error log time after time, make it explicit in the 500 error message. Revision ChangesPath 1.246 +3 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.245 retrieving revision 1.246 diff -u -r1.245 -r1.246 --- http_protocol.c 1998/10/16 07:04:44 1.245 +++ http_protocol.c 1998/10/19 05:59:35 1.246 @@ -2384,7 +2384,9 @@ ap_escape_html(r-pool, r-server-server_admin), and inform them of the time the error occurred,\n and anything you might have done that may have\n - caused the error.P\n, NULL); + caused the error.P\n + More information about this error may be available\n + in the server error log.P\n, NULL); if ((error_notes = ap_table_get(r-notes, error-notes)) != NULL) { ap_bvputs(fd, error_notes, P\n, NULL); }
cvs commit: apache-1.3/src/main http_protocol.c http_request.c
fielding98/10/06 12:06:11 Modified:src CHANGES src/include httpd.h src/main http_protocol.c http_request.c Log: Added a complete implementation of the Expect header field as specified in rev-05 of HTTP/1.1. Used that implementation as a means of disabling the 100 Continue response when we already know the final status, which is mighty useful for PUT responses that result in 302 or 401. Moved two ugly protocol condition checks that were in http_request.c over to where they belong in http_protocol.c. They were put there originally because ap_read_request formerly could not return an error response, but I added that capability in 1.3.2. Added removal of extra trailing whitespace from the getline results as part of the protocol processing, which is extra nice because it works between continuation lines, is almost no cost in the normal case of no extra whitespace, and saves memory. Revision ChangesPath 1.1103+10 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1102 retrieving revision 1.1103 diff -u -r1.1102 -r1.1103 --- CHANGES 1998/10/05 22:11:14 1.1102 +++ CHANGES 1998/10/06 19:06:06 1.1103 @@ -1,5 +1,15 @@ Changes with Apache 1.3.3 + *) Added a complete implementation of the Expect header field as + specified in rev-05 of HTTP/1.1. Disabled the 100 Continue + response when we already know the final status, which is mighty + useful for PUT responses that result in 302 or 401. [Roy Fielding] + + *) Remove extra trailing whitespace from the getline results as part + of the protocol processing, which is extra nice because it works + between continuation lines, is almost no cost in the normal case + of no extra whitespace, and saves memory. [Roy Fielding] + *) Added new HTTP status codes and default response bodies from the revised HTTP/1.1 (307, 416, 417), WebDAV (102, 207, 422, 423), and HTTP Extension Framework (510) specifications. Did not add the 1.246 +7 -0 apache-1.3/src/include/httpd.h Index: httpd.h === RCS file: /home/cvs/apache-1.3/src/include/httpd.h,v retrieving revision 1.245 retrieving revision 1.246 diff -u -r1.245 -r1.246 --- httpd.h 1998/10/05 22:11:16 1.245 +++ httpd.h 1998/10/06 19:06:08 1.246 @@ -752,6 +752,13 @@ * that way, a sub request's list can (temporarily) point to a parent's list */ const struct htaccess_result *htaccess; + +/* Things placed at the end of the record to avoid breaking binary + * compatibility. It would be nice to remember to reorder the entire + * record to improve 64bit alignment the next time we need to break + * binary compatibility for some other reason. + */ +unsigned expecting_100; /* is client waiting for a 100 response? */ }; 1.243 +93 -13apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.242 retrieving revision 1.243 diff -u -r1.242 -r1.243 --- http_protocol.c 1998/10/05 22:11:16 1.242 +++ http_protocol.c 1998/10/06 19:06:09 1.243 @@ -551,6 +551,17 @@ total += retval;/* and how long s has become */ if (*pos == '\n') { /* Did we get a full line of input?*/ +/* + * Trim any extra trailing spaces or tabs except for the first + * space or tab at the beginning of a blank string. This makes + * it much easier to check field values for exact matches, and + * saves memory as well. Terminate string at end of line. + */ +while (pos (s + 1) (*(pos - 1) == ' ' || *(pos - 1) == '\t')) { +--pos; /* trim extra trailing spaces or tabs */ +--total;/* but not one at the beginning of line*/ +++n; +} *pos = '\0'; --total; ++n; @@ -767,8 +778,6 @@ while (*value == ' ' || *value == '\t') ++value;/* Skip to start of value */ -/* XXX: should strip trailing whitespace as well */ - ap_table_addn(tmp_headers, copy, value); } @@ -778,8 +787,9 @@ request_rec *ap_read_request(conn_rec *conn) { request_rec *r; -int access_status; pool *p; +const char *expect; +int access_status; p = ap_make_sub_pool(conn-pool); r = ap_pcalloc(p, sizeof(request_rec)); @@ -846,6
cvs commit: apache-1.3/src/main http_protocol.c
fielding98/10/05 15:11:17 Modified:src CHANGES src/include httpd.h src/main http_protocol.c Log: Added new HTTP status codes and default response bodies from the revised HTTP/1.1 (307, 416, 417), WebDAV (102, 207, 422, 423), and HTTP Extension Framework (510) specifications. Did not add the WebDAV 424 and 425 codes because they are bogus. We don't use any of these codes yet, but they are now available to 3rd-party modules. Revision ChangesPath 1.1102+7 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1101 retrieving revision 1.1102 diff -u -r1.1101 -r1.1102 --- CHANGES 1998/10/05 17:48:42 1.1101 +++ CHANGES 1998/10/05 22:11:14 1.1102 @@ -1,5 +1,12 @@ Changes with Apache 1.3.3 + *) Added new HTTP status codes and default response bodies from the + revised HTTP/1.1 (307, 416, 417), WebDAV (102, 207, 422, 423), and + HTTP Extension Framework (510) specifications. Did not add the + WebDAV 424 and 425 codes because they are bogus. We don't use any + of these codes yet, but they are now available to 3rd-party modules. + [Roy Fielding] + *) Fix a possible race condition between timed-out requests and the ap_bhalfduplex select that might result in an infinite loop on platforms that do not validate the descriptor. [Roy Fielding] 1.245 +13 -1 apache-1.3/src/include/httpd.h Index: httpd.h === RCS file: /home/cvs/apache-1.3/src/include/httpd.h,v retrieving revision 1.244 retrieving revision 1.245 diff -u -r1.244 -r1.245 --- httpd.h 1998/09/21 19:44:12 1.244 +++ httpd.h 1998/10/05 22:11:16 1.245 @@ -443,10 +443,15 @@ /* --- HTTP Status Codes - */ -#define RESPONSE_CODES 38 +/* The size of the static array in http_protocol.c for storing + * all of the potential response status-lines (a sparse table). + * A future version should dynamically generate the table at startup. + */ +#define RESPONSE_CODES 54 #define HTTP_CONTINUE 100 #define HTTP_SWITCHING_PROTOCOLS 101 +#define HTTP_PROCESSING102 #define HTTP_OK200 #define HTTP_CREATED 201 #define HTTP_ACCEPTED 202 @@ -454,12 +459,14 @@ #define HTTP_NO_CONTENT204 #define HTTP_RESET_CONTENT 205 #define HTTP_PARTIAL_CONTENT 206 +#define HTTP_MULTI_STATUS 207 #define HTTP_MULTIPLE_CHOICES 300 #define HTTP_MOVED_PERMANENTLY 301 #define HTTP_MOVED_TEMPORARILY 302 #define HTTP_SEE_OTHER 303 #define HTTP_NOT_MODIFIED 304 #define HTTP_USE_PROXY 305 +#define HTTP_TEMPORARY_REDIRECT307 #define HTTP_BAD_REQUEST 400 #define HTTP_UNAUTHORIZED 401 #define HTTP_PAYMENT_REQUIRED 402 @@ -476,6 +483,10 @@ #define HTTP_REQUEST_ENTITY_TOO_LARGE 413 #define HTTP_REQUEST_URI_TOO_LARGE 414 #define HTTP_UNSUPPORTED_MEDIA_TYPE415 +#define HTTP_RANGE_NOT_SATISFIABLE 416 +#define HTTP_EXPECTATION_FAILED417 +#define HTTP_UNPROCESSABLE_ENTITY 422 +#define HTTP_LOCKED423 #define HTTP_INTERNAL_SERVER_ERROR 500 #define HTTP_NOT_IMPLEMENTED 501 #define HTTP_BAD_GATEWAY 502 @@ -483,6 +494,7 @@ #define HTTP_GATEWAY_TIME_OUT 504 #define HTTP_VERSION_NOT_SUPPORTED 505 #define HTTP_VARIANT_ALSO_VARIES 506 +#define HTTP_NOT_EXTENDED 510 #define DOCUMENT_FOLLOWSHTTP_OK #define PARTIAL_CONTENT HTTP_PARTIAL_CONTENT 1.242 +65 -26apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.241 retrieving revision 1.242 diff -u -r1.241 -r1.242 --- http_protocol.c 1998/09/25 22:45:00 1.241 +++ http_protocol.c 1998/10/05 22:11:16 1.242 @@ -988,7 +988,8 @@ static char *status_lines[] = { 100 Continue, 101 Switching Protocols, -#define LEVEL_200 2 +102 Processing, +#define LEVEL_200 3 200 OK, 201 Created, 202 Accepted, @@ -996,14 +997,17 @@ 204 No Content, 205 Reset Content, 206 Partial Content, -#define LEVEL_300 9 +207 Multi-Status, +#define
cvs commit: apache-1.3/src/main http_protocol.c
dgaudet 98/08/09 09:57:29 Modified:src/include httpd.h src/main http_protocol.c Log: Include everything in the limits, rather than having to remember to add 2 to some of them... which leads to off-by-1 errors like one I just committed. (I don't understand what the + 2 was all about. It doesn't fit \r\n\0...) Revision ChangesPath 1.232 +2 -2 apache-1.3/src/include/httpd.h Index: httpd.h === RCS file: /export/home/cvs/apache-1.3/src/include/httpd.h,v retrieving revision 1.231 retrieving revision 1.232 diff -u -r1.231 -r1.232 --- httpd.h 1998/08/09 06:37:16 1.231 +++ httpd.h 1998/08/09 16:57:28 1.232 @@ -551,13 +551,13 @@ * LimitRequestFieldSize, and LimitRequestBody configuration directives. */ #ifndef DEFAULT_LIMIT_REQUEST_LINE -#define DEFAULT_LIMIT_REQUEST_LINE 8190 +#define DEFAULT_LIMIT_REQUEST_LINE 8192 #endif /* default limit on bytes in Request-Line (Method+URI+HTTP-version) */ #ifndef DEFAULT_LIMIT_REQUEST_FIELDS #define DEFAULT_LIMIT_REQUEST_FIELDS 100 #endif /* default limit on number of header fields */ #ifndef DEFAULT_LIMIT_REQUEST_FIELDSIZE -#define DEFAULT_LIMIT_REQUEST_FIELDSIZE 8190 +#define DEFAULT_LIMIT_REQUEST_FIELDSIZE 8192 #endif /* default limit on bytes in any one field */ #ifndef DEFAULT_LIMIT_REQUEST_BODY #define DEFAULT_LIMIT_REQUEST_BODY 33554432ul 1.234 +5 -5 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.233 retrieving revision 1.234 diff -u -r1.233 -r1.234 --- http_protocol.c 1998/08/09 16:52:31 1.233 +++ http_protocol.c 1998/08/09 16:57:29 1.234 @@ -635,7 +635,7 @@ pool *tmp; tmp = ap_make_sub_pool(r-pool); -l = ap_palloc(tmp, r-server-limit_req_line + 2); +l = ap_palloc(tmp, r-server-limit_req_line); ll = l; /* Read past empty lines until we get a real request line, @@ -653,7 +653,7 @@ * have to block during a read. */ ap_bsetflag(conn-client, B_SAFEREAD, 1); -while ((len = getline(l, r-server-limit_req_line + 2, conn-client, 0)) = 0) { +while ((len = getline(l, r-server-limit_req_line, conn-client, 0)) = 0) { if ((len 0) || ap_bgetflag(conn-client, B_EOF)) { ap_bsetflag(conn-client, B_SAFEREAD, 0); ap_destroy_pool(tmp); @@ -764,7 +764,7 @@ arr = ap_make_array(tmp, 50, sizeof(mime_key)); order = 0; -field = ap_palloc(tmp, r-server-limit_req_fieldsize + 2); +field = ap_palloc(tmp, r-server-limit_req_fieldsize); /* If headers_in is non-empty (i.e. we're parsing a trailer) then * we have to merge. Have I mentioned that I think this is a lame part @@ -794,7 +794,7 @@ * Read header lines until we get the empty separator line, a read error, * the connection closes (EOF), reach the server limit, or we timeout. */ -while ((len = getline(field, r-server-limit_req_fieldsize + 2, +while ((len = getline(field, r-server-limit_req_fieldsize, c-client, 1)) 0) { if (++fields_read r-server-limit_req_fields) { @@ -804,7 +804,7 @@ ap_destroy_pool(tmp); return; } -if (len = r-server-limit_req_fieldsize + 1) { +if (len = r-server-limit_req_fieldsize) { r-status = HTTP_BAD_REQUEST; ap_table_setn(r-notes, error-notes, ap_pstrcat(r-pool, Size of a request header field exceeds server limit.P\n
cvs commit: apache-1.3/src/main http_protocol.c
fielding98/07/21 22:48:21 Modified:src CHANGES src/main http_protocol.c Log: Fixed problem with buffered response message not being sent for the read_request error conditions of URI-too-long (414) and malformed header fields (400). We now create enough of the request record so that it is adequately logged as well. PR: 2646 from Jim Gettys Revision ChangesPath 1.976 +4 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.975 retrieving revision 1.976 diff -u -r1.975 -r1.976 --- CHANGES 1998/07/21 15:39:40 1.975 +++ CHANGES 1998/07/22 05:48:19 1.976 @@ -1,5 +1,9 @@ Changes with Apache 1.3.2 + *) Fixed problem with buffered response message not being sent for + the read_request error conditions of URI-too-long (414) and + malformed header fields (400). [Roy Fielding] PR#2646 + *) Add support for the Max-Forwards: header line required by RFC2068 for the TRACE method. This allows apache to TRACE along a chain of proxies up to a predetermined depth. [Martin Kraemer] 1.226 +48 -46apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.225 retrieving revision 1.226 diff -u -r1.225 -r1.226 --- http_protocol.c 1998/07/19 05:55:16 1.225 +++ http_protocol.c 1998/07/22 05:48:21 1.226 @@ -656,20 +656,9 @@ /* we've probably got something to do, ignore graceful restart requests */ #ifdef SIGUSR1 signal(SIGUSR1, SIG_IGN); -#endif /* SIGUSR1 */ +#endif + ap_bsetflag(conn-client, B_SAFEREAD, 0); -if (len == (HUGE_STRING_LEN - 1)) { -ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r-server, -request failed for %s, reason: URI too long, -ap_get_remote_host(r-connection, r-per_dir_config, REMOTE_NAME)); - /* hack to deal with the HTTP_REQUEST_TIME_OUT setting up above: */ - if (r-status == HTTP_REQUEST_TIME_OUT) { - r-status = HTTP_OK; - } - r-request_time = time(NULL); - ap_die (HTTP_REQUEST_URI_TOO_LARGE, r); -return 0; -} r-request_time = time(NULL); r-the_request = ap_pstrdup(r-pool, l); @@ -700,8 +689,16 @@ ap_parse_uri(r, uri); +if (len == (HUGE_STRING_LEN - 1)) { +r-status= HTTP_REQUEST_URI_TOO_LARGE; +r-proto_num = HTTP_VERSION(1,0); +r-protocol = ap_pstrdup(r-pool, HTTP/1.0); +return 0; +} + r-assbackwards = (ll[0] == '\0'); r-protocol = ap_pstrdup(r-pool, ll[0] ? ll : HTTP/0.9); + if (2 == sscanf(r-protocol, HTTP/%u.%u, major, minor) minor HTTP_VERSION(1,0)) /* don't allow HTTP/0.1000 */ r-proto_num = HTTP_VERSION(major, minor); @@ -725,23 +722,15 @@ while ((len = getline(field, MAX_STRING_LEN, c-client, 1)) 0) { char *copy = ap_palloc(r-pool, len + 1); memcpy(copy, field, len + 1); - - if (!(value = strchr(copy, ':'))) { /* Find the colon separator */ - /* if there's none, this request is screwed up. - * a hack to deal with how we set HTTP_REQUEST_TIME_OUT earlier.*/ - if (r-status == HTTP_REQUEST_TIME_OUT) - r-status = HTTP_OK; - - ap_die (HTTP_BAD_REQUEST, r); - return; - } + +if (!(value = strchr(copy, ':'))) { /* Find the colon separator */ +r-status = HTTP_BAD_REQUEST; /* or abort the bad request */ +return; +} *value = '\0'; ++value; - /* XXX: RFC2068 defines only SP and HT as whitespace, this test is - * wrong... and so are many others probably. - */ -while (ap_isspace(*value)) +while (*value == ' ' || *value == '\t') ++value;/* Skip to start of value */ /* XXX: should strip trailing whitespace as well */ @@ -754,7 +743,7 @@ = MAX_STRING_LEN - 1) { /* soak up the extra data */ } - if (len == 0) /* time to exit the larger loop as well */ + if (len = 0) /* time to exit the larger loop as well */ break; } } @@ -796,34 +785,47 @@ r-status = HTTP_REQUEST_TIME_OUT; /* Until we get a request */ r-the_request = NULL; -/* Get the request... */ - #ifdef CHARSET_EBCDIC ap_bsetflag(r-connection-client, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 1); -#endif /* CHARSET_EBCDIC */ +#endif + +/* Get the request... */
cvs commit: apache-1.3/src/main http_protocol.c
akosut 98/07/18 22:55:17 Modified:src/main http_protocol.c Log: Make it stop! We've had *nine* PRs on this. Obviously it's causing certain people distress. PR: 267, 517, 1332, 1537, 1819, 2050, 2347, 2528, 2642 Revision ChangesPath 1.225 +2 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.224 retrieving revision 1.225 diff -u -u -r1.224 -r1.225 --- http_protocol.c 1998/07/08 17:47:05 1.224 +++ http_protocol.c 1998/07/19 05:55:16 1.225 @@ -299,7 +299,8 @@ ap_find_last_token(r-pool, ap_table_get(r-headers_out, Transfer-Encoding), chunked) || - ((r-proto_num = HTTP_VERSION(1,1)) (r-chunked = 1))) + ((r-proto_num = HTTP_VERSION(1,1)) + (r-chunked = 1))) /* THIS CODE IS CORRECT, see comment above. */ r-server-keep_alive (r-server-keep_alive_timeout 0) ((r-server-keep_alive_max == 0) ||
cvs commit: apache-1.3/src/main http_protocol.c
dgaudet 98/05/25 15:55:40 Modified:src/main http_protocol.c Log: - style correction - eliminate an unneeded extra MAX_STRING_LEN buffer - add some XXX comments Revision ChangesPath 1.215 +25 -19apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.214 retrieving revision 1.215 diff -u -r1.214 -r1.215 --- http_protocol.c 1998/05/21 04:11:27 1.214 +++ http_protocol.c 1998/05/25 22:55:39 1.215 @@ -662,8 +662,9 @@ request failed for %s, reason: URI too long, ap_get_remote_host(r-connection, r-per_dir_config, REMOTE_NAME)); /* hack to deal with the HTTP_REQUEST_TIME_OUT setting up above: */ - if (r-status == HTTP_REQUEST_TIME_OUT) - r-status = HTTP_OK; + if (r-status == HTTP_REQUEST_TIME_OUT) { + r-status = HTTP_OK; + } r-request_time = time(NULL); ap_die (HTTP_REQUEST_URI_TOO_LARGE, r); return 0; @@ -718,38 +719,42 @@ /* * Read header lines until we get the empty separator line, a read error, - * the connection closes (EOF), or we timeout. Should we also check for - * overflow (len == MAX_STRING_LEN-1)? + * the connection closes (EOF), or we timeout. */ while ((len = getline(field, MAX_STRING_LEN, c-client, 1)) 0) { char *copy = ap_palloc(r-pool, len + 1); memcpy(copy, field, len + 1); if (!(value = strchr(copy, ':'))) { /* Find the colon separator */ - /* if there's none, this request is screwed up. -* a hack to deal with how we set HTTP_REQUEST_TIME_OUT earlier.*/ - if (r-status == HTTP_REQUEST_TIME_OUT) - r-status = HTTP_OK; - - ap_die (HTTP_BAD_REQUEST, r); - return; + /* if there's none, this request is screwed up. + * a hack to deal with how we set HTTP_REQUEST_TIME_OUT earlier.*/ + if (r-status == HTTP_REQUEST_TIME_OUT) + r-status = HTTP_OK; + + ap_die (HTTP_BAD_REQUEST, r); + return; } *value = '\0'; ++value; + /* XXX: RFC2068 defines only SP and HT as whitespace, this test is + * wrong... and so are many others probably. + */ while (isspace(*value)) ++value;/* Skip to start of value */ + /* XXX: should strip trailing whitespace as well */ + ap_table_mergen(r-headers_in, copy, value); /* the header was too long; at the least we should skip extra data */ if (len = MAX_STRING_LEN - 1) { - char junk[MAX_STRING_LEN]; - while ((len = getline(junk, MAX_STRING_LEN, c-client, 1)) - = MAX_STRING_LEN - 1) /* soak up the extra data */ - ; - if (len == 0) /* time to exit the larger loop as well */ - break; + while ((len = getline(field, MAX_STRING_LEN, c-client, 1)) + = MAX_STRING_LEN - 1) { + /* soak up the extra data */ + } + if (len == 0) /* time to exit the larger loop as well */ + break; } } } @@ -798,8 +803,10 @@ ap_keepalive_timeout(read request line, r); if (!read_request_line(r)) { ap_kill_timeout(r); - if (r-status != HTTP_REQUEST_TIME_OUT) /* we must have had an error.*/ + if (r-status != HTTP_REQUEST_TIME_OUT) { + /* we must have had an error.*/ ap_log_transaction(r); + } return NULL; } if (!r-assbackwards) { @@ -832,7 +839,6 @@ if ((access_status = ap_run_post_read_request(r))) { ap_die(access_status, r); ap_log_transaction(r); - return NULL; }
cvs commit: apache-1.3/src/main http_protocol.c
brian 98/05/20 21:11:28 Modified:.STATUS src CHANGES src/main http_protocol.c Log: Ed Korthof's fixes for 408 and 414 protocol issues. [EMAIL PROTECTED] Revision ChangesPath 1.404 +17 -4 apache-1.3/STATUS Index: STATUS === RCS file: /export/home/cvs/apache-1.3/STATUS,v retrieving revision 1.403 retrieving revision 1.404 diff -u -r1.403 -r1.404 --- STATUS1998/05/20 01:58:25 1.403 +++ STATUS1998/05/21 04:11:18 1.404 @@ -37,10 +37,6 @@ Available Patches: -* Ed Korthof's patch to fix protocol issues surrounding 400, 408, and - 414 responses. - [EMAIL PROTECTED] - * Wilfredo Sanchez's port to Rhapsody 5.1 for 1.2.6 - forward port to 1.3? [EMAIL PROTECTED] @@ -316,6 +312,9 @@ execuables, usually after a very long pause. Ought to stuff .conf in the registry mapping it to text. +* apparently either BrowserMatch or the nokeepalive variable + cause instability - see PR#1729. + Delayed until after 1.3.0, unless someone happens to get to it: * Arnt Gulbrandsen [EMAIL PROTECTED] 03 Apr 1998 21:28:17 +0200 @@ -371,4 +370,18 @@ use the new child_info structure, is this still safe? Needs to be looked at. +* suexec doesn't understand argv parameters; e.g. + +!--#exec cmd=./ls -l -- + + fails even when ls is in the same directory because suexec is trying + to stat a file called ls -l. A patch for this is available at + +http://www.xnet.com/~emarshal/suexec.diff + and it's not bad except that it doesn't handle programs with spaces in + the filename (think win32, or samba-mounted filesystems). There are + several PR's to this and I don't see for security reasons why we can't + accomodate it, though it does add complexity to suexec.c. + PR #1120 + Brian: +1 1.858 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.857 retrieving revision 1.858 diff -u -r1.857 -r1.858 --- CHANGES 1998/05/21 04:07:11 1.857 +++ CHANGES 1998/05/21 04:11:23 1.858 @@ -1,5 +1,8 @@ Changes with Apache 1.3b7 + *) A fix for protocol issues surrounding 400, 408, and + 414 responses. [Ed Korthof] + *) Ignore MaxRequestsPerChild on WIN32. [Brian Behlendorf] *) Fix discrepancy in proxy_ftp.c which was causing failures when 1.214 +40 -5 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.213 retrieving revision 1.214 diff -u -r1.213 -r1.214 --- http_protocol.c 1998/05/07 01:21:22 1.213 +++ http_protocol.c 1998/05/21 04:11:27 1.214 @@ -661,7 +661,11 @@ ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r-server, request failed for %s, reason: URI too long, ap_get_remote_host(r-connection, r-per_dir_config, REMOTE_NAME)); -r-status = HTTP_REQUEST_URI_TOO_LARGE; + /* hack to deal with the HTTP_REQUEST_TIME_OUT setting up above: */ + if (r-status == HTTP_REQUEST_TIME_OUT) + r-status = HTTP_OK; + r-request_time = time(NULL); + ap_die (HTTP_REQUEST_URI_TOO_LARGE, r); return 0; } @@ -720,16 +724,33 @@ while ((len = getline(field, MAX_STRING_LEN, c-client, 1)) 0) { char *copy = ap_palloc(r-pool, len + 1); memcpy(copy, field, len + 1); + + if (!(value = strchr(copy, ':'))) { /* Find the colon separator */ + /* if there's none, this request is screwed up. +* a hack to deal with how we set HTTP_REQUEST_TIME_OUT earlier.*/ + if (r-status == HTTP_REQUEST_TIME_OUT) + r-status = HTTP_OK; + + ap_die (HTTP_BAD_REQUEST, r); + return; + } -if (!(value = strchr(copy, ':'))) /* Find the colon separator */ -continue; /* or should puke 400 here */ - *value = '\0'; ++value; while (isspace(*value)) ++value;/* Skip to start of value */ ap_table_mergen(r-headers_in, copy, value); + + /* the header was too long; at the least we should skip extra data */ + if (len = MAX_STRING_LEN - 1) { + char junk[MAX_STRING_LEN]; + while ((len = getline(junk, MAX_STRING_LEN, c-client, 1)) + = MAX_STRING_LEN - 1) /* soak up the extra data */ + ; + if
cvs commit: apache-1.3/src/main http_protocol.c http_core.c
brian 98/05/06 18:21:23 Modified:src CHANGES src/main http_protocol.c http_core.c Log: PR: 1464 Emit the Accept-Ranges header for every response from the default handler, instead of just for those that don't emit a Range request. Revision ChangesPath 1.829 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.828 retrieving revision 1.829 diff -u -r1.828 -r1.829 --- CHANGES 1998/05/06 21:16:03 1.828 +++ CHANGES 1998/05/07 01:21:15 1.829 @@ -1,5 +1,8 @@ Changes with Apache 1.3b7 + *) Emit the Accept-Range header for the default handler. + [Brian Behlendorf] PR#1464 + *) Add a note to httpd.conf-dist that apache will on some systems fail to start when the Group # is set to a negative or large positive value. [Martin Kraemer] 1.213 +0 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.212 retrieving revision 1.213 diff -u -r1.212 -r1.213 --- http_protocol.c 1998/04/27 06:59:35 1.212 +++ http_protocol.c 1998/05/07 01:21:22 1.213 @@ -141,7 +141,6 @@ range = ap_table_get(r-headers_in, Request-Range); if (!range || strncasecmp(range, bytes=, 6)) { -ap_table_setn(r-headers_out, Accept-Ranges, bytes); return 0; } 1.193 +1 -0 apache-1.3/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_core.c,v retrieving revision 1.192 retrieving revision 1.193 diff -u -r1.192 -r1.193 --- http_core.c 1998/05/05 04:48:05 1.192 +++ http_core.c 1998/05/07 01:21:22 1.193 @@ -2120,6 +2120,7 @@ ap_update_mtime (r, r-finfo.st_mtime); ap_set_last_modified(r); ap_set_etag(r); +ap_table_setn(r-headers_out, Accept-Ranges, bytes); if (((errstatus = ap_meets_conditions(r)) != OK) || (errstatus = ap_set_content_length (r, r-finfo.st_size))) { return errstatus;
cvs commit: apache-1.3/src/main http_protocol.c
rse 98/04/07 23:30:48 Modified:src/include http_protocol.h src/main http_protocol.c Log: Change parse_uri back to a core function on Dean and Martins request. Revision ChangesPath 1.40 +1 -1 apache-1.3/src/include/http_protocol.h Index: http_protocol.h === RCS file: /export/home/cvs/apache-1.3/src/include/http_protocol.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- http_protocol.h 1998/04/06 07:26:24 1.39 +++ http_protocol.h 1998/04/08 06:30:46 1.40 @@ -203,6 +203,6 @@ /* This is also useful for putting sub_reqs and internal_redirects together */ -API_EXPORT(void) parse_uri(request_rec *r, const char *uri); +CORE_EXPORT(void) parse_uri(request_rec *r, const char *uri); #endif /* !APACHE_HTTP_PROTOCOL_H */ 1.210 +1 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.209 retrieving revision 1.210 diff -u -r1.209 -r1.210 --- http_protocol.c 1998/04/06 07:26:28 1.209 +++ http_protocol.c 1998/04/08 06:30:47 1.210 @@ -575,7 +575,7 @@ * - sets r-uri to request uri (without r-args part) * - sets r-hostname (if not set already) from request (scheme://host:port) */ -API_EXPORT(void) parse_uri(request_rec *r, const char *uri) +CORE_EXPORT(void) parse_uri(request_rec *r, const char *uri) { int status = HTTP_OK;
cvs commit: apache-1.3/src/main http_protocol.c
dgaudet 98/04/01 12:53:17 Modified:src/main http_protocol.c Log: Yup it's safe to remove the extra method_number stuff Martin. It's not used for subrequests. Revision ChangesPath 1.207 +0 -21 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.206 retrieving revision 1.207 diff -u -r1.206 -r1.207 --- http_protocol.c 1998/04/01 14:41:34 1.206 +++ http_protocol.c 1998/04/01 20:53:16 1.207 @@ -797,27 +797,6 @@ conn-keptalive = 0;/* We now have a request to play with */ -if (!strcmp(r-method, HEAD)) { -r-header_only = 1; -r-method_number = M_GET; -} -else if (!strcmp(r-method, GET)) -r-method_number = M_GET; -else if (!strcmp(r-method, POST)) -r-method_number = M_POST; -else if (!strcmp(r-method, PUT)) -r-method_number = M_PUT; -else if (!strcmp(r-method, DELETE)) -r-method_number = M_DELETE; -else if (!strcmp(r-method, CONNECT)) -r-method_number = M_CONNECT; -else if (!strcmp(r-method, OPTIONS)) -r-method_number = M_OPTIONS; -else if (!strcmp(r-method, TRACE)) -r-method_number = M_TRACE; -else -r-method_number = M_INVALID; /* Will eventually croak. */ - if ((access_status = run_post_read_request(r))) { die(access_status, r); return NULL;
cvs commit: apache-1.3/src/main http_protocol.c
dougm 98/03/24 15:20:28 Modified:src/main http_protocol.c Log: oops, this didn't commited yesterday for the API_EXPORT of index_of_response Submitted by: Doug MacEachern Revision ChangesPath 1.201 +1 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.200 retrieving revision 1.201 diff -u -r1.200 -r1.201 --- http_protocol.c 1998/03/17 08:21:01 1.200 +++ http_protocol.c 1998/03/24 23:20:26 1.201 @@ -968,7 +968,7 @@ * If that sad event occurs, replace the code below with a linear search * from status_lines[shortcut[i]] to status_lines[shortcut[i+1]-1]; */ -int index_of_response(int status) +API_EXPORT(int) index_of_response(int status) { static int shortcut[6] = {0, LEVEL_200, LEVEL_300, LEVEL_400, LEVEL_500, RESPONSE_CODES};
cvs commit: apache-1.3/src/main http_protocol.c
dgaudet 98/03/12 23:12:56 Modified:src/main http_protocol.c Log: Move this ugly platform specific code from parse_uri_components() into parse_uri(). Guys this is probably something that should be done elsewhere. Like maybe in directory_walk(). Revision ChangesPath 1.196 +16 -0 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.195 retrieving revision 1.196 diff -u -r1.195 -r1.196 --- http_protocol.c 1998/03/10 06:13:50 1.195 +++ http_protocol.c 1998/03/13 07:12:54 1.196 @@ -594,6 +594,22 @@ r-args = r-parsed_uri.query; r-uri = r-parsed_uri.path ? r-parsed_uri.path : pstrdup(r-pool, /); +#if defined(__EMX__) || defined(WIN32) + /* Handle path translations for OS/2 and plug security hole. + * This will prevent http://www.wherever.com/..\..\/; from + * returning a directory for the root drive. + */ + { + char *x; + + for (x = r-uri; (x = strchr(x, '\\')) != NULL; ) + *x = '/'; +#ifndef WIN32 /* for OS/2 only: */ + /* Fix OS/2 HPFS filename case problem. */ + str_tolower(r-uri); +#endif + } +#endif /* __EMX__ || WIN32 */ } else { r-args = NULL;
cvs commit: apache-1.3/src/main http_protocol.c
dgaudet 98/03/09 22:13:52 Modified:src CHANGES src/main http_protocol.c Log: rputs() did not calculate r-sent_bodyct properly. PR: 1900 Submitted by: Siegmund Stirnweiss [EMAIL PROTECTED] Revision ChangesPath 1.696 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.695 retrieving revision 1.696 diff -u -r1.695 -r1.696 --- CHANGES 1998/03/10 05:14:16 1.695 +++ CHANGES 1998/03/10 06:13:47 1.696 @@ -1,5 +1,8 @@ Changes with Apache 1.3b6 + *) rputs() did not calculate r-sent_bodyct properly. + [Siegmund Stirnweiss [EMAIL PROTECTED]] PR#1900 + *) The CGI spec says that REMOTE_HOST should be set to the remote hosts's name, or left unset if this value is unavailable. Apache was setting it to the IP address when unavailable. 1.195 +4 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.194 retrieving revision 1.195 diff -u -r1.194 -r1.195 --- http_protocol.c 1998/03/04 02:28:16 1.194 +++ http_protocol.c 1998/03/10 06:13:50 1.195 @@ -1793,10 +1793,13 @@ API_EXPORT(int) rputs(const char *str, request_rec *r) { +int rcode; + if (r-connection-aborted) return EOF; +rcode = bputs(str, r-connection-client); SET_BYTES_SENT(r); -return bputs(str, r-connection-client); +return rcode; } API_EXPORT(int) rwrite(const void *buf, int nbyte, request_rec *r)
cvs commit: apache-1.3/src/main http_protocol.c
martin 98/02/22 13:37:48 Modified:src/main http_protocol.c Log: Typo Revision ChangesPath 1.191 +1 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.190 retrieving revision 1.191 diff -u -u -r1.190 -r1.191 --- http_protocol.c 1998/02/21 01:18:28 1.190 +++ http_protocol.c 1998/02/22 21:37:47 1.191 @@ -660,7 +660,7 @@ port = default_port(r); } -/* Make sure ports patch */ +/* Make sure ports match */ if (port != r-server-port) return uri;
cvs commit: apache-1.3/src/main http_protocol.c
dgaudet 98/02/20 17:18:29 Modified:src CHANGES src/main http_protocol.c Log: Fix http://host1; without trailing /. Revision ChangesPath 1.645 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.644 retrieving revision 1.645 diff -u -r1.644 -r1.645 --- CHANGES 1998/02/21 00:50:39 1.644 +++ CHANGES 1998/02/21 01:18:25 1.645 @@ -1,5 +1,8 @@ Changes with Apache 1.3b6 + *) Fix problems with absoluteURIs. [Dean Gaudet, + Alvaro Martinez Echevarria [EMAIL PROTECTED]] + *) Fix multiple UserDir problem introduced during 1.3b4-dev. [Dean Gaudet] *) ap_cpystrn() had an off-by-1 error. 1.190 +10 -4 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.189 retrieving revision 1.190 diff -u -r1.189 -r1.190 --- http_protocol.c 1998/02/18 11:59:20 1.189 +++ http_protocol.c 1998/02/21 01:18:28 1.190 @@ -628,6 +628,7 @@ char *host, *proto, *slash, *colon; int plen; unsigned port; +const char *res_uri; /* This routine parses full URLs, if they match the server */ proto = http_method(r); @@ -664,15 +665,20 @@ return uri; /* Save it for later use */ -r-hostname = pstrdup(r-pool, host); +r-hostname = host; r-hostlen = plen + 3 + slash - host; +res_uri = uri + r-hostlen; +/* deal with http://host; */ +if (*res_uri == '\0') { + res_uri = /; +} /* The easy cases first */ if (!strcasecmp(host, r-server-server_hostname)) { -return (uri + r-hostlen); +return res_uri; } else if (!strcmp(host, inet_ntoa(r-connection-local_addr.sin_addr))) { -return (uri + r-hostlen); +return res_uri; } else { /* Now things get a bit trickier - check the IP address(es) of @@ -685,7 +691,7 @@ for (n = 0; hp-h_addr_list[n] != NULL; n++) { if (r-connection-local_addr.sin_addr.s_addr == (((struct in_addr *) (hp-h_addr_list[n]))-s_addr)) { -return (uri + r-hostlen); +return res_uri; } } }
cvs commit: apache-1.3/src/main http_protocol.c
dgaudet 98/02/18 03:59:21 Modified:src/main http_protocol.c Log: Fix absoluteURI problem introduced by the http_method() stuff... do a little cleanup. This isn't everything needed to get absoluteURIs working properly, they're still at least as broken as they were a week or two ago. I'm hoping Martin can get his uri parsing patch into the server, and when he does that I can finish the fixes for absoluteURIs. Revision ChangesPath 1.189 +21 -10apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.188 retrieving revision 1.189 diff -u -r1.188 -r1.189 --- http_protocol.c 1998/02/09 01:09:40 1.188 +++ http_protocol.c 1998/02/18 11:59:20 1.189 @@ -625,8 +625,8 @@ const char *check_fulluri(request_rec *r, const char *uri) { -char *name, *host, *proto; -int i, plen; +char *host, *proto, *slash, *colon; +int plen; unsigned port; /* This routine parses full URLs, if they match the server */ @@ -635,18 +635,29 @@ if (strncasecmp(uri, proto, plen) || strncasecmp(uri + plen, ://, 3)) return uri; -name = pstrdup(r-pool, uri + plen); +host = pstrdup(r-pool, uri + plen + 3); /* Find the hostname, assuming a valid request */ -i = ind(name, '/'); -name[i] = '\0'; +slash = strchr(host, '/'); +if (slash) { +*slash = 0; +} +else { +slash = host + strlen(host); +} /* Find the port */ -host = getword_nc(r-pool, name, ':'); -if (*name) -port = atoi(name); -else +colon = strchr(host, ':'); +if (colon) { +*colon = '\0'; +port = atoi(colon+1); +if (port == 0) { +return uri; +} +} +else { port = default_port(r); +} /* Make sure ports patch */ if (port != r-server-port) @@ -654,7 +665,7 @@ /* Save it for later use */ r-hostname = pstrdup(r-pool, host); -r-hostlen = plen + 3 + i; +r-hostlen = plen + 3 + slash - host; /* The easy cases first */ if (!strcasecmp(host, r-server-server_hostname)) {
cvs commit: apache-1.3/src/main http_protocol.c
dgaudet 98/02/04 13:23:34 Modified:src CHANGES src/main http_protocol.c Log: Igor found a memory leak -- we're allocating the initial request_rec in the connection pool rather than creating a new pool first. So each request on a keepalive connection would waste sizeof(request_rec). Revision ChangesPath 1.616 +2 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.615 retrieving revision 1.616 diff -u -r1.615 -r1.616 --- CHANGES 1998/02/03 11:19:26 1.615 +++ CHANGES 1998/02/04 21:23:30 1.616 @@ -1,4 +1,6 @@ Changes with Apache 1.3b4 + + *) Fix a memory leak on keep-alive connections. [Igor Tatarinov] *) Added mod_so module to support dynamic loading of modules on Unix (like mod_dld for Win32). This replaces mod_dld.c. Use SharedModule 1.185 +5 -2 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.184 retrieving revision 1.185 diff -u -r1.184 -r1.185 --- http_protocol.c 1998/02/02 22:33:33 1.184 +++ http_protocol.c 1998/02/04 21:23:33 1.185 @@ -773,13 +773,16 @@ request_rec *read_request(conn_rec *conn) { -request_rec *r = (request_rec *) pcalloc(conn-pool, sizeof(request_rec)); +request_rec *r; int access_status; +pool *p; +p = make_sub_pool(conn-pool); +r = pcalloc(p, sizeof(request_rec)); +r-pool= p; r-connection = conn; conn-server = conn-base_server; r-server = conn-server; -r-pool= make_sub_pool(conn-pool); conn-keptalive= conn-keepalive == 1; conn-keepalive= 0;
cvs commit: apache-1.3/src/main http_protocol.c http_request.c
dgaudet 98/01/30 16:15:45 Modified:src/main http_protocol.c http_request.c Log: (Recall: whenever a table's nelts == nalloc and a push is attempted the table size will be doubled, and the old table copied to the new table. It's nice to avoid this if it's easy.) Our default server outputs 8 headers, with the expires module it will do 10 headers. Increase the default r-headers_out table to size 12 to accomodate that (plus a cookie and one other thing). rename_original_environment should use nalloc instead of nelts when selecting a table size. Revision ChangesPath 1.183 +1 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.182 retrieving revision 1.183 diff -u -r1.182 -r1.183 --- http_protocol.c 1998/01/28 11:33:21 1.182 +++ http_protocol.c 1998/01/31 00:15:43 1.183 @@ -786,7 +786,7 @@ r-headers_in = make_table(r-pool, 50); r-subprocess_env = make_table(r-pool, 50); -r-headers_out = make_table(r-pool, 5); +r-headers_out = make_table(r-pool, 12); r-err_headers_out = make_table(r-pool, 5); r-notes = make_table(r-pool, 5); 1.104 +2 -2 apache-1.3/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_request.c,v retrieving revision 1.103 retrieving revision 1.104 diff -u -r1.103 -r1.104 --- http_request.c1998/01/27 02:41:11 1.103 +++ http_request.c1998/01/31 00:15:44 1.104 @@ -1162,7 +1162,7 @@ { array_header *env_arr = table_elts(t); table_entry *elts = (table_entry *) env_arr-elts; -table *new = make_table(p, env_arr-nelts); +table *new = make_table(p, env_arr-nalloc); int i; for (i = 0; i env_arr-nelts; ++i) { @@ -1217,7 +1217,7 @@ new-main= r-main; new-headers_in = r-headers_in; -new-headers_out = make_table(r-pool, 5); +new-headers_out = make_table(r-pool, 12); new-err_headers_out = r-err_headers_out; new-subprocess_env = rename_original_env(r-pool, r-subprocess_env); new-notes = make_table(r-pool, 5);