cvs commit: apache-1.3/src/modules/standard mod_status.c
fanf00/01/11 17:13:39 Modified:src/include ap_mmn.h scoreboard.h src/main http_main.c src/modules/standard mod_status.c Log: Revert to the 1.3.3 way of getting the server name from the scoreboard, with a modification to make it respect the UseCanonicalName setting. This makes things work better with mass vhosting setups. Submitted by: Cliff Woolley [EMAIL PROTECTED] Reviewed by: Tony Finch Revision ChangesPath 1.42 +4 -2 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.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- ap_mmn.h 1999/08/14 08:53:48 1.41 +++ ap_mmn.h 2000/01/12 01:13:06 1.42 @@ -226,14 +226,16 @@ *ap_base64encode_len(), ap_base64decode(), *ap_base64decode_binary(), ap_base64decode_len(), *ap_pbase64decode(), ap_pbase64encode() + * (1.3.10-dev) + * 2112 - put the vhostname back into the scoreboard itself */ #define MODULE_MAGIC_COOKIE 0x41503133UL /* AP13 */ #ifndef MODULE_MAGIC_NUMBER_MAJOR -#define MODULE_MAGIC_NUMBER_MAJOR 19990320 +#define MODULE_MAGIC_NUMBER_MAJOR 2112 #endif -#define MODULE_MAGIC_NUMBER_MINOR 6 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 0 /* 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/scoreboard.h Index: scoreboard.h === RCS file: /home/cvs/apache-1.3/src/include/scoreboard.h,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- scoreboard.h 1999/10/21 20:44:23 1.48 +++ scoreboard.h 2000/01/12 01:13:09 1.49 @@ -160,6 +160,7 @@ char request[64];/* We just want an idea... */ server_rec *vhostrec;/* What virtual host is being accessed? */ /* SEE ABOVE FOR SAFE USAGE! */ +char vhostname[32]; /* more useful status with mass vhosting */ } short_score; typedef struct { 1.487 +2 -0 apache-1.3/src/main/http_main.c Index: http_main.c === RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.486 retrieving revision 1.487 diff -u -r1.486 -r1.487 --- http_main.c 2000/01/01 17:07:34 1.486 +++ http_main.c 2000/01/12 01:13:23 1.487 @@ -2256,6 +2256,8 @@ sizeof(ss-request)); } ss-vhostrec = r-server; + ap_cpystrn(ss-vhostname, ap_get_server_name(r), +sizeof(ss-vhostname)); } } if (status == SERVER_STARTING r == NULL) { 1.109 +2 -2 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.108 retrieving revision 1.109 diff -u -r1.108 -r1.109 --- mod_status.c 1999/10/21 20:45:42 1.108 +++ mod_status.c 2000/01/12 01:13:34 1.109 @@ -599,7 +599,7 @@ ap_rprintf(r, i%s {%s}/i b[%s]/bbr\n\n, score_record.client, ap_escape_html(r-pool, score_record.request), - vhost ? vhost-server_hostname : (unavailable)); + vhost ? score_record.vhostname : (unavailable)); } else { /* !no_table_report */ if (score_record.status == SERVER_DEAD) @@ -672,7 +672,7 @@ ap_rprintf(r, td%std nowrap%std nowrap%s/tr\n\n, score_record.client, - vhost ? vhost-server_hostname : (unavailable), + vhost ? score_record.vhostname : (unavailable), ap_escape_html(r-pool, score_record.request)); } /* no_table_report */ } /* !short_report */
cvs commit: apache-1.3/src/modules/standard mod_status.c
fanf00/01/12 07:55:04 Modified:htdocs/manual/mod core.html src CHANGES src/include ap_mmn.h scoreboard.h src/main http_main.c src/modules/standard mod_status.c Log: Revert the scoreboard change because Jim doesn't like it. Revision ChangesPath 1.161 +1 -1 apache-1.3/htdocs/manual/mod/core.html Index: core.html === RCS file: /home/cvs/apache-1.3/htdocs/manual/mod/core.html,v retrieving revision 1.160 retrieving revision 1.161 diff -u -r1.160 -r1.161 --- core.html 2000/01/12 01:18:07 1.160 +++ core.html 2000/01/12 15:54:46 1.161 @@ -3146,7 +3146,7 @@ that the client connected to in order to work out self-referential URLs. This can have adverse performance implications, especially if you use CODE%V/CODE in a A HREF=mod_log_config.html#customlogCustomLog/A -directive or have A HREF=mod_status.htmlExtendedStatus/A on. +directive. PSTRONGWarning:/STRONG if CGIs make assumptions about the values of CODESERVER_NAME/CODE they may be broken by this option. The client 1.1497+0 -5 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1496 retrieving revision 1.1497 diff -u -r1.1496 -r1.1497 --- CHANGES 2000/01/12 03:38:14 1.1496 +++ CHANGES 2000/01/12 15:54:51 1.1497 @@ -5,11 +5,6 @@ another 16 seconds beyond the initial SIGTERM waiting period. [Ed Korthof] - *) Revert to the 1.3.3 way of getting the server name from the - scoreboard, with a modification to make it respect the - UseCanonicalName setting. This makes things work better with - mass vhosting setups. [Cliff Woolley [EMAIL PROTECTED]] - *) Add --suexec-umask option to configure, and severity levels to suexec log messages. Also clarify a couple of those messages, which were perhaps a bit too cryptic. [Ken Coar] PR#4178 1.43 +2 -4 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.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- ap_mmn.h 2000/01/12 01:13:06 1.42 +++ ap_mmn.h 2000/01/12 15:54:56 1.43 @@ -226,16 +226,14 @@ *ap_base64encode_len(), ap_base64decode(), *ap_base64decode_binary(), ap_base64decode_len(), *ap_pbase64decode(), ap_pbase64encode() - * (1.3.10-dev) - * 2112 - put the vhostname back into the scoreboard itself */ #define MODULE_MAGIC_COOKIE 0x41503133UL /* AP13 */ #ifndef MODULE_MAGIC_NUMBER_MAJOR -#define MODULE_MAGIC_NUMBER_MAJOR 2112 +#define MODULE_MAGIC_NUMBER_MAJOR 19990320 #endif -#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 6 /* 0...n */ #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR/* backward compat */ /* Useful for testing for features. */ 1.50 +0 -1 apache-1.3/src/include/scoreboard.h Index: scoreboard.h === RCS file: /home/cvs/apache-1.3/src/include/scoreboard.h,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- scoreboard.h 2000/01/12 01:13:09 1.49 +++ scoreboard.h 2000/01/12 15:54:56 1.50 @@ -160,7 +160,6 @@ char request[64];/* We just want an idea... */ server_rec *vhostrec;/* What virtual host is being accessed? */ /* SEE ABOVE FOR SAFE USAGE! */ -char vhostname[32]; /* more useful status with mass vhosting */ } short_score; typedef struct { 1.489 +0 -2 apache-1.3/src/main/http_main.c Index: http_main.c === RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.488 retrieving revision 1.489 diff -u -r1.488 -r1.489 --- http_main.c 2000/01/12 03:38:19 1.488 +++ http_main.c 2000/01/12 15:54:58 1.489 @@ -2256,8 +2256,6 @@ sizeof(ss-request)); } ss-vhostrec = r-server; - ap_cpystrn(ss-vhostname, ap_get_server_name(r), -sizeof(ss-vhostname)); } } if (status == SERVER_STARTING r == NULL) { 1.110 +2 -2 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c
cvs commit: apache-1.3/src/modules/standard mod_status.c
jim 99/02/02 14:09:49 Modified:src/modules/standard mod_status.c Log: Clear up some descriptions Revision ChangesPath 1.106 +3 -3 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.105 retrieving revision 1.106 diff -u -r1.105 -r1.106 --- mod_status.c 1999/01/15 17:48:53 1.105 +++ mod_status.c 1999/02/02 22:09:48 1.106 @@ -353,7 +353,7 @@ ap_rvputs(r, Restart Time: , ap_ht_time(r-pool, ap_restart_time, DEFAULT_TIME_FORMAT, 0), br\n, NULL); - ap_rprintf(r, Server Generation: %d br\n, (int) ap_my_generation); + ap_rprintf(r, Parent Server Generation: %d br\n, (int) ap_my_generation); ap_rputs(Server uptime: , r); show_time(r, up_time); ap_rputs(br\n, r); @@ -682,7 +682,7 @@ ap_rputs(/table\n \ hr \ table\n \ -trthSrvtdServer number - generation\n \ +trthSrvtdChild Server number - generation\n \ trthPIDtdOS process ID\n \ trthAcctdNumber of accesses this connection / this child / this slot\n \ trthMtdMode of operation\n \ @@ -696,7 +696,7 @@ ap_rputs(/table\n \ hr \ table\n \ -trthSrvtdServer number\n \ +trthSrvtdChild Server number - generation\n \ trthPIDtdOS process ID\n \ trthAcctdNumber of accesses this connection / this child / this slot\n \ trthMtdMode of operation\n \
cvs commit: apache-1.3/src/modules/standard mod_status.c
jim 99/01/15 09:48:54 Modified:src CHANGES src/modules/standard mod_status.c Log: Some mod_status changes... It's useful to know both the value of ap_my_generation as well as the generation of each httpd child process, so we print this out now. Also, '?notable' didn't print out the vhost info, which didn't make sense to me :) Revision ChangesPath 1.1213+4 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1212 retrieving revision 1.1213 diff -u -r1.1212 -r1.1213 --- CHANGES 1999/01/12 15:46:56 1.1212 +++ CHANGES 1999/01/15 17:48:44 1.1213 @@ -1,5 +1,9 @@ Changes with Apache 1.3.5 + *) The status module now prints out both the main server generation as + well as the generation of each process. Also, the vhost info is + printed with '?notable'. [Jim Jagielski] + *) Move src/main/md5c.c to src/ap/ap_md5c.c; it's httpd-neutral and this makes its functions available to things in src/support. [Ken Coar] 1.105 +24 -12apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.104 retrieving revision 1.105 diff -u -r1.104 -r1.105 --- mod_status.c 1999/01/01 19:05:14 1.104 +++ mod_status.c 1999/01/15 17:48:53 1.105 @@ -353,6 +353,7 @@ ap_rvputs(r, Restart Time: , ap_ht_time(r-pool, ap_restart_time, DEFAULT_TIME_FORMAT, 0), br\n, NULL); + ap_rprintf(r, Server Generation: %d br\n, (int) ap_my_generation); ap_rputs(Server uptime: , r); show_time(r, up_time); ap_rputs(br\n, r); @@ -527,11 +528,16 @@ if (!short_report) { if (no_table_report) { if (score_record.status == SERVER_DEAD) - ap_rprintf(r, bServer %d/b (-): %d|%lu|%lu [, - i, (int) conn_lres, my_lres, lres); + ap_rprintf(r, + bServer %d-%d/b (-): %d|%lu|%lu [, + i, (int) ps_record.generation, (int) conn_lres, + my_lres, lres); else - ap_rprintf(r, bServer %d/b (%d): %d|%lu|%lu [, - i, (int) ps_record.pid, (int) conn_lres, my_lres, lres); + ap_rprintf(r, + bServer %d-%d/b (%d): %d|%lu|%lu [, + i, (int) ps_record.generation, + (int) ps_record.pid, + (int) conn_lres, my_lres, lres); switch (score_record.status) { case SERVER_READY: @@ -588,17 +594,23 @@ ap_rputs(|, r); format_byte_out(r, bytes); ap_rputs()\n, r); - ap_rprintf(r, i%s {%s}/ibr\n\n, - score_record.client, - ap_escape_html(r-pool, score_record.request)); + ap_rprintf(r, i%s {%s}/i b[%s]/bbr\n\n, + score_record.client, + ap_escape_html(r-pool, score_record.request), + vhost ? vhost-server_hostname : (unavailable)); } else { /* !no_table_report */ if (score_record.status == SERVER_DEAD) - ap_rprintf(r, trtdb%d/btd-td%d/%lu/%lu, - i, (int) conn_lres, my_lres, lres); + ap_rprintf(r, + trtdb%d-%d/btd-td%d/%lu/%lu, + i, (int) ps_record.generation, + (int) conn_lres, my_lres, lres); else - ap_rprintf(r, trtdb%d/btd%dtd%d/%lu/%lu, - i, (int) ps_record.pid, (int) conn_lres, my_lres, lres); + ap_rprintf(r, + trtdb%d-%d/btd%dtd%d/%lu/%lu, + i, (int) ps_record.generation, + (int) ps_record.pid, (int) conn_lres, + my_lres, lres); switch (score_record.status) { case SERVER_READY: @@ -670,7 +682,7 @@ ap_rputs(/table\n \ hr \ table\n \ -trthSrvtdServer number\n \ +trthSrvtdServer number - generation\n \ trthPIDtdOS process ID\n \
cvs commit: apache-1.3/src/modules/standard mod_status.c
dgaudet 98/12/04 11:12:18 Modified:src/include ap_mmn.h scoreboard.h src/main http_main.c src/modules/standard mod_status.c Log: - Jim's fix to the vhostrec problem wasn't sufficient for all cases... implement the full generation-based solution I proposed. - Deal with generation rollover a little more robustly. Still not perfect. Revision ChangesPath 1.12 +5 -2 apache-1.3/src/include/ap_mmn.h Index: ap_mmn.h === RCS file: /export/home/cvs/apache-1.3/src/include/ap_mmn.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- ap_mmn.h 1998/11/20 21:17:25 1.11 +++ ap_mmn.h 1998/12/04 19:12:15 1.12 @@ -184,11 +184,14 @@ * 19981108 (1.3.4-dev) - added ap_method_number_of() * - changed value of M_INVALID and added WebDAV methods * 19981108.1 - ap_exists_config_define() is now public (minor bump) - * + * 19981204 - scoreboard changes -- added generation, changed + *exit_generation to running_generation. Somewhere + *earlier vhostrec was added, but it's only safe to use + *as of this rev. See scoreboard.h for documentation. */ #ifndef MODULE_MAGIC_NUMBER_MAJOR -#define MODULE_MAGIC_NUMBER_MAJOR 19981108 +#define MODULE_MAGIC_NUMBER_MAJOR 19981204 #endif #define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */ #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR/* backward compat */ 1.44 +29 -2 apache-1.3/src/include/scoreboard.h Index: scoreboard.h === RCS file: /export/home/cvs/apache-1.3/src/include/scoreboard.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- scoreboard.h 1998/11/06 22:42:41 1.43 +++ scoreboard.h 1998/12/04 19:12:15 1.44 @@ -106,6 +106,29 @@ */ typedef unsigned vtime_t; +/* Type used for generation indicies. Startup and every restart cause a + * new generation of children to be spawned. Children within the same + * generation share the same configuration information -- pointers to stuff + * created at config time in the parent are valid across children. For + * example, the vhostrec pointer in the scoreboard below is valid in all + * children of the same generation. + * + * The safe way to access the vhost pointer is like this: + * + * short_score *ss = pointer to whichver slot is interesting; + * parent_score *ps = pointer to whichver slot is interesting; + * server_rec *vh = ss-vhostrec; + * + * if (ps-generation != ap_my_generation) { + * vh = NULL; + * } + * + * then if vh is not NULL it's valid in this child. + * + * This avoids various race conditions around restarts. + */ +typedef int ap_generation_t; + /* stuff which the children generally write, and the parent mainly reads */ typedef struct { #ifdef OPTIMIZE_TIMEOUTS @@ -135,11 +158,12 @@ char client[32]; /* Keep 'em small... */ char request[64];/* We just want an idea... */ server_rec *vhostrec;/* What virtual host is being accessed? */ +/* SEE ABOVE FOR SAFE USAGE! */ } short_score; typedef struct { -int exit_generation; /* Set by the main process if a graceful -restart is required */ +ap_generation_t running_generation; /* the generation of children which + * should still be serving requests. */ } global_score; /* stuff which the parent generally writes and the children rarely read */ @@ -149,6 +173,7 @@ time_t last_rtime; /* time(0) of the last change */ vtime_t last_vtime; /* the last vtime the parent has seen */ #endif +ap_generation_t generation; /* generation of this child */ } parent_score; typedef struct { @@ -163,6 +188,8 @@ API_EXPORT(int) ap_exists_scoreboard_image(void); API_VAR_EXPORT extern scoreboard *ap_scoreboard_image; + +API_VAR_EXPORT extern ap_generation_t ap_my_generation; /* for time_process_request() in http_main.c */ #define START_PREQUEST 1 1.408 +56 -60apache-1.3/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.407 retrieving revision 1.408 diff -u -r1.407 -r1.408 --- http_main.c 1998/12/03 01:07:54 1.407 +++ http_main.c 1998/12/04 19:12:16 1.408 @@ -1531,12 +1531,6 @@ * We begin with routines which deal with the file
cvs commit: apache-1.3/src/modules/standard mod_status.c
jim 98/12/02 17:08:02 Modified:src/main http_main.c src/modules/standard mod_status.c Log: During Graceful restarts, the value of vhostrec is bogus. To get around this, we reset this pointer to NULL during these. Revision ChangesPath 1.407 +44 -31apache-1.3/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.406 retrieving revision 1.407 diff -u -r1.406 -r1.407 --- http_main.c 1998/12/02 00:00:06 1.406 +++ http_main.c 1998/12/03 01:07:54 1.407 @@ -1531,6 +1531,12 @@ * We begin with routines which deal with the file itself... */ +/* volatile just in case */ +static int volatile shutdown_pending; +static int volatile restart_pending; +static int volatile is_graceful; +static int volatile generation; + #ifdef MULTITHREAD /* * In the multithreaded mode, have multiple threads - not multiple @@ -1542,8 +1548,14 @@ static void reinit_scoreboard(pool *p) { ap_assert(!ap_scoreboard_image); -ap_scoreboard_image = (scoreboard *) malloc(SCOREBOARD_SIZE); -memset(ap_scoreboard_image, 0, SCOREBOARD_SIZE); +if (is_graceful) { +int i; +for (i = 0; i HARD_SERVER_LIMIT; i++) +ap_scoreboard_image-servers[i].vhostrec = NULL; +} else { +ap_scoreboard_image = (scoreboard *) malloc(SCOREBOARD_SIZE); +memset(ap_scoreboard_image, 0, SCOREBOARD_SIZE); +} } void cleanup_scoreboard(void) @@ -1950,32 +1962,41 @@ /* Called by parent process */ static void reinit_scoreboard(pool *p) { -int exit_gen = 0; -if (ap_scoreboard_image) - exit_gen = ap_scoreboard_image-global.exit_generation; +if (is_graceful ap_scoreboard_image) { +int i; +for (i = 0; i HARD_SERVER_LIMIT; i++) +ap_scoreboard_image-servers[i].vhostrec = NULL; +#ifdef SCOREBOARD_FILE +force_write(scoreboard_fd, ap_scoreboard_image, sizeof(*ap_scoreboard_image)); +#endif +} else { +int exit_gen = 0; +if (ap_scoreboard_image) +exit_gen = ap_scoreboard_image-global.exit_generation; #ifndef SCOREBOARD_FILE -if (ap_scoreboard_image == NULL) { - setup_shared_mem(p); -} -memset(ap_scoreboard_image, 0, SCOREBOARD_SIZE); -ap_scoreboard_image-global.exit_generation = exit_gen; +if (ap_scoreboard_image == NULL) { +setup_shared_mem(p); +} +memset(ap_scoreboard_image, 0, SCOREBOARD_SIZE); +ap_scoreboard_image-global.exit_generation = exit_gen; #else -ap_scoreboard_image = _scoreboard_image; -ap_scoreboard_fname = ap_server_root_relative(p, ap_scoreboard_fname); +ap_scoreboard_image = _scoreboard_image; +ap_scoreboard_fname = ap_server_root_relative(p, ap_scoreboard_fname); -scoreboard_fd = ap_popenf(p, ap_scoreboard_fname, O_CREAT | O_BINARY | O_RDWR, 0644); -if (scoreboard_fd == -1) { - perror(ap_scoreboard_fname); - fprintf(stderr, Cannot open scoreboard file:\n); - exit(APEXIT_INIT); -} -ap_register_cleanup(p, NULL, cleanup_scoreboard_file, ap_null_cleanup); +scoreboard_fd = ap_popenf(p, ap_scoreboard_fname, O_CREAT | O_BINARY | O_RDWR, 0644); +if (scoreboard_fd == -1) { +perror(ap_scoreboard_fname); +fprintf(stderr, Cannot open scoreboard file:\n); +exit(APEXIT_INIT); +} +ap_register_cleanup(p, NULL, cleanup_scoreboard_file, ap_null_cleanup); -memset((char *) ap_scoreboard_image, 0, sizeof(*ap_scoreboard_image)); -ap_scoreboard_image-global.exit_generation = exit_gen; -force_write(scoreboard_fd, ap_scoreboard_image, sizeof(*ap_scoreboard_image)); +memset((char *) ap_scoreboard_image, 0, sizeof(*ap_scoreboard_image)); +ap_scoreboard_image-global.exit_generation = exit_gen; +force_write(scoreboard_fd, ap_scoreboard_image, sizeof(*ap_scoreboard_image)); #endif +} } /* Routines called to deal with the scoreboard image @@ -2551,12 +2572,6 @@ deferred_die = 1; } -/* volatile just in case */ -static int volatile shutdown_pending; -static int volatile restart_pending; -static int volatile is_graceful; -static int volatile generation; - #ifdef WIN32 /* * Signalling Apache on NT. @@ -4247,9 +4262,7 @@ ap_init_modules(pconf, server_conf); version_locked++; /* no more changes to server_version */ SAFE_ACCEPT(accept_mutex_init(pconf)); - if (!is_graceful) { - reinit_scoreboard(pconf); - } + reinit_scoreboard(pconf); #ifdef SCOREBOARD_FILE else {
cvs commit: apache-1.3/src/modules/standard mod_status.c
jim 98/12/03 06:38:06 Modified:src/modules/standard mod_status.c Log: Reduce a race condition... We doubly protect against a bogus vhostrec pointer. The first test sets the pointer correctly no matter what the value of vhostrec. When it's time to print out, we check again. If the previous value was NULL, then no matter what, NULL will be used for the hostname, even if the new vhostrec was changed between the 2 tests to be valid. If the previous was OK, then the vhost value will only be printed if it's still OK. There's still a window between this final test and when the actual string is printed, since it's possible (maybe) that right after the test, the vhostrec is no longer valid, but assuming that the memory hasn't been released or overwritten, we still point to a good string. Revision ChangesPath 1.102 +6 -2 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.101 retrieving revision 1.102 diff -u -r1.101 -r1.102 --- mod_status.c 1998/12/03 01:08:00 1.101 +++ mod_status.c 1998/12/03 14:38:05 1.102 @@ -254,6 +254,7 @@ char stat_buffer[HARD_SERVER_LIMIT]; int pid_buffer[HARD_SERVER_LIMIT]; clock_t tu, ts, tcu, tcs; +char *vhost; tu = ts = tcu = tcs = 0; @@ -308,6 +309,10 @@ for (i = 0; i HARD_SERVER_LIMIT; ++i) { score_record = ap_scoreboard_image-servers[i]; ps_record = ap_scoreboard_image-parent[i]; + if (score_record.vhostrec) + vhost = score_record.vhostrec-server_hostname; + else + vhost = NULL; res = score_record.status; stat_buffer[i] = status_flags[res]; pid_buffer[i] = (int) ps_record.pid; @@ -653,8 +658,7 @@ ap_rprintf(r, td%std nowrap%std nowrap%s/tr\n\n, score_record.client, - (score_record.vhostrec ? - score_record.vhostrec-server_hostname : NULL), + (score_record.vhostrec ? vhost : NULL), ap_escape_html(r-pool, score_record.request)); } /* no_table_report */ } /* !short_report */
cvs commit: apache-1.3/src/modules/standard mod_status.c
jim 98/10/28 05:02:40 Modified:.STATUS src CHANGES src/include scoreboard.h src/main http_main.c src/modules/standard mod_status.c Log: Submitted by: Harrie Hazewinkel [EMAIL PROTECTED] Reviewed by: Ralf S. Engelschall, Dean Gaudet, Jim Jagielski Remove the vhost name string copy in the scoreboard information. Instead of copying the string, copy a pointer to the server_rec for this vhost and request. Revision ChangesPath 1.524 +0 -4 apache-1.3/STATUS Index: STATUS === RCS file: /export/home/cvs/apache-1.3/STATUS,v retrieving revision 1.523 retrieving revision 1.524 diff -u -r1.523 -r1.524 --- STATUS1998/10/28 01:06:08 1.523 +++ STATUS1998/10/28 13:02:35 1.524 @@ -74,10 +74,6 @@ Message-ID: [EMAIL PROTECTED] Status: -* Harrie Hazewinkle's PATCH scoreboard to include server_rec * - Message-ID: [EMAIL PROTECTED] - Status: Ralf +1, Dean +1, Jim +1 (with variable name change) - * Ron Record's patch to port Apache to UnixWare 7 (forwarded by Randy). Message-ID: [EMAIL PROTECTED] 1.1126+5 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1125 retrieving revision 1.1126 diff -u -r1.1125 -r1.1126 --- CHANGES 1998/10/27 10:20:00 1.1125 +++ CHANGES 1998/10/28 13:02:35 1.1126 @@ -1,5 +1,10 @@ Changes with Apache 1.3.4 + *) Add the actual server_rec structure of the specific Vhost to the + scoreboard file and avoid a string copy (as well as allow some + further future enhancements). [Harrie Hazewinkel + [EMAIL PROTECTED]] + *) Add APACI --permute-module=foo:bar option which can be used to on-the-fly/batch permute the order of two modules (mod_foo and mod_bar) in the Configuration[.apaci] file. Two special and important variants are 1.42 +1 -1 apache-1.3/src/include/scoreboard.h Index: scoreboard.h === RCS file: /export/home/cvs/apache-1.3/src/include/scoreboard.h,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- scoreboard.h 1998/08/11 00:09:43 1.41 +++ scoreboard.h 1998/10/28 13:02:37 1.42 @@ -130,7 +130,7 @@ #endif char client[32]; /* Keep 'em small... */ char request[64];/* We just want an idea... */ -char vhost[32]; /* What virtual host is being accessed? */ +server_rec *vhostrec;/* What virtual host is being accessed? */ } short_score; typedef struct { 1.403 +1 -1 apache-1.3/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.402 retrieving revision 1.403 diff -u -r1.402 -r1.403 --- http_main.c 1998/10/26 21:27:40 1.402 +++ http_main.c 1998/10/28 13:02:38 1.403 @@ -2055,7 +2055,7 @@ r-assbackwards ? NULL : , r-protocol, NULL), sizeof(ss-request)); } - ap_cpystrn(ss-vhost, r-server-server_hostname, sizeof(ss-vhost)); + ss-vhostrec = r-server; } } put_scoreboard_info(child_num, ss); 1.100 +2 -1 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.99 retrieving revision 1.100 diff -u -r1.99 -r1.100 --- mod_status.c 1998/10/03 15:24:51 1.99 +++ mod_status.c 1998/10/28 13:02:39 1.100 @@ -652,7 +652,8 @@ else ap_rprintf(r, td%std nowrap%std nowrap%s/tr\n\n, - score_record.client, score_record.vhost, + score_record.client, + score_record.vhostrec-server_hostname, ap_escape_html(r-pool, score_record.request)); } /* no_table_report */ } /* !short_report */
cvs commit: apache-1.3/src/modules/standard mod_status.c
rse 98/10/03 08:24:51 Modified:src CHANGES src/modules/standard mod_status.c Log: Fallback from sysconf-based to plain HZ-based `ticks per second' calculation in mod_status for all systems which don't have POSIX sysconf() (like UTS 2.1) and not only for the NEXT platform. Submitted by: Dave Dykstra [EMAIL PROTECTED] Reviewed by: Ralf S. Engelschall PR: 3055 Revision ChangesPath 1.1095+5 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1094 retrieving revision 1.1095 diff -u -r1.1094 -r1.1095 --- CHANGES 1998/10/03 15:11:50 1.1094 +++ CHANGES 1998/10/03 15:24:48 1.1095 @@ -1,4 +1,9 @@ Changes with Apache 1.3.3 + + *) Fallback from sysconf-based to plain HZ-based `ticks per second' + calculation in mod_status for all systems which don't have POSIX + sysconf() (like UTS 2.1) and not only for the NEXT platform. + [Dave Dykstra [EMAIL PROTECTED]] PR#3055 *) Fix `require ...' directive parsing in mod_auth, mod_auth_dbm and mod_auth_db by using ap_getword_white() (which uses ap_isspace()) instead of 1.99 +5 -3 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.98 retrieving revision 1.99 diff -u -r1.98 -r1.99 --- mod_status.c 1998/08/12 10:23:46 1.98 +++ mod_status.c 1998/10/03 15:24:51 1.99 @@ -240,10 +240,12 @@ unsigned long bcount = 0; unsigned long kbcount = 0; long req_time; -#if defined(NEXT) -float tick = HZ; -#elif !defined(NO_TIMES) +#ifndef NO_TIMES +#ifdef _SC_CLK_TCK float tick = sysconf(_SC_CLK_TCK); +#else +float tick = HZ; +#endif #endif int short_report = 0; int no_table_report = 0;
cvs commit: apache-1.3/src/modules/standard mod_status.c
martin 98/08/12 03:23:47 Modified:src/modules/standard mod_status.c Log: Add missing space Revision ChangesPath 1.98 +1 -1 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.97 retrieving revision 1.98 diff -u -u -r1.97 -r1.98 --- mod_status.c 1998/08/12 00:13:33 1.97 +++ mod_status.c 1998/08/12 10:23:46 1.98 @@ -692,7 +692,7 @@ } else { -ap_rputs(hrTo obtain a full report with current status information, r); +ap_rputs(hrTo obtain a full report with current status information , r); ap_rputs(you need to use the codeExtendedStatus On/code directive. \n, r); }
cvs commit: apache-1.3/src/modules/standard mod_status.c
jim 98/08/11 08:37:54 Modified:htdocs/manual/mod core.html directives.html mod_status.html src/main http_core.c src/modules/standard mod_status.c Log: Move the ExtendedStatus option to mod_status Revision ChangesPath 1.130 +0 -35 apache-1.3/htdocs/manual/mod/core.html Index: core.html === RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/core.html,v retrieving revision 1.129 retrieving revision 1.130 diff -u -r1.129 -r1.130 --- core.html 1998/08/11 00:24:27 1.129 +++ core.html 1998/08/11 15:37:49 1.130 @@ -38,7 +38,6 @@ LIA HREF=#documentrootDocumentRoot/A LIA HREF=#errordocumentErrorDocument/A LIA HREF=#errorlogErrorLog/A -LIA HREF=#extendedstatusExtendedStatus/A LIA HREF=#fileslt;Filesgt;/A LIA HREF=#filesmatchlt;FilesMatchgt;/A LIA HREF=#groupGroup/A @@ -845,40 +844,6 @@ PSTRONGSee also:/STRONG A HREF=#loglevelLogLevel/A PHR - -H2A NAME=extendedstatusExtendedStatus directive/A/H2 -!--%plaintext lt;?INDEX {\tt ExtendedStatus} directivegt; -- -A - HREF=directive-dict.html#Syntax - REL=Help -STRONGSyntax:/STRONG/A ExtendedStatus EMOn|Off/EMBR -A - HREF=directive-dict.html#Default - REL=Help -STRONGDefault:/STRONG/A CODEExtendedStatus Off/CODEBR -A - HREF=directive-dict.html#Context - REL=Help -STRONGContext:/STRONG/A server config BR -A - HREF=directive-dict.html#Status - REL=Help -STRONGStatus:/STRONG/A coreBR -A - HREF=directive-dict.html#Compatibility - REL=Help -STRONGCompatibility:/STRONG/A ExtendedStatus is only available - in Apache 1.3 and later - -P -This directive controls whether the server keeps track of extended -status information for each request. This is only useful if the status module -is enabled on the server. -/P -P -This setting applies to the entire server, and cannot be enabled or -disabled on a virtualhost-by-virtualhost basis. -/PHR H2A NAME=fileslt;Filesgt; directive/A/H2 A 1.49 +1 -1 apache-1.3/htdocs/manual/mod/directives.html Index: directives.html === RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/directives.html,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- directives.html 1998/08/11 00:24:28 1.48 +++ directives.html 1998/08/11 15:37:50 1.49 @@ -100,7 +100,7 @@ LIA HREF=mod_expires.html#expiresactiveExpiresActive/A LIA HREF=mod_expires.html#expiresbytypeExpiresByType/A LIA HREF=mod_expires.html#expiresdefaultExpiresDefault/A -LIA HREF=core.html#extendedstatusExtendedStatus/A +LIA HREF=mod_status.html#extendedstatusExtendedStatus/A LIA HREF=mod_autoindex.html#fancyindexingFancyIndexing/A LIA HREF=core.html#fileslt;Filesgt;/A LIA HREF=core.html#filesmatchlt;FilesMatchgt;/A 1.13 +38 -15apache-1.3/htdocs/manual/mod/mod_status.html Index: mod_status.html === RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/mod_status.html,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- mod_status.html 1998/08/11 00:24:28 1.12 +++ mod_status.html 1998/08/11 15:37:50 1.13 @@ -47,6 +47,44 @@ the instrumentation required for obtaining these statistics does not exist within standard Apache. +H2A NAME=extendedstatusExtendedStatus directive/A/H2 +!--%plaintext lt;?INDEX {\tt ExtendedStatus} directivegt; -- +A + HREF=directive-dict.html#Syntax + REL=Help +STRONGSyntax:/STRONG/A ExtendedStatus EMOn|Off/EMBR +A + HREF=directive-dict.html#Default + REL=Help +STRONGDefault:/STRONG/A CODEExtendedStatus Off/CODEBR +A + HREF=directive-dict.html#Context + REL=Help +STRONGContext:/STRONG/A server config BR +A + HREF=directive-dict.html#Status + REL=Help +STRONGStatus:/STRONG/A BaseBR + A + HREF=directive-dict.html#Module + REL=Help + STRONGModule:/STRONG/A mod_statusBR +A + HREF=directive-dict.html#Compatibility + REL=Help +STRONGCompatibility:/STRONG/A ExtendedStatus is only available + in Apache 1.3 and later + +P +This directive controls whether the server keeps track of extended +status information for each request. This is only useful if the status module +is enabled on the server. +/P +P +This setting applies to the entire server, and cannot be enabled or +disabled on a virtualhost-by-virtualhost basis. +/P + H2Enabling Status Support/H2 To enable status reports only for browsers from the foo.com @@ -78,21 +116,6 @@ page CODEhttp://your.server.name/server-status?auto/CODE. This is useful when automatically run, see the Perl program in the CODE/support/CODE directory of Apache,
cvs commit: apache-1.3/src/modules/standard mod_status.c
jim 98/08/11 13:28:27 Modified:src CHANGES src/main http_main.c src/modules/standard mod_status.c Log: Following rude orders Revision ChangesPath 1.1020+1 -1 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1019 retrieving revision 1.1020 diff -u -r1.1019 -r1.1020 --- CHANGES 1998/08/11 18:08:25 1.1019 +++ CHANGES 1998/08/11 20:28:17 1.1020 @@ -1,7 +1,7 @@ Changes with Apache 1.3.2 *) When READing a request in ExtendedStatus mode, the old - vhost, request and client information is cleared out. + vhost, request and client information is not displayed. [Jim Jagielski] *) STATUS is no longer available. Full status information now 1.384 +0 -7 apache-1.3/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.383 retrieving revision 1.384 diff -u -r1.383 -r1.384 --- http_main.c 1998/08/11 18:08:27 1.383 +++ http_main.c 1998/08/11 20:28:22 1.384 @@ -1993,13 +1993,6 @@ sizeof(ss-request)); } ap_cpystrn(ss-vhost, r-server-server_hostname, sizeof(ss-vhost)); - } else if (status == SERVER_BUSY_READ) { - /* - * When reading a new request, we don't want to show the old - * info since that's confusing... so NULL it out quickly since - * we want to hurry up and read the request. - */ - *ss-vhost = *ss-request = *ss-client = '\0'; } } put_scoreboard_info(child_num, ss); 1.95 +8 -3 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -r1.94 -r1.95 --- mod_status.c 1998/08/11 15:37:53 1.94 +++ mod_status.c 1998/08/11 20:28:26 1.95 @@ -636,9 +636,14 @@ ap_rprintf(r, td%-1.1ftd%-2.2ftd%-2.2f\n, (float) conn_bytes / KBYTE, (float) my_bytes / MBYTE, (float) bytes / MBYTE); - ap_rprintf(r, td%std nowrap%std nowrap%s/tr\n\n, - score_record.client, score_record.vhost, - ap_escape_html(r-pool, score_record.request)); + if (score_record.status == SERVER_BUSY_READ) + ap_rprintf(r, + td?td nowrap?td nowrap..reading.. /tr\n\n); + else + ap_rprintf(r, + td%std nowrap%std nowrap%s/tr\n\n, + score_record.client, score_record.vhost, + ap_escape_html(r-pool, score_record.request)); } /* no_table_report */ } /* !short_report */ } /* if (active child) */
cvs commit: apache-1.3/src/modules/standard mod_status.c
jim 98/08/11 13:40:29 Modified:src/modules/standard mod_status.c Log: Minor renaming... Client seems clearer than Host when refering to the remote side Revision ChangesPath 1.96 +2 -2 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -r1.95 -r1.96 --- mod_status.c 1998/08/11 20:28:26 1.95 +++ mod_status.c 1998/08/11 20:40:28 1.96 @@ -468,9 +468,9 @@ else #ifdef NO_TIMES /* Allow for OS/2 not having CPU stats */ - ap_rputs(p\n\ntable border=0trthSrvthPIDthAccthM\nthSSthReqthConnthChildthSlotthHostthVHostthRequest/tr\n\n, r); + ap_rputs(p\n\ntable border=0trthSrvthPIDthAccthM\nthSSthReqthConnthChildthSlotthClientthVHostthRequest/tr\n\n, r); #else - ap_rputs(p\n\ntable border=0trthSrvthPIDthAccthMthCPU\nthSSthReqthConnthChildthSlotthHostthVHostthRequest/tr\n\n, r); + ap_rputs(p\n\ntable border=0trthSrvthPIDthAccthMthCPU\nthSSthReqthConnthChildthSlotthClientthVHostthRequest/tr\n\n, r); #endif }
cvs commit: apache-1.3/src/modules/standard mod_status.c
jim 98/08/06 10:42:52 Modified:src CHANGES src/modules/standard mod_status.c Log: Hmmm... we have access to the subprocesses pids, let's use them. Now we can tell which process is in which state even without full STATUS Revision ChangesPath 1.1005+3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1004 retrieving revision 1.1005 diff -u -r1.1004 -r1.1005 --- CHANGES 1998/08/06 17:30:18 1.1004 +++ CHANGES 1998/08/06 17:42:49 1.1005 @@ -1,5 +1,8 @@ Changes with Apache 1.3.2 + *) The 'status' module will now show the process pid's and their + state even without full STATUS accounting. [Jim Jagielski] + *) Restore the client IP address to the error log messages, this was lost during the transition from 1.2 to 1.3. Add a new function ap_log_rerror() which takes a request_rec * and 1.92 +11 -0 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.91 retrieving revision 1.92 diff -u -r1.91 -r1.92 --- mod_status.c 1998/08/06 17:31:14 1.91 +++ mod_status.c 1998/08/06 17:42:51 1.92 @@ -241,6 +241,7 @@ short_score score_record; parent_score ps_record; char stat_buffer[HARD_SERVER_LIMIT]; +int pid_buffer[HARD_SERVER_LIMIT]; clock_t tu, ts, tcu, tcs; tu = ts = tcu = tcs = 0; @@ -296,6 +297,7 @@ ps_record = ap_scoreboard_image-parent[i]; res = score_record.status; stat_buffer[i] = status_flags[res]; + pid_buffer[i] = (int) ps_record.pid; if (res == SERVER_READY) ready++; else if (res != SERVER_DEAD) @@ -428,6 +430,15 @@ ap_rputs(\BcodeL/code/B\ Logging, \n, r); ap_rputs(\BcodeG/code/B\ Gracefully finishing, \n, r); ap_rputs(\Bcode./code/B\ Open slot with no current processP\n, r); + ap_rputs(P\n, r); + ap_rputs(PID Key: br\n, r); + ap_rputs(UL\n, r); + for (i = 0; i HARD_SERVER_LIMIT; ++i) { + if (stat_buffer[i] != '.') + ap_rprintf(r, LI%d in state: %c BR\n, pid_buffer[i], + stat_buffer[i]); + } + ap_rputs(/UL\n, r); } #if defined(STATUS)
cvs commit: apache-1.3/src/modules/standard mod_status.c
dgaudet 98/06/15 09:46:14 Modified:src CHANGES src/modules/standard mod_status.c Log: clean up a warning in mod_status for OS/2 Submitted by: Brian Havard Revision ChangesPath 1.916 +2 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.915 retrieving revision 1.916 diff -u -r1.915 -r1.916 --- CHANGES 1998/06/14 18:33:08 1.915 +++ CHANGES 1998/06/15 16:46:10 1.916 @@ -1,5 +1,7 @@ Changes with Apache 1.3.1 + *) PORT: clean up a warning in mod_status for OS/2. [Brian Havard] + *) Make table elements const. This may prevent obscure errors. [Ben Laurie] *) Fix parsing of FTP `SIZE' responses in proxy module: The newline was not 1.89 +1 -1 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.88 retrieving revision 1.89 diff -u -r1.88 -r1.89 --- mod_status.c 1998/06/04 20:13:21 1.88 +++ mod_status.c 1998/06/15 16:46:13 1.89 @@ -232,7 +232,7 @@ long req_time; #if defined(NEXT) float tick = HZ; -#elif !defined(WIN32) +#elif !defined(NO_TIMES) float tick = sysconf(_SC_CLK_TCK); #endif #endif /* STATUS */
cvs commit: apache-1.3/src/modules/standard mod_status.c
brian 98/05/05 20:24:21 Modified:src CHANGES src/modules/standard mod_status.c Log: PR: 1551 Standardized the time format printed out by mod_status, which now means it includes the time zone. Revision ChangesPath 1.822 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.821 retrieving revision 1.822 diff -u -r1.821 -r1.822 --- CHANGES 1998/05/06 02:29:46 1.821 +++ CHANGES 1998/05/06 03:24:14 1.822 @@ -1,5 +1,8 @@ Changes with Apache 1.3b7 + *) Standardized the time format in mod_status to match that of other + places in the code (e.g. DATE_GMT)). + *) Fix handling of %Z in timefmt strings for those platforms with no time zone information in their tm struct. [Paul Eggert [EMAIL PROTECTED]] PR #754 1.87 +8 -3 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- mod_status.c 1998/05/05 04:47:59 1.86 +++ mod_status.c 1998/05/06 03:24:20 1.87 @@ -136,6 +136,10 @@ #define MBYTE 1048576L #define GBYTE 1073741824L +#ifndef DEFAULT_TIME_FORMAT +#define DEFAULT_TIME_FORMAT %A, %d-%b-%Y %H:%M:%S %Z +#endif + module MODULE_VAR_EXPORT status_module; #ifdef STATUS @@ -327,10 +331,11 @@ ap_rvputs(r, Server Version: , ap_get_server_version(), br\n, NULL); ap_rvputs(r, Server Built: , ap_get_server_built(), br\nhr\n, -NULL); - ap_rvputs(r, Current Time: , asctime(localtime(nowtime)), br\n, NULL); - ap_rvputs(r, Restart Time: , asctime(localtime(ap_restart_time)), br\n, NULL); + ap_rvputs(r, Current Time: , ap_ht_time(r-pool, nowtime, DEFAULT_TIME_FORMAT, 0), + br\n, NULL); + ap_rvputs(r, Restart Time: , ap_ht_time(r-pool, ap_restart_time, DEFAULT_TIME_FORMAT, 0), +br\n, NULL); ap_rputs(Server uptime: , r); show_time(r, up_time); ap_rputs(br\n, r);
cvs commit: apache-1.3/src/modules/standard mod_status.c
dgaudet 98/03/26 13:20:53 Modified:src CHANGES src/include scoreboard.h src/main http_core.c http_main.c src/modules/standard mod_status.c Log: a few changes to scoreboard definitions to generate better code Revision ChangesPath 1.737 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.736 retrieving revision 1.737 diff -u -r1.736 -r1.737 --- CHANGES 1998/03/26 21:17:37 1.736 +++ CHANGES 1998/03/26 21:20:46 1.737 @@ -1,5 +1,8 @@ Changes with Apache 1.3b6 + *) A few changes to scoreboard definitions which helps gcc generate + better code. [Dean Gaudet] + *) ANSI C doesn't guarantee that int foo : 2 in a structure will be a signed bitfield. So mark a few bitfields as signed to ensure correct code. [Dean Gaudet] 1.37 +4 -5 apache-1.3/src/include/scoreboard.h Index: scoreboard.h === RCS file: /export/home/cvs/apache-1.3/src/include/scoreboard.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- scoreboard.h 1998/01/21 19:17:44 1.36 +++ scoreboard.h 1998/03/26 21:20:48 1.37 @@ -68,11 +68,10 @@ * Status values: */ -#define SERVER_UNKNOWN (-1) /* should never be in this state */ #define SERVER_DEAD 0 -#define SERVER_READY 1 /* Waiting for connection (or accept() lock) */ -#define SERVER_STARTING 3/* Server Starting up */ -#define SERVER_BUSY_READ 2 /* Reading a client request */ +#define SERVER_STARTING 1/* Server Starting up */ +#define SERVER_READY 2 /* Waiting for connection (or accept() lock) */ +#define SERVER_BUSY_READ 3 /* Reading a client request */ #define SERVER_BUSY_WRITE 4 /* Processing a client request */ #define SERVER_BUSY_KEEPALIVE 5 /* Waiting for more requests via keepalive */ #define SERVER_BUSY_LOG 6/* Logging the request */ @@ -101,7 +100,7 @@ vtime_t cur_vtime; /* the child's current vtime */ unsigned short timeout_len; /* length of the timeout */ #endif -signed char status; +unsigned char status; #if defined(STATUS) unsigned long access_count; unsigned long bytes_served; 1.177 +2 -2 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.176 retrieving revision 1.177 diff -u -r1.176 -r1.177 --- http_core.c 1998/03/26 21:08:37 1.176 +++ http_core.c 1998/03/26 21:20:49 1.177 @@ -495,7 +495,7 @@ struct hostent *hptr; int hostname_lookups; #ifdef STATUS -int old_stat = SERVER_UNKNOWN; +int old_stat = SERVER_DEAD; /* we shouldn't ever be in this state */ #endif /* If we haven't checked the host name, and we want to */ @@ -542,7 +542,7 @@ } } #ifdef STATUS -if (old_stat != SERVER_UNKNOWN) { +if (old_stat != SERVER_DEAD) { (void)update_child_status(conn-child_num,old_stat,(request_rec*)NULL); } #endif /* STATUS */ 1.313 +22 -20apache-1.3/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.312 retrieving revision 1.313 diff -u -r1.312 -r1.313 --- http_main.c 1998/03/26 19:03:02 1.312 +++ http_main.c 1998/03/26 21:20:50 1.313 @@ -3581,35 +3581,37 @@ sync_scoreboard_image(); for (i = 0; i daemons_limit; ++i) { + int status; + if (i = max_daemons_limit free_length == idle_spawn_rate) break; ss = scoreboard_image-servers[i]; - switch (ss-status) { - /* We consider a starting server as idle because we started it - * at least a cycle ago, and if it still hasn't finished starting - * then we're just going to swamp things worse by forking more. - * So we hopefully won't need to fork more if we count it. - */ - case SERVER_STARTING: - case SERVER_READY: - ++ idle_count; - /* always kill the highest numbered child if we have to... - * no really well thought out reason ... other than observing - * the server behaviour under linux where lower numbered children - * tend to service more hits (and hence are more likely to have - * their data in cpu caches). - */ - to_kill = i; - break; - case
cvs commit: apache-1.3/src/modules/standard mod_status.c
dgaudet 98/03/16 00:40:56 Modified:src/modules/standard mod_status.c Log: 501 is reserved for when the server cannot support the request for any resource. 500 is the right response here. Revision ChangesPath 1.80 +1 -1 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -r1.79 -r1.80 --- mod_status.c 1998/03/15 08:01:49 1.79 +++ mod_status.c 1998/03/16 08:40:56 1.80 @@ -243,7 +243,7 @@ if (!exists_scoreboard_image()) { aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r-server, Server status unavailable in inetd mode); - return HTTP_NOT_IMPLEMENTED; + return HTTP_INTERNAL_SERVER_ERROR; } r-allowed = (1 M_GET); if (r-method_number != M_GET)
cvs commit: apache-1.3/src/modules/standard mod_status.c
jim 98/02/22 05:50:11 Modified:src CHANGES src/modules/standard mod_status.c Log: backout the SERVER_* in mod_status Revision ChangesPath 1.654 +0 -3 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.653 retrieving revision 1.654 diff -u -r1.653 -r1.654 --- CHANGES 1998/02/22 04:53:57 1.653 +++ CHANGES 1998/02/22 13:50:08 1.654 @@ -1,8 +1,5 @@ Changes with Apache 1.3b6 - *) Have the mod_status Status page report server version and - built data [M.D. Parker [EMAIL PROTECTED]] PR#1448 - *) [PORT] Recognize FreeBSD versions so we can use the OS regex as well as handling unsigned-chars for FreeBSD v3 and v2 [Andrey Chernov [EMAIL PROTECTED] and Jim] PR#1450 1.74 +3 -0 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- mod_status.c 1998/02/21 15:32:58 1.73 +++ mod_status.c 1998/02/22 13:50:10 1.74 @@ -315,8 +315,11 @@ rputs(HTMLHEAD\nTITLEApache Status/TITLE\n/HEADBODY\n, r); rputs(H1Apache Server Status for , r); rvputs(r, server-server_hostname, /H1\n\n, NULL); +#if 0 + /* We don't do this until we resolve shared lib concerns */ rvputs(r, Server Version:, SERVER_VERSION, br\n, NULL); rvputs(r, Server Built:, SERVER_BUILT, br\nhr\n, NULL); +#endif rvputs(r, Current Time: , asctime(localtime(nowtime)), br\n, NULL); rvputs(r, Restart Time: , asctime(localtime(restart_time)), br\n, NULL);
cvs commit: apache-1.3/src/modules/standard mod_status.c
jim 98/02/22 07:00:53 Modified:src CHANGES src/modules/standard mod_status.c Log: Obtained from: Scott Anguish and Timothy Luoma Reviewed by: Jim NeXT porting changes for mod_status Revision ChangesPath 1.655 +4 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.654 retrieving revision 1.655 diff -u -r1.654 -r1.655 --- CHANGES 1998/02/22 13:50:08 1.654 +++ CHANGES 1998/02/22 15:00:50 1.655 @@ -1,5 +1,9 @@ Changes with Apache 1.3b6 + *) [PORT] Work around the fact that NeXT runs on more than the + m68k chips in mod_status [Scott Anguish and Timothy Luoma + [EMAIL PROTECTED]] + *) [PORT] Recognize FreeBSD versions so we can use the OS regex as well as handling unsigned-chars for FreeBSD v3 and v2 [Andrey Chernov [EMAIL PROTECTED] and Jim] PR#1450 1.75 +8 -0 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.74 retrieving revision 1.75 diff -u -r1.74 -r1.75 --- mod_status.c 1998/02/22 13:50:10 1.74 +++ mod_status.c 1998/02/22 15:00:52 1.75 @@ -117,7 +117,15 @@ #include http_log.h #ifdef NEXT +#if NX_CURRENT_COMPILER_RELEASE == 410 +#if __ARCHITECTURE__ == m68k +#define HZ 64 +#else +#define HZ 100 +#endif +#else #include machine/param.h +#ndif #endif #define STATUS_MAXLINE 64
cvs commit: apache-1.3/src/modules/standard mod_status.c
ben 98/02/22 07:31:36 Modified:src/modules/standard mod_status.c Log: Fix typo. Revision ChangesPath 1.76 +1 -1 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- mod_status.c 1998/02/22 15:00:52 1.75 +++ mod_status.c 1998/02/22 15:31:35 1.76 @@ -125,7 +125,7 @@ #endif #else #include machine/param.h -#ndif +#endif #endif #define STATUS_MAXLINE 64
cvs commit: apache-1.3/src/modules/standard mod_status.c
jim 98/02/21 07:32:59 Modified:src CHANGES src/modules/standard mod_status.c Log: PR: 1448 Obtained from: M.D. Parker [EMAIL PROTECTED] Submitted by: Jim Reviewed by: Jim Add SERVER_VERSION and SERVER_BUILT info to the mod_status Status report Revision ChangesPath 1.651 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.650 retrieving revision 1.651 diff -u -r1.650 -r1.651 --- CHANGES 1998/02/21 15:00:37 1.650 +++ CHANGES 1998/02/21 15:32:56 1.651 @@ -1,5 +1,8 @@ Changes with Apache 1.3b6 + *) Have the mod_status Status page report server version and + built data [M.D. Parker [EMAIL PROTECTED]] PR#1448 + *) [PORT] Recognize FreeBSD-3 so we can use the OS regex as well as handling unsigned-chars [Andrey Chernov [EMAIL PROTECTED] and Jim] PR#1450 1.73 +2 -0 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- mod_status.c 1998/01/29 20:36:13 1.72 +++ mod_status.c 1998/02/21 15:32:58 1.73 @@ -315,6 +315,8 @@ rputs(HTMLHEAD\nTITLEApache Status/TITLE\n/HEADBODY\n, r); rputs(H1Apache Server Status for , r); rvputs(r, server-server_hostname, /H1\n\n, NULL); + rvputs(r, Server Version:, SERVER_VERSION, br\n, NULL); + rvputs(r, Server Built:, SERVER_BUILT, br\nhr\n, NULL); rvputs(r, Current Time: , asctime(localtime(nowtime)), br\n, NULL); rvputs(r, Restart Time: , asctime(localtime(restart_time)), br\n, NULL);