cvs commit: apachen/src/modules/standard mod_alias.c mod_dir.c mod_expires.c mod_imap.c mod_include.c mod_log_config.c mod_negotiation.c mod_rewrite.c mod_setenvif.c mod_speling.c mod_unique_id.c mod_userdir.c mod_usertrack.c
dgaudet 98/01/26 11:50:30 Modified:.STATUS htdocs/manual new_features_1_3.html src CHANGES src/main alloc.c alloc.h http_config.h http_core.c http_protocol.c http_request.c util_script.c src/modules/proxy mod_proxy.c src/modules/standard mod_alias.c mod_dir.c mod_expires.c mod_imap.c mod_include.c mod_log_config.c mod_negotiation.c mod_rewrite.c mod_setenvif.c mod_speling.c mod_unique_id.c mod_userdir.c mod_usertrack.c Log: API additions: table_setn, table_addn, table_mergen... for speed! POOL_DEBUG support for correctness. Submitted by: Dmitry Khrustalev <[EMAIL PROTECTED]>, Dean Gaudet Reviewed by: Brian Behlendorf, Jim Jagielski Revision ChangesPath 1.131 +1 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.130 retrieving revision 1.131 diff -u -r1.130 -r1.131 --- STATUS1998/01/26 18:24:25 1.130 +++ STATUS1998/01/26 19:50:05 1.131 @@ -138,6 +138,7 @@ * Add more compile time diagnosis to main's -V switch * [Port] Fix CGI-Execution for EBCDIC hosts. * Martin's [PATCH] "Signing" server generated pages +* Dmitry's table_*n API addition Available Patches: 1.39 +18 -0 apachen/htdocs/manual/new_features_1_3.html Index: new_features_1_3.html === RCS file: /export/home/cvs/apachen/htdocs/manual/new_features_1_3.html,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- new_features_1_3.html 1998/01/26 16:53:36 1.38 +++ new_features_1_3.html 1998/01/26 19:50:06 1.39 @@ -293,6 +293,12 @@ and IRIX. mod_log_config can be compile-time configured to buffer writes. +Replaced strncpy() with ap_cpystrn(), a + routine which doesn't have to zero-fill the entire result. This + has dramatic effects on mod_include speed. +Additions to the internal "table" API (used for keeping lists of + key/value string pairs) provide for up to 20% performance + improvement in many situations. See the new performance @@ -461,6 +467,18 @@ is far more expensive and should only be used for testing with tools such as Electric Fence and Purify. See main/alloc.c for more details. + +ap_cpystrn +The new strncpy "lookalike", with slightly different +semantics is much faster than strncpy because it +doesn't have to zero-fill the entire buffer. + +table_addn, table_setn, +table_mergen +These new functions do not call pstrdup +on their arguments. This provides for big speedups. There is +also some debugging support to ensure code uses them properly. +See src/CHANGES for more information. 1.600 +20 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.599 retrieving revision 1.600 diff -u -r1.599 -r1.600 --- CHANGES 1998/01/25 03:52:15 1.599 +++ CHANGES 1998/01/26 19:50:08 1.600 @@ -1,5 +1,25 @@ Changes with Apache 1.3b4 + *) table_add, table_merge, and table_set include implicit pstrdup() + of the key and value. But in many cases this is not required + because the key/value is a constant, or the value has been built + by pstrcat() or other similar means. New routines table_addn, + table_mergen, and table_setn have been added to the API, these + routines do not pstrdup() their arguments. The core code and + standard modules were changed to take advantage of these routines. + The resulting server is up to 20% faster in some situations. + + Note that it is easy to get code subtly wrong if you pass a key/value + which is in a pool other than the pool of the table. The only + safe thing to do is to pass key/values which are in the pool of + the table, or in one of the ancestors of the pool of the table. + i.e. if the table is part of a subrequest, a value from the main + request's pool is OK since the subrequest pool is a sub_pool of the + main request's pool (and therefore has a lifespan at most as long as + the main pool). There is debugging code which can detect improper + usage, enabled by defining POOL_DEBUG. See alloc.c for more details. + [Dmitry Khrustalev <[EMAIL PROTECTED]>, Dean Gaudet] + *) More mod_mime_magic cleanup: fewer syscalls; should handle "files" which don't exist on dis
cvs commit: apachen/src/modules/standard mod_alias.c mod_auth_anon.c mod_cern_meta.c mod_digest.c mod_log_agent.c mod_log_referer.c mod_usertrack.c
dgaudet 98/01/02 16:16:39 Modified:src/modules/standard mod_alias.c mod_auth_anon.c mod_cern_meta.c mod_digest.c mod_log_agent.c mod_log_referer.c mod_usertrack.c Log: Somehow I missed a whole boatload of modules when adding static. I'm not sure how that was. There's a few other changes in here, nothing that affects functionality, they're essentially documentation fixes. Revision ChangesPath 1.28 +3 -3 apachen/src/modules/standard/mod_alias.c Index: mod_alias.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_alias.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- mod_alias.c 1997/12/14 20:48:55 1.27 +++ mod_alias.c 1998/01/03 00:16:35 1.28 @@ -246,10 +246,10 @@ {NULL} }; -static int alias_matches(char *uri, char *alias_fakename) +static int alias_matches(const char *uri, const char *alias_fakename) { -char *end_fakename = alias_fakename + strlen(alias_fakename); -char *aliasp = alias_fakename, *urip = uri; +const char *end_fakename = alias_fakename + strlen(alias_fakename); +const char *aliasp = alias_fakename, *urip = uri; while (aliasp < end_fakename) { if (*aliasp == '/') { 1.28 +10 -10apachen/src/modules/standard/mod_auth_anon.c Index: mod_auth_anon.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_auth_anon.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- mod_auth_anon.c 1997/10/22 20:30:15 1.27 +++ mod_auth_anon.c 1998/01/03 00:16:35 1.28 @@ -112,7 +112,7 @@ } anon_auth_config_rec; -void *create_anon_auth_dir_config(pool *p, char *d) +static void *create_anon_auth_dir_config(pool *p, char *d) { anon_auth_config_rec *sec = (anon_auth_config_rec *) pcalloc(p, sizeof(anon_auth_config_rec)); @@ -131,39 +131,39 @@ return sec; } -const char *anon_set_passwd_flag(cmd_parms *cmd, +static const char *anon_set_passwd_flag(cmd_parms *cmd, anon_auth_config_rec * sec, int arg) { sec->auth_anon_mustemail = arg; return NULL; } -const char *anon_set_userid_flag(cmd_parms *cmd, +static const char *anon_set_userid_flag(cmd_parms *cmd, anon_auth_config_rec * sec, int arg) { sec->auth_anon_nouserid = arg; return NULL; } -const char *anon_set_logemail_flag(cmd_parms *cmd, +static const char *anon_set_logemail_flag(cmd_parms *cmd, anon_auth_config_rec * sec, int arg) { sec->auth_anon_logemail = arg; return NULL; } -const char *anon_set_verifyemail_flag(cmd_parms *cmd, +static const char *anon_set_verifyemail_flag(cmd_parms *cmd, anon_auth_config_rec * sec, int arg) { sec->auth_anon_verifyemail = arg; return NULL; } -const char *anon_set_authoritative_flag(cmd_parms *cmd, +static const char *anon_set_authoritative_flag(cmd_parms *cmd, anon_auth_config_rec * sec, int arg) { sec->auth_anon_authoritative = arg; return NULL; } -const char *anon_set_string_slots(cmd_parms *cmd, +static const char *anon_set_string_slots(cmd_parms *cmd, anon_auth_config_rec * sec, char *arg) { @@ -187,7 +187,7 @@ return NULL; } -command_rec anon_auth_cmds[] = +static command_rec anon_auth_cmds[] = { {"Anonymous", anon_set_string_slots, NULL, OR_AUTHCFG, ITERATE, "a space-separated list of user IDs"}, @@ -207,7 +207,7 @@ module MODULE_VAR_EXPORT anon_auth_module; -int anon_authenticate_basic_user(request_rec *r) +static int anon_authenticate_basic_user(request_rec *r) { anon_auth_config_rec *sec = (anon_auth_config_rec *) get_module_config(r->per_dir_config, @@ -267,7 +267,7 @@ return DECLINED; } -int check_anon_access(request_rec *r) +static int check_anon_access(request_rec *r) { #ifdef NOTYET conn_rec *c = r->connection; 1.23 +8 -8 apachen/src/modules/standard/mod_cern_meta.c Index: mod_cern_meta.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_cern_meta.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- mod_cern_meta.c 1997/10/22 20:30:17 1.22 +++ mod_cern_meta.c 1998/01/03 00:16:36 1.23 @@ -166,7 +166,7 @@ char *metafiles; } cern_meta_dir_config; -void *create_cern_meta_dir_config(pool *p, char *dummy) +stat
cvs commit: apachen/src/modules/standard mod_alias.c
dgaudet 97/12/14 12:48:56 Modified:src/main alloc.c src/modules/standard mod_alias.c Log: Fix a SIGSEGV for "RedirectMatch gone /". Fix a slight incompatibility introduced into pstrcat in rev 1.42. PR: 1319 Reviewed by: Ben Laurie, Martin Kraemer Revision ChangesPath 1.61 +1 -3 apachen/src/main/alloc.c Index: alloc.c === RCS file: /export/home/cvs/apachen/src/main/alloc.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- alloc.c 1997/12/07 21:33:18 1.60 +++ alloc.c 1997/12/14 20:48:54 1.61 @@ -553,11 +553,9 @@ /* Allocate the required string */ -if (len == 0) { - return NULL; -} res = (char *) palloc(a, len + 1); cp = res; +*cp = '\0'; /* Pass two --- copy the argument strings into the result space */ 1.27 +10 -4 apachen/src/modules/standard/mod_alias.c Index: mod_alias.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_alias.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- mod_alias.c 1997/10/22 20:30:13 1.26 +++ mod_alias.c 1997/12/14 20:48:55 1.27 @@ -297,10 +297,16 @@ if (p->regexp) { if (!regexec(p->regexp, r->uri, p->regexp->re_nsub + 1, regm, 0)) { - found = pregsub(r->pool, p->real, r->uri, - p->regexp->re_nsub + 1, regm); - if (found && doesc) { - found = escape_uri(r->pool, found); + if (p->real) { + found = pregsub(r->pool, p->real, r->uri, + p->regexp->re_nsub + 1, regm); + if (found && doesc) { + found = escape_uri(r->pool, found); + } + } + else { + /* need something non-null */ + found = pstrdup(r->pool, ""); } } }
cvs commit: apachen/src/modules/standard mod_alias.c
dgaudet 97/09/25 19:56:43 Modified:src CHANGES src/modules/standard mod_alias.c Log: PR#1153: RedirectMatch does not escape its result. and unrelated to that PR: RedirectMatch does not allow constructs such as "RedirectMatch /advertiser/(.*) $1". Reviewed by: Jim Jagielski, Roy Fielding Revision ChangesPath 1.445 +4 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.444 retrieving revision 1.445 diff -u -r1.444 -r1.445 --- CHANGES 1997/09/19 17:32:02 1.444 +++ CHANGES 1997/09/26 02:56:39 1.445 @@ -1,5 +1,9 @@ Changes with Apache 1.3b1 + *) RedirectMatch was not properly escaping the result (PR#1155). Also + "RedirectMatch /advertiser/(.*) $1" is now permitted. + [Dean Gaudet] + *) mod_include now uses symbolic names to check for request success and return HTTP errors, and correctly handles all types of redirections (previously it only did temporary redirect correctly). 1.25 +6 -2 apachen/src/modules/standard/mod_alias.c Index: mod_alias.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_alias.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- mod_alias.c 1997/09/16 05:31:56 1.24 +++ mod_alias.c 1997/09/26 02:56:42 1.25 @@ -188,7 +188,7 @@ if (is_HTTP_REDIRECT(status)) { if (!url) return "URL to redirect to is missing"; - if (!is_url(url)) + if (!use_regex && !is_url(url)) return "Redirect to non-URL"; } else { @@ -295,9 +295,13 @@ int l; if (p->regexp) { - if (!regexec(p->regexp, r->uri, p->regexp->re_nsub + 1, regm, 0)) + if (!regexec(p->regexp, r->uri, p->regexp->re_nsub + 1, regm, 0)) { found = pregsub(r->pool, p->real, r->uri, p->regexp->re_nsub + 1, regm); + if (found && doesc) { + found = escape_uri(r->pool, found); + } + } } else { l = alias_matches(r->uri, p->fake);