httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject vhost string in mod_status
Date Thu, 17 Jun 1999 06:37:56 GMT
For people using UseCanonicalName off along with mod_rewrite for 
mass vhosting, it would be nice if mod_status would display the 
fake-vhost name instead of the ServerName.  Before the vhostrec changes
to not copy the string around all the time, making that work was just a 
matter of a "bugfix", ie. adding ap_get_server_name() where it should have
been anyway.

Anyone think the below patch has a place in the tree for people that still
want to be able to do that?  I do.

Index: src/include/scoreboard.h
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/include/scoreboard.h,v
retrieving revision 1.47
diff -u -r1.47 scoreboard.h
--- scoreboard.h	1999/04/27 20:36:29	1.47
+++ scoreboard.h	1999/06/17 06:33:58
@@ -157,6 +157,9 @@
 #endif
     char client[32];		/* Keep 'em small... */
     char request[64];		/* We just want an idea... */
+#ifdef SCOREBOARD_VHOST_STRING
+    char vhost[32];
+#endif
     server_rec *vhostrec;	/* What virtual host is being accessed? */
                                 /* SEE ABOVE FOR SAFE USAGE! */
 } short_score;
Index: src/main/http_main.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.445
diff -u -r1.445 http_main.c
--- http_main.c	1999/06/13 19:59:41	1.445
+++ http_main.c	1999/06/17 06:34:01
@@ -2159,6 +2159,9 @@
 					       r->assbackwards ? NULL : " ", r->protocol, NULL),
 				       sizeof(ss->request));
 	    }
+#ifdef SCOREBOARD_VHOST_STRING
+	    ap_cpystrn(ss->vhost, ap_get_server_name(r), sizeof(ss->vhost));
+#endif
 	    ss->vhostrec =  r->server;
 	}
     }
Index: src/modules/standard/mod_status.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v
retrieving revision 1.107
diff -u -r1.107 mod_status.c
--- mod_status.c	1999/06/05 15:48:12	1.107
+++ mod_status.c	1999/06/17 06:34:02
@@ -599,7 +599,12 @@
 			ap_rprintf(r, " <i>%s {%s}</i> <b>[%s]</b><br>\n\n",
 			    score_record.client,
 			    ap_escape_html(r->pool, score_record.request),
-			    vhost ? vhost->server_hostname : "(unavailable)");
+#ifdef SCOREBOARD_VHOST_STRING
+			    score_record.vhost
+#else
+			    vhost ? vhost->server_hostname : "(unavailable)"
+#endif
+			    );
 		    }
 		    else {		/* !no_table_report */
 			if (score_record.status == SERVER_DEAD)
@@ -672,7 +677,11 @@
 			    ap_rprintf(r,
 			     "<td>%s<td nowrap>%s<td nowrap>%s</tr>\n\n",
 			     score_record.client,
+#ifdef SCOREBOARD_VHOST_STRING
+			     score_record.vhost,
+#else
 			     vhost ? vhost->server_hostname : "(unavailable)",
+#endif
 			     ap_escape_html(r->pool, score_record.request));
 		    }		/* no_table_report */
 		}			/* !short_report */


Mime
View raw message