cvs commit: apache-1.3/src/support rotatelogs.8
coar98/06/12 03:10:59 Modified:src/support rotatelogs.8 Log: Fix typo. PR: 2426 Submitted by Katsuya Odajima <[EMAIL PROTECTED]> Revision ChangesPath 1.3 +1 -1 apache-1.3/src/support/rotatelogs.8 Index: rotatelogs.8 === RCS file: /export/home/cvs/apache-1.3/src/support/rotatelogs.8,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- rotatelogs.8 1998/03/31 12:53:54 1.2 +++ rotatelogs.8 1998/06/12 10:10:58 1.3 @@ -64,7 +64,7 @@ feature which can be used like this: .fi - TansferLog "|rotatelogs /path/to/logs/access_log 86400" + TransferLog "|rotatelogs /path/to/logs/access_log 86400" .mf This creates the files /path/to/logs/access_log. where is the system
cvs commit: apache-1.3/src/modules/standard mod_autoindex.c
coar98/06/12 04:20:57 Modified:src/modules/standard mod_autoindex.c Log: Style-guide cleanups. Revision ChangesPath 1.78 +175 -122 apache-1.3/src/modules/standard/mod_autoindex.c Index: mod_autoindex.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v retrieving revision 1.77 retrieving revision 1.78 diff -u -r1.77 -r1.78 --- mod_autoindex.c 1998/05/16 21:11:17 1.77 +++ mod_autoindex.c 1998/06/12 11:20:56 1.78 @@ -142,15 +142,9 @@ */ static void emit_preamble(request_rec *r, char *title) { -ap_rvputs - ( - r, - "\n", - "\n \n Index of ", - title, - "\n \n \n", - NULL - ); +ap_rvputs(r, "\n", + "\n \n Index of ", title, + "\n \n \n", NULL); } static void push_item(array_header *arr, char *type, char *to, char *path, @@ -158,33 +152,41 @@ { struct item *p = (struct item *) ap_push_array(arr); -if (!to) +if (!to) { to = ""; -if (!path) +} +if (!path) { path = ""; +} p->type = type; p->data = data ? ap_pstrdup(arr->pool, data) : NULL; p->apply_path = ap_pstrcat(arr->pool, path, "*", NULL); -if ((type == BY_PATH) && (!ap_is_matchexp(to))) +if ((type == BY_PATH) && (!ap_is_matchexp(to))) { p->apply_to = ap_pstrcat(arr->pool, "*", to, NULL); -else if (to) +} +else if (to) { p->apply_to = ap_pstrdup(arr->pool, to); -else +} +else { p->apply_to = NULL; +} } static const char *add_alt(cmd_parms *cmd, void *d, char *alt, char *to) { -if (cmd->info == BY_PATH) - if (!strcmp(to, "**DIRECTORY**")) +if (cmd->info == BY_PATH) { +if (!strcmp(to, "**DIRECTORY**")) { to = "^^DIRECTORY^^"; + } +} if (cmd->info == BY_ENCODING) { ap_str_tolower(to); } -push_item(((autoindex_config_rec *) d)->alt_list, cmd->info, to, cmd->path, alt); +push_item(((autoindex_config_rec *) d)->alt_list, cmd->info, to, + cmd->path, alt); return NULL; } @@ -203,28 +205,24 @@ *cl = '\0'; /* Lose closing paren */ add_alt(cmd, d, &alt[1], to); } -if (cmd->info == BY_PATH) - if (!strcmp(to, "**DIRECTORY**")) +if (cmd->info == BY_PATH) { +if (!strcmp(to, "**DIRECTORY**")) { to = "^^DIRECTORY^^"; + } +} if (cmd->info == BY_ENCODING) { ap_str_tolower(to); } -push_item(((autoindex_config_rec *) d)->icon_list, cmd->info, to, cmd->path, - iconbak); +push_item(((autoindex_config_rec *) d)->icon_list, cmd->info, to, + cmd->path, iconbak); return NULL; } static const char *add_desc(cmd_parms *cmd, void *d, char *desc, char *to) { -push_item - ( - ((autoindex_config_rec *) d)->desc_list, - cmd->info, - to, - cmd->path, - desc - ); +push_item(((autoindex_config_rec *) d)->desc_list, cmd->info, to, + cmd->path, desc); return NULL; } @@ -239,7 +237,8 @@ if (strchr(name, '/')) { return "HeaderName cannot contain a /"; } -push_item(((autoindex_config_rec *) d)->hdr_list, 0, NULL, cmd->path, name); +push_item(((autoindex_config_rec *) d)->hdr_list, 0, NULL, cmd->path, + name); return NULL; } @@ -248,15 +247,16 @@ if (strchr(name, '/')) { return "ReadmeName cannot contain a /"; } -push_item(((autoindex_config_rec *) d)->rdme_list, 0, NULL, cmd->path, name); +push_item(((autoindex_config_rec *) d)->rdme_list, 0, NULL, cmd->path, + name); return NULL; } static const char *add_opts_int(cmd_parms *cmd, void *d, int opts) { -push_item(((autoindex_config_rec *) d)->opts_list, (char *) (long) opts, NULL, - cmd->path, NULL); +push_item(((autoindex_config_rec *) d)->opts_list, (char *) (long) opts, + NULL, cmd->path, NULL); return NULL; } @@ -273,25 +273,33 @@ while (optstr[0]) { w = ap_getword_conf(cmd->pool, &optstr); - if (!strcasecmp(w, "FancyIndexing")) + if (!strcasecmp(w, "FancyIndexing")) { opts |= FANCY_INDEXING; - else if (!strcasecmp(w, "IconsAreLinks")) + } + else if (!strcasecmp(w, "IconsAreLinks")) { opts |= ICONS_ARE_LINKS; - else if (!strcasecmp(w, "ScanHTMLTitles")) + } + else if (!strcasecmp(w, "ScanHTMLTitles")) { opts |= SCAN_HTML_TITLES; - else if (!strcasecmp(w, "SuppressLastModified"))
cvs commit: apache-1.3/src/modules/standard mod_autoindex.c
coar98/06/12 08:53:26 Modified:src CHANGES src/modules/standard mod_autoindex.c Log: I've been meaning to clean up these integer-as-string comparisons for a while, and encountered the misplacement of the parent directory entry during testing. Needing the parent-directory test in a second location prompted streamlining simplification of the method. Revision ChangesPath 1.911 +9 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.910 retrieving revision 1.911 diff -u -r1.910 -r1.911 --- CHANGES 1998/06/10 21:13:26 1.910 +++ CHANGES 1998/06/12 15:53:21 1.911 @@ -1,5 +1,14 @@ Changes with Apache 1.3.1 + *) Improve performance of directory listings (mod_autoindex) by comparing + integer keys (last-modified and size) as integers rather than converting + them to strings first. Also use a set of explicit byte tests rather + than strcmp() to check for parent directory-ness of an entry. Oh, and + make sure the parent directory (if displayed) is *always* listed first + regardless of the sort key. Overall performance winnage should be good + in CPU time, instruction cache, and memory usage, particularly for large + directories. [Ken Coar] + *) Add httpd -t (test) option for running configuration syntax tests only. If something is broken it complains and exits with a return code non-equal to 0. This can be used manually by the user to check the Apache 1.79 +119 -60 apache-1.3/src/modules/standard/mod_autoindex.c Index: mod_autoindex.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v retrieving revision 1.78 retrieving revision 1.79 diff -u -r1.78 -r1.79 --- mod_autoindex.c 1998/06/12 11:20:56 1.78 +++ mod_autoindex.c 1998/06/12 15:53:23 1.79 @@ -136,6 +136,37 @@ #define BY_PATH &c_by_path /* + * Return true if the specified string refers to the parent directory (i.e., + * matches ".." or "../"). Hopefully this one call is significantly less + * expensive than multiple strcmp() calls. + */ +static int is_parent(const char *name) +{ +/* + * If it's no name at all, it isn't our parent. + */ +if (name == NULL) { +return 0; +} +/* + * Nor is it if the name isn't long enough. + */ +if ((name[0] == '\0') || (name[1] == '\0')) { +return 0; +} +/* + * Now, IFF the first two bytes are dots, and the third byte is either + * EOS (\0) or a slash followed by EOS, we have a match. + */ +if (((name[0] == '.') && (name[1] == '.')) + && ((name[2] == '\0') + || ((name[2] == '/') && (name[3] == '\0' { +return 1; +} +return 0; +} + +/* * This routine puts the standard HTML header at the top of the index page. * We include the DOCTYPE because we may be using features therefrom (i.e., * HEIGHT and WIDTH attributes on the icons if we're FancyIndexing). @@ -417,9 +448,7 @@ char *alt; char *desc; size_t size; -char *size_cmp; time_t lm; -char *lm_cmp; struct ent *next; int ascending; char key; @@ -750,20 +779,15 @@ } ap_destroy_sub_req(rr); -} -if (keyid == K_SIZE) { - p->size_cmp = ap_palloc(r->pool, 14); - ap_snprintf(p->size_cmp, 14, "%013d", p->size); } +/* + * We don't need to take any special action for the file size key. If + * we did, it would go here. + */ if (keyid == K_LAST_MOD) { - struct tm *ts = localtime(&p->lm); - - if(ts) { - p->lm_cmp = ap_palloc(r->pool, 15); - strftime(p->lm_cmp, 15, "%Y%m%d%H%M%S", ts); +if (p->lm < 0) { + p->lm = 0; } - else - p->lm_cmp=NULL; } return (p); } @@ -892,7 +916,7 @@ ap_clear_pool(scratch); - if ((!strcmp(ar[x]->name, "../")) || (!strcmp(ar[x]->name, ".."))) { + if (is_parent(ar[x]->name)) { t = ap_make_full_path(scratch, name, "../"); ap_getparents(t); if (t[0] == '\0') { @@ -986,73 +1010,108 @@ } } +/* + * Compare two file entries according to the sort criteria. The return + * is essentially a signum function value. + */ static int dsortf(struct ent **e1, struct ent **e2) { char *s1; char *s2; -char *s3; +struct ent *c1; +struct ent *c2; int result; +int compare_by_string = 1; /* + * First, see if either of the entries is for the par
cvs commit: apache-1.3/src/modules/standard mod_autoindex.c
dgaudet 98/06/12 10:42:43 Modified:src/modules/standard mod_autoindex.c Log: - It's not possible for name to be NULL. - It's not necessary to test name[0] == 0 because the next if will fail in that event anyhow. Ditto for name[1] == 0. Revision ChangesPath 1.80 +1 -13 apache-1.3/src/modules/standard/mod_autoindex.c Index: mod_autoindex.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -r1.79 -r1.80 --- mod_autoindex.c 1998/06/12 15:53:23 1.79 +++ mod_autoindex.c 1998/06/12 17:42:42 1.80 @@ -140,20 +140,8 @@ * matches ".." or "../"). Hopefully this one call is significantly less * expensive than multiple strcmp() calls. */ -static int is_parent(const char *name) +static ap_inline int is_parent(const char *name) { -/* - * If it's no name at all, it isn't our parent. - */ -if (name == NULL) { -return 0; -} -/* - * Nor is it if the name isn't long enough. - */ -if ((name[0] == '\0') || (name[1] == '\0')) { -return 0; -} /* * Now, IFF the first two bytes are dots, and the third byte is either * EOS (\0) or a slash followed by EOS, we have a match.