cvs commit: apachen/src/main http_request.c
ben 97/08/31 09:28:52 Modified:src/main http_request.c Log: Temporary(?) fix for Win32 Auth not working. Revision ChangesPath 1.80 +3 -0 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -r1.79 -r1.80 --- http_request.c1997/08/25 16:02:27 1.79 +++ http_request.c1997/08/31 16:28:51 1.80 @@ -382,7 +382,10 @@ entry_dir = entry_core->d; if (entry_core->r +/* FIXME: Temporarily removed, pending an explanation of function, in order to + fix Win32 [Ben] || entry_dir[0] != '/' +*/ || entry_core->d_components > i) break; this_conf = NULL;
cvs commit: apachen/src/main http_request.c
akosut 97/09/11 12:07:53 Modified:src/main http_request.c Log: entry_dir is the string, not entry_core... Make Windows compile. Revision ChangesPath 1.83 +1 -1 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- http_request.c1997/09/11 18:46:45 1.82 +++ http_request.c1997/09/11 19:07:51 1.83 @@ -384,7 +384,7 @@ if (entry_core->r #if defined(__EMX__) || defined(WIN32) - || (entry_core[0] != '/' && entry_core[1] != ':') + || (entry_dir[0] != '/' && entry_dir[1] != ':') #else || entry_dir[0] != '/' #endif
cvs commit: apachen/src/main http_request.c
fielding97/09/14 03:53:25 Modified:src/main http_request.c Log: Cleanup an ifdef section so that it is readable by mere mortals (and indent, which puked rather badly on the interleaved elses). Revision ChangesPath 1.84 +21 -14apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- http_request.c1997/09/11 19:07:51 1.83 +++ http_request.c1997/09/14 10:53:24 1.84 @@ -199,8 +199,27 @@ } #if defined(ENOENT) && defined(ENOTDIR) else if (errno == ENOENT || errno == ENOTDIR) { + last_cp = cp; + + while (--cp > path && *cp != '/') + continue; + + while (cp > path && cp[-1] == '/') + --cp; + } + else { +#if defined(EACCES) + if (errno != EACCES) +#endif + aplog_error(APLOG_MARK, APLOG_ERR, r->server, + "access to %s failed for %s", r->uri, + get_remote_host(r->connection, r->per_dir_config, + REMOTE_NAME)); + return HTTP_FORBIDDEN; + } #else -#error ENOENT || ENOTDIR not defined -- check the comment below this line in the source for details +#error ENOENT || ENOTDIR not defined; please see the +#error comments at this line in the source for a workaround. /* * If ENOENT || ENOTDIR is not defined in one of the your OS's * include files, Apache does not know how to check to see why @@ -209,7 +228,7 @@ * that it is possible for someone to get a directory * listing of a directory even though there is an index * (eg. index.html) file in it. If you do not have a - * problem with this, delete the above #error line and + * problem with this, delete the above #error lines and * start the compile again. If you need to do this, please * submit a bug report from http://www.apache.org/bug_report.html * letting us know that you needed to do this. Please be @@ -217,7 +236,6 @@ */ else { -#endif last_cp = cp; while (--cp > path && *cp != '/') @@ -226,17 +244,6 @@ while (cp > path && cp[-1] == '/') --cp; } -#if defined(ENOENT) && defined(ENOTDIR) - else { -#if defined(EACCES) - if (errno != EACCES) -#endif - aplog_error(APLOG_MARK, APLOG_ERR, r->server, - "access to %s failed for %s", r->uri, - get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME)); - - return HTTP_FORBIDDEN; - } #endif /* ENOENT && ENOTDIR */ } return OK;
cvs commit: apachen/src/main http_request.c
dgaudet 97/10/04 19:04:46 Modified:src/main http_request.c Log: Fix wildcarding of special directories like "proxy:" Reviewed by: Jim Jagielski Revision ChangesPath 1.86 +1 -1 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.85 retrieving revision 1.86 diff -u -r1.85 -r1.86 --- http_request.c1997/09/14 12:16:55 1.85 +++ http_request.c1997/10/05 02:04:44 1.86 @@ -324,7 +324,7 @@ this_conf = entry_config; } else if (entry_core->d_is_fnmatch) { -if (!fnmatch(entry_dir, test_filename, FNM_PATHNAME)) +if (!fnmatch(entry_dir, test_filename, 0)) this_conf = entry_config; } else if (!strncmp(test_filename, entry_dir, strlen(entry_dir)))
cvs commit: apachen/src/main http_request.c
fielding97/10/05 22:35:07 Modified:src CHANGES src/main http_request.c Log: Fix support for Proxy Authentication (we were testing the response status too early). Submitted by: Marc Slemko Reviewed by: Roy Fielding, Dean Gaudet Revision ChangesPath 1.458 +3 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.457 retrieving revision 1.458 diff -u -r1.457 -r1.458 --- CHANGES 1997/10/05 07:47:41 1.457 +++ CHANGES 1997/10/06 05:35:03 1.458 @@ -1,5 +1,8 @@ Changes with Apache 1.3b1 + *) Fix support for Proxy Authentication (we were testing the response + status too early). [Marc Slemko] + *) CoreDumpDirectory directive directs where the core file is written when a SIGSEGV, SIGBUS, SIGABORT or SIGABRT are received. [Marc Slemko, Dean Gaudet] 1.87 +9 -9 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- http_request.c1997/10/05 02:04:44 1.86 +++ http_request.c1997/10/06 05:35:06 1.87 @@ -850,15 +850,6 @@ char *custom_response = response_code_string(r, error_index); int recursive_error = 0; -/* - * This test is done here so that none of the auth modules needs to know - * about proxy authentication. They treat it like normal auth, and then - * we tweak the status. - */ -if (r->status == AUTH_REQUIRED && r->proxyreq) { -r->status = HTTP_PROXY_AUTHENTICATION_REQUIRED; -} - if (type == DONE) { finalize_request_protocol(r); return; @@ -882,6 +873,15 @@ } r->status = type; + +/* + * This test is done here so that none of the auth modules needs to know + * about proxy authentication. They treat it like normal auth, and then + * we tweak the status. + */ +if (r->status == AUTH_REQUIRED && r->proxyreq) { +r->status = HTTP_PROXY_AUTHENTICATION_REQUIRED; +} /* * Two types of custom redirects --- plain text, and URLs. Plain text has
cvs commit: apachen/src/main http_request.c
dgaudet 97/10/14 17:15:14 Modified:src/main http_request.c Log: Fix an off-by-one error introduced in one of the directory_walk optimizations. Reviewed by: Jim Jagielski, Rob Hartill Revision ChangesPath 1.89 +3 -1 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.88 retrieving revision 1.89 diff -u -r1.88 -r1.89 --- http_request.c1997/10/07 05:27:08 1.88 +++ http_request.c1997/10/15 00:15:13 1.89 @@ -364,8 +364,10 @@ * We will use test_dirname as scratch space while we build directory * names during the walk. Profiling shows directory_walk to be a busy * function so we try to avoid allocating lots of extra memory here. + * We need 2 extra bytes, one for trailing \0 and one because + * make_dirstr_prefix will add potentially one extra /. */ -test_dirname = palloc(r->pool, test_filename_len + 1); +test_dirname = palloc(r->pool, test_filename_len + 2); /* j keeps track of which section we're on, see core_reorder_directories */ j = 0;
cvs commit: apachen/src/main http_request.c
dgaudet 97/11/14 19:29:58 Modified:src CHANGES src/main http_request.c Log: Lars says: if a user tries to use authentication and forgets to set AuthType he will the following error: configuration error: couldn't check user. No user file? The appended patch provides a correct error message if the authentication failure was due to a missing AuthType directive. Submitted by: Lars Eilebrecht Reviewed by: Dean Gaudet, Martin Kraemer, Roy Fielding Revision ChangesPath 1.512 +3 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.511 retrieving revision 1.512 diff -u -r1.511 -r1.512 --- CHANGES 1997/11/14 16:07:22 1.511 +++ CHANGES 1997/11/15 03:29:55 1.512 @@ -1,5 +1,8 @@ Changes with Apache 1.3b3 + *) Give a more informative error when no AuthType is set. + [Lars Eilebrecht] + *) Remove strtoul() use from mod_proxy because it isn't available on all platforms. [Marc Slemko] PR#1214 1.93 +20 -10apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.92 retrieving revision 1.93 diff -u -r1.92 -r1.93 --- http_request.c1997/11/08 21:39:11 1.92 +++ http_request.c1997/11/15 03:29:57 1.93 @@ -1065,28 +1065,38 @@ return; } if (some_auth_required(r)) { -if ((access_status = check_user_id(r)) != 0) { -decl_die(access_status, "check user. No user file?", r); +if (((access_status = check_user_id(r)) != 0) || !auth_type(r)) { +decl_die(access_status, auth_type(r) + ? "check user. No user file?" + : "perform authentication. AuthType not set!", r); return; } -if ((access_status = check_auth(r)) != 0) { -decl_die(access_status, "check access. No groups file?", r); +if (((access_status = check_auth(r)) != 0) || !auth_type(r)) { +decl_die(access_status, auth_type(r) + ? "check access. No groups file?" + : "perform authentication. AuthType not set!", r); return; } } break; case SATISFY_ANY: -if ((access_status = check_access(r)) != 0) { +if (((access_status = check_access(r)) != 0) || !auth_type(r)) { if (!some_auth_required(r)) { -decl_die(access_status, "check access", r); +decl_die(access_status, auth_type(r) + ? "check access" + : "perform authentication. AuthType not set!", r); return; } -if ((access_status = check_user_id(r)) != 0) { -decl_die(access_status, "check user. No user file?", r); +if (((access_status = check_user_id(r)) != 0) || !auth_type(r)) { +decl_die(access_status, auth_type(r) + ? "check user. No user file?" + : "perform authentication. AuthType not set!", r); return; } -if ((access_status = check_auth(r)) != 0) { -decl_die(access_status, "check access. No groups file?", r); +if (((access_status = check_auth(r)) != 0) || !auth_type(r)) { +decl_die(access_status, auth_type(r) + ? "check access. No groups file?" + : "perform authentication. AuthType not set!", r); return; } }
cvs commit: apachen/src/main http_request.c
dgaudet 97/11/22 14:23:42 Modified:src/main http_request.c Log: Comment was a little bit inaccurate. Also explicitly mention 2068 S9, S14.23 in the error message so that maybe we can avoid more and more people complaining about us rejecting HTTP/1.1 requests without a Host: header. PR: 1454 Revision ChangesPath 1.94 +4 -2 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- http_request.c1997/11/15 03:29:57 1.93 +++ http_request.c1997/11/22 22:23:41 1.94 @@ -988,10 +988,12 @@ /* * Client sent us a HTTP/1.1 or later request without telling us the * hostname, either with a full URL or a Host: header. We therefore - * need to (as per the 1.1 spec) send an error + * need to (as per the 1.1 spec) send an error. As a special case, + * HTTP/1.1 mentions twice (S9, S14.23) that a request MUST contain + * a Host: header, and the server MUST respond with 400 if it doesn't. */ aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, - "client sent HTTP/1.1 request without hostname: %s", r->uri); + "client sent HTTP/1.1 request without hostname (see RFC2068 section 9, and 14.23): %s", r->uri); die(BAD_REQUEST, r); return; }
cvs commit: apachen/src/main http_request.c
ben 97/12/26 07:17:52 Modified:src/main http_request.c Log: Replace some absolute path tests. Revision ChangesPath 1.95 +2 -11 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -r1.94 -r1.95 --- http_request.c1997/11/22 22:23:41 1.94 +++ http_request.c1997/12/26 15:17:50 1.95 @@ -300,12 +300,7 @@ * Fake filenames (i.e. proxy:) only match Directory sections. */ -#if defined(__EMX__) || defined(WIN32) -/* Add OS/2 drive name support */ -if ((test_filename[0] != '/') && (test_filename[1] != ':')) -#else -if (test_filename[0] != '/') -#endif +if (!os_is_path_absolute(test_filename)) { void *this_conf, *entry_config; core_dir_config *entry_core; @@ -410,11 +405,7 @@ entry_dir = entry_core->d; if (entry_core->r -#if defined(__EMX__) || defined(WIN32) -|| (entry_dir[0] != '/' && entry_dir[1] != ':') -#else -|| entry_dir[0] != '/' -#endif + || !os_is_path_absolute(entry_dir) || entry_core->d_components > i) break;
cvs commit: apachen/src/main http_request.c
dgaudet 97/12/31 13:39:27 Modified:src/main http_request.c Log: change comment Revision ChangesPath 1.96 +3 -3 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -r1.95 -r1.96 --- http_request.c1997/12/26 15:17:50 1.95 +++ http_request.c1997/12/31 21:39:26 1.96 @@ -447,9 +447,9 @@ } /* - * now match the "special" sections (regex, and "proxy:" stuff). But - * note that proxy: stuff doesn't get down this far, it's been handled - * earlier, so we'll just skip it. + * There's two types of IS_SPECIAL sections (see http_core.c), and we've + * already handled the proxy:-style stuff. Now we'll deal with the + * regexes. */ for (; j < num_sec; ++j) { void *entry_config = sec[j];
cvs commit: apachen/src/main http_request.c
marc98/01/07 19:56:09 Modified:src/main http_request.c Log: Move os_canonical_filename call to after the section where !os_is_path_absolute names are dealt with to prevent bogus munging of things like proxy: May(?) still cause problems with regex stuff, but fixes proxy caching on win32. Reviewed by: Ben Laurie Revision ChangesPath 1.98 +1 -1 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.97 retrieving revision 1.98 diff -u -r1.97 -r1.98 --- http_request.c1998/01/07 16:46:12 1.97 +++ http_request.c1998/01/08 03:56:08 1.98 @@ -286,7 +286,6 @@ return OK; } -r->filename = os_canonical_filename(r->pool, r->filename); test_filename = pstrdup(r->pool, r->filename); /* @@ -337,6 +336,7 @@ return OK; } +r->filename = os_canonical_filename(r->pool, r->filename); no2slash(test_filename); num_dirs = count_dirs(test_filename);
cvs commit: apachen/src/main http_request.c
dgaudet 98/01/21 14:48:14 Modified:src CHANGES src/main http_request.c Log: We need to eat the request body, if any, in die() in order to continue a keep-alive session. PR: 1399 Submitted by: Roy Fielding Reviewed by: Martin Kraemer, Dean Gaudet Revision ChangesPath 1.585 +5 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.584 retrieving revision 1.585 diff -u -r1.584 -r1.585 --- CHANGES 1998/01/21 22:31:44 1.584 +++ CHANGES 1998/01/21 22:48:10 1.585 @@ -1,5 +1,10 @@ Changes with Apache 1.3b4 + *) When die() happens we need to eat any request body if one exists. + Otherwise we can't continue with a keepalive session. This shows up + as a POST problem with MSIE 4.0, typically against pages which are + authenticated. [Roy Fielding] PR#1399 + *) If you define SECURITY_HOLE_PASS_AUTHORIZATION then the Authorization header will be passed to CGIs. This is generally a security hole, so it's not a default. [Marc Slemko] PR#549 1.100 +11 -0 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.99 retrieving revision 1.100 diff -u -r1.99 -r1.100 --- http_request.c1998/01/11 20:55:18 1.99 +++ http_request.c1998/01/21 22:48:13 1.100 @@ -878,6 +878,17 @@ } /* + * If we want to keep the connection, be sure that the request body + * (if any) has been read. + */ +if ((r->status != HTTP_NOT_MODIFIED) && (r->status != HTTP_NO_CONTENT) +&& !status_drops_connection(r->status) +&& r->connection && (r->connection->keepalive != -1)) { + +(void) discard_request_body(r); +} + +/* * Two types of custom redirects --- plain text, and URLs. Plain text has * a leading '"', so the URL code, here, is triggered on its absence */
cvs commit: apachen/src/main http_request.c
dgaudet 98/01/26 18:39:42 Modified:src/main http_request.c Log: When calling rename_original_environment we should be creating the new table in the environment of the subrequest, not the main request. Otherwise it will consume memory when it shouldn't be... and will trigger POOL_DEBUG aborts. Revision ChangesPath 1.102 +1 -1 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.101 retrieving revision 1.102 diff -u -r1.101 -r1.102 --- http_request.c1998/01/26 19:50:13 1.101 +++ http_request.c1998/01/27 02:39:41 1.102 @@ -1219,7 +1219,7 @@ new->headers_in = r->headers_in; new->headers_out = make_table(r->pool, 5); new->err_headers_out = r->err_headers_out; -new->subprocess_env = rename_original_env(r->pool, r->subprocess_env); +new->subprocess_env = rename_original_env(new->pool, r->subprocess_env); new->notes = make_table(r->pool, 5); new->htaccess= r->htaccess;
cvs commit: apachen/src/main http_request.c
dgaudet 98/01/26 18:41:13 Modified:src/main http_request.c Log: Oh nevermind. I didn't realise internal redirected requests shared the same pool as the main request. That's odd, maybe there's some savings to be had... some other day. Revision ChangesPath 1.103 +1 -1 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.102 retrieving revision 1.103 diff -u -r1.102 -r1.103 --- http_request.c1998/01/27 02:39:41 1.102 +++ http_request.c1998/01/27 02:41:11 1.103 @@ -1219,7 +1219,7 @@ new->headers_in = r->headers_in; new->headers_out = make_table(r->pool, 5); new->err_headers_out = r->err_headers_out; -new->subprocess_env = rename_original_env(new->pool, r->subprocess_env); +new->subprocess_env = rename_original_env(r->pool, r->subprocess_env); new->notes = make_table(r->pool, 5); new->htaccess= r->htaccess;
cvs commit: apachen/src/main http_request.c http_request.h
fielding97/09/14 05:16:57 Modified:src INDENT src/main http_request.c http_request.h Log: Reformatted http_request.* according to style guide. Revision ChangesPath 1.9 +4 -3 apachen/src/INDENT Index: INDENT === RCS file: /export/home/cvs/apachen/src/INDENT,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- INDENT1997/09/14 11:36:32 1.8 +++ INDENT1997/09/14 12:16:53 1.9 @@ -1,6 +1,7 @@ This is the current status of running indent on the source code. If you are about to edit a file, mark it as RESERVED below with your name. -If a file has already been indent'd, or doesn't need it, mark it as DONE +If a file has already been indent'd, or doesn't need it, mark it as DONE. +AND don't forget to run expand on the file after it has been indent'd. ./main: STATUS alloc.c DONE by Dean @@ -25,8 +26,8 @@ http_main.h DONE by Dean http_protocol.c DONE by Roy http_protocol.h DONE by Roy - http_request.cRESERVED while Roy is working on it - http_request.hRESERVED while Roy is working on it + http_request.cDONE by Roy + http_request.hDONE by Roy httpd.h md5.h md5c.c 1.85 +796 -756 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.84 retrieving revision 1.85 diff -u -r1.84 -r1.85 --- http_request.c1997/09/14 10:53:24 1.84 +++ http_request.c1997/09/14 12:16:55 1.85 @@ -6,7 +6,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - *notice, this list of conditions and the following disclaimer. + *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in @@ -52,12 +52,12 @@ /* * http_request.c: functions to get and process requests - * + * * Rob McCool 3/21/93 * * Thoroughly revamped by rst for Apache. NB this file reads * best from the bottom up. - * + * */ #define CORE_PRIVATE @@ -86,77 +86,85 @@ * they change, all the way down. */ - /* * We don't want people able to serve up pipes, or unix sockets, or other * scary things. Note that symlink tests are performed later. */ static int check_safe_file(request_rec *r) { -if (r->finfo.st_mode == 0/* doesn't exist */ - || S_ISDIR (r->finfo.st_mode) - || S_ISREG (r->finfo.st_mode) - || S_ISLNK (r->finfo.st_mode)) { - return OK; +if (r->finfo.st_mode == 0 /* doesn't exist */ +|| S_ISDIR(r->finfo.st_mode) +|| S_ISREG(r->finfo.st_mode) +|| S_ISLNK(r->finfo.st_mode)) { +return OK; } aplog_error(APLOG_MARK, APLOG_ERR, r->server, - "object is not a file, directory or symlink: %s", r->filename); +"object is not a file, directory or symlink: %s", +r->filename); return HTTP_FORBIDDEN; } -int check_symlinks (char *d, int opts) -{ +int check_symlinks(char *d, int opts) +{ #if defined(__EMX__) || defined(WIN32) -/* OS/2 dosen't have symlinks */ +/* OS/2 doesn't have symlinks */ return OK; #else struct stat lfi, fi; char *lastp; int res; - - -if (opts & OPT_SYM_LINKS) return OK; - -/* Strip trailing '/', if any, off what we're checking; trailing - * slashes make some systems follow symlinks to directories even in - * lstat(). After we've done the lstat, put it back. Also, don't - * bother checking '/' at all... - * - * Note that we don't have to worry about multiple slashes here - * because of no2slash() below... + +if (opts & OPT_SYM_LINKS) +return OK; + +/* + * Strip trailing '/', if any, off what we're checking; trailing slashes + * make some systems follow symlinks to directories even in lstat(). + * After we've done the lstat, put it back. Also, don't bother checking + * '/' at all... + * + * Note that we don't have to worry about multiple slashes here because of + * no2slash() below... */ lastp = d + strlen(d) - 1; -if (lastp == d) return OK; /* Root directory, '/' */ - -if (*lastp == '/') *lastp = '\0'; -else lastp = NULL; - -res = lstat (d, &lfi); - -if (lastp) *last
Re: cvs commit: apachen/src/main http_request.c
On 31 Dec 1997 [EMAIL PROTECTED] wrote: > dgaudet 97/12/31 13:39:27 > > Modified:src/main http_request.c > Log: > change comment > > Revision ChangesPath > 1.96 +3 -3 apachen/src/main/http_request.c > > Index: http_request.c > === > RCS file: /export/home/cvs/apachen/src/main/http_request.c,v > retrieving revision 1.95 > retrieving revision 1.96 > diff -u -r1.95 -r1.96 > --- http_request.c 1997/12/26 15:17:50 1.95 > +++ http_request.c 1997/12/31 21:39:26 1.96 > @@ -447,9 +447,9 @@ >} > >/* > - * now match the "special" sections (regex, and "proxy:" stuff). But > - * note that proxy: stuff doesn't get down this far, it's been handled > - * earlier, so we'll just skip it. > + * There's two types of IS_SPECIAL sections (see http_core.c), and > we've > + * already handled the proxy:-style stuff. Now we'll deal with the > + * regexes. Does os_canonical_filename mess up r->filename for regex stuff here under win32? It has to be moved after the proxy section since it messes it up. Geck. Some of that win32 code is ugly. I don't want to fix it. Perhaps I will
cvs commit: apachen/src/main http_request.c http_request.h http_config.h
coar97/08/25 09:02:31 Modified:src CHANGES src/main http_request.c http_request.h http_config.h Log: Add r->mtime field to reduce gratuitous date parsing, and update_mtime() function to advance it as needed. (This will be used by the ETag and Last-Modified changes coming shortly.) Reviewed by: Roy Fielding Revision ChangesPath 1.420 +8 -2 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.419 retrieving revision 1.420 diff -u -r1.419 -r1.420 --- CHANGES 1997/08/25 02:26:52 1.419 +++ CHANGES 1997/08/25 16:02:21 1.420 @@ -1,5 +1,11 @@ Changes with Apache 1.3a2 + *) API: A new field in the request_rec, r->mtime, has been added to + avoid gratuitous parsing of date strings. It is intended to hold + the last-modified date of the resource (if applicable). An + update_mtime() routine has also been added to advance it if + appropriate. [Roy Fielding, Ken Coar] + *) If a htaccess file can not be read due to bad permissions, deny access to the directory with a HTTP_FORBIDDEN. The previous behavior was to ignore the htaccess file if it could not @@ -14,8 +20,8 @@ *) Canonicalise filenames under Win32. Short filenames are converted to long ones. Backslashes are converted to forward - slashes. Case is converted to lower. Parts of URLs that do not - correspond to files are left completely alone. [Ben Laurie] + slashes. Case is converted to lower. Parts of URLs that do not + correspond to files are left completely alone. [Ben Laurie] *) PORT: 2 new OSs added to the list of ports: Encore's UMAX V: Arieh Markel <[EMAIL PROTECTED]> 1.79 +12 -0 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.78 retrieving revision 1.79 diff -u -r1.78 -r1.79 --- http_request.c1997/08/19 07:52:42 1.78 +++ http_request.c1997/08/25 16:02:27 1.79 @@ -1201,3 +1201,15 @@ && (r->prev == NULL); /* otherwise, this is an internal redirect */ } + +/* + * Function to set the r->mtime field to the specified value if it's later + * than what's already there. + */ +API_EXPORT(time_t) update_mtime(request_rec *r, time_t dependency_mtime) +{ +if (r->mtime < dependency_mtime) { + r->mtime = dependency_mtime; +} +return r->mtime; +} 1.15 +1 -0 apachen/src/main/http_request.h Index: http_request.h === RCS file: /export/home/cvs/apachen/src/main/http_request.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- http_request.h1997/08/18 07:17:27 1.14 +++ http_request.h1997/08/25 16:02:27 1.15 @@ -87,6 +87,7 @@ API_EXPORT(void) internal_redirect_handler (const char *new_uri, request_rec *); API_EXPORT(int) some_auth_required (request_rec *r); API_EXPORT(int) is_initial_req(request_rec *r); +API_EXPORT(time_t) update_mtime(request_rec *r, time_t dependency_mtime); #ifdef CORE_PRIVATE /* Function called by main.c to handle first-level request */ 1.46 +1 -1 apachen/src/main/http_config.h Index: http_config.h === RCS file: /export/home/cvs/apachen/src/main/http_config.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- http_config.h 1997/08/23 04:00:28 1.45 +++ http_config.h 1997/08/25 16:02:28 1.46 @@ -246,7 +246,7 @@ * handle it back-compatibly, or at least signal an error). */ -#define MODULE_MAGIC_NUMBER 19970818 +#define MODULE_MAGIC_NUMBER 19970825 #define STANDARD_MODULE_STUFF MODULE_MAGIC_NUMBER, -1, __FILE__, NULL /* Generic accessors for other modules to get at their own module-specific