diff -ur apache_1.3.24.orig/configure apache_1.3.24/configure --- apache_1.3.24.orig/configure Wed Mar 13 16:05:27 2002 +++ apache_1.3.24/configure Fri Apr 12 01:23:28 2002 @@ -454,6 +454,7 @@ echo " --without-execstrip disable the stripping of executables on installation" echo " --server-uid=UID set the user ID the web server should run as [nobody]" echo " --server-gid=GID set the group ID the web server UID is a memeber of [#-1]" + echo " --with-forward enable tracking of cache-forwarded requests" echo "" echo "suEXEC options:" echo " --enable-suexec enable the suEXEC feature" @@ -961,6 +962,10 @@ --with-port=*) port="$apc_optarg" ;; + --with-forward) + forward=1 + CFLAGS="$CFLAGS -DRECORD_FORWARD" + ;; --without-support) support=0 ;; diff -ur apache_1.3.24.orig/src/include/scoreboard.h apache_1.3.24/src/include/scoreboard.h --- apache_1.3.24.orig/src/include/scoreboard.h Wed Mar 13 16:05:29 2002 +++ apache_1.3.24/src/include/scoreboard.h Fri Apr 12 01:23:28 2002 @@ -158,6 +158,9 @@ time_t last_used; #endif char client[32]; /* Keep 'em small... */ +#ifdef RECORD_FORWARD + char fwdclient[32]; /* Client that the req is forwarded for */ +#endif char request[64]; /* We just want an idea... */ server_rec *vhostrec; /* What virtual host is being accessed? */ /* SEE ABOVE FOR SAFE USAGE! */ diff -ur apache_1.3.24.orig/src/main/http_main.c apache_1.3.24/src/main/http_main.c --- apache_1.3.24.orig/src/main/http_main.c Wed Mar 13 16:05:30 2002 +++ apache_1.3.24/src/main/http_main.c Fri Apr 12 01:23:28 2002 @@ -2561,6 +2561,9 @@ { int old_status; short_score *ss; +#ifdef RECORD_FORWARD + char * address; +#endif if (child_num < 0) return -1; @@ -2598,6 +2601,15 @@ conn_rec *c = r->connection; ap_cpystrn(ss->client, ap_get_remote_host(c, r->per_dir_config, REMOTE_NOLOOKUP), sizeof(ss->client)); + +#ifdef RECORD_FORWARD + if ((address = ap_table_get(r->headers_in, "X-Forwarded-For")) == NULL) { + ap_cpystrn(ss->fwdclient, "", sizeof(ss->client)); + } else { + ap_cpystrn(ss->fwdclient, address, sizeof(ss->client)); + } +#endif + if (r->the_request == NULL) { ap_cpystrn(ss->request, "NULL", sizeof(ss->request)); } else if (r->parsed_uri.password == NULL) { diff -ur apache_1.3.24.orig/src/modules/standard/mod_status.c apache_1.3.24/src/modules/standard/mod_status.c --- apache_1.3.24.orig/src/modules/standard/mod_status.c Wed Mar 13 16:05:34 2002 +++ apache_1.3.24/src/modules/standard/mod_status.c Fri Apr 12 01:23:28 2002 @@ -486,9 +486,17 @@ else #ifdef NO_TIMES /* Allow for OS/2 not having CPU stats */ +#ifdef RECORD_FORWARD + ap_rputs("

\n\n\n\n", r); +#else ap_rputs("

\n\n

SrvPIDAccM\nSSReqConnChildSlotClient (Fwd)VHostRequest
\n\n", r); +#endif // RECORD_FORWARD +#else +#ifdef RECORD_FORWARD + ap_rputs("

\n\n

SrvPIDAccM\nSSReqConnChildSlotClientVHostRequest
\n\n", r); #else ap_rputs("

\n\n

SrvPIDAccMCPU\nSSReqConnChildSlotClient (Fwd)VHostRequest
\n\n", r); +#endif // RECORD_FORWARD #endif } @@ -673,13 +681,18 @@ if (score_record.status == SERVER_BUSY_READ) ap_rprintf(r, "\n\n"); - else - ap_rprintf(r, - "\n\n", - ap_escape_html(r->pool, score_record.client), - vhost ? ap_escape_html(r->pool, - vhost->server_hostname) : "(unavailable)", - ap_escape_html(r->pool, score_record.request)); + else { + ap_rprintf(r,"\n\n", + vhost ? ap_escape_html(r->pool, vhost->server_hostname) : "(unavailable)", + ap_escape_html(r->pool, score_record.request)); + + } /* if (! score_record.status == SERVER_BUSY_READ) */ } /* no_table_report */ } /* !short_report */ } /* if () */
SrvPIDAccMCPU\nSSReqConnChildSlotClientVHostRequest
??..reading..
%s%s%s
%s",ap_escape_html(r->pool, score_record.client)); +#ifdef RECORD_FORWARD + if (strlen(score_record.fwdclient) != 0) + ap_rprintf(r, + " (%s)", ap_escape_html(r->pool, score_record.fwdclient)); +#endif + ap_rprintf(r, "%s%s