You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jim Jagielski <ji...@jaguNET.com> on 2000/01/04 21:56:45 UTC

Re: [PATCH] vhost hostname in scoreboard not useful when using

Funny... this goes back to the _old_ behavior of storing the hostname... :/

Cliff Woolley wrote:
> 
> This is a MIME message. If you are reading this text, you may want to 
> consider changing to a mail reader or gateway that understands how to 
> properly handle MIME multipart messages.
> 
> --=_99C0DEE7.04650E39
> Content-Type: text/plain; charset=US-ASCII
> Content-Disposition: inline
> 
> 
> Hey all...
> 
>    I noticed a little problem today with the way the scoreboard in
> 1.3.9 stores the vhost information for display in mod_status when using
> mod_vhost_alias.  The vhost's hostname is the only one stored, not the
> request hostname, which is what we really want to see out of mod_status.
>  Attached is a five-line patch across three files that fixes this
> problem.  The line numbers might be a little off because I haven't
> applied some of the (unrelated) patches since 1.3.9 in the CVS tree,
> though it's a very straightforward patch so it should be easy to merge
> in.  The theory is simple: store the r->hostname in the short_score
> struct (just like the r->client is stored) in addition to the pointer to
> the vhost server_rec.
> 
> Thoughts?
> 
> --Cliff
> 
> 
> Cliff Woolley
> Central Systems Software Administrator
> Washington and Lee University
> http://www.wlu.edu/~jwoolley/
> 
> Work: (540) 463-8089
> Pager: (540) 462-2303
> 
> --=_99C0DEE7.04650E39
> Content-Type: text/plain
> Content-Disposition: attachment; filename="scoreboard.patch"
> 
> --- src/include/scoreboard.h.010400	Tue Jan  4 15:14:46 2000
> +++ src/include/scoreboard.h	Tue Jan  4 15:16:44 2000
> @@ -159,6 +159,7 @@
>      char request[64];		/* We just want an idea... */
>      server_rec *vhostrec;	/* What virtual host is being accessed? */
>                                  /* SEE ABOVE FOR SAFE USAGE! */
> +    char hostname[32];          /* needed for mod_vhost_alias reporting */
>  } short_score;
>  
>  typedef struct {
> --- src/main/http_main.c.010400	Tue Jan  4 15:22:30 2000
> +++ src/main/http_main.c	Tue Jan  4 15:24:30 2000
> @@ -2211,6 +2211,7 @@
>  				       sizeof(ss->request));
>  	    }
>  	    ss->vhostrec =  r->server;
> +            ap_cpystrn(ss->hostname, r->hostname, sizeof(ss->hostname));
>  	}
>      }
>      if (status == SERVER_STARTING && r == NULL) {
> --- src/modules/standard/mod_status.c.010400	Tue Jan  4 15:25:05 2000
> +++ src/modules/standard/mod_status.c	Tue Jan  4 15:27:17 2000
> @@ -620,7 +620,7 @@
>  			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)");
> +			    vhost ? score_record.hostname : "(unavailable)");
>  		    }
>  		    else {		/* !no_table_report */
>  #ifndef NO_PRETTYPRINT
> @@ -702,13 +702,13 @@
>  			     "<td nowrap><font face=\"Arial,Helvetica\" size=\"-1\">%s</font>"
>  			     "</tr>\n\n",
>  			     score_record.client,
> -			     vhost ? vhost->server_hostname : "(unavailable)",
> +			     vhost ? score_record.hostname : "(unavailable)",
>  			     ap_escape_html(r->pool, score_record.request));
>  #else
>  			    ap_rprintf(r,
>  			     "<td>%s<td nowrap>%s<td nowrap>%s</tr>\n\n",
>  			     score_record.client,
> -			     vhost ? vhost->server_hostname : "(unavailable)",
> +			     vhost ? score_record.hostname : "(unavailable)",
>  			     ap_escape_html(r->pool, score_record.request));
>  #endif
>  		    }		/* no_table_report */
> 
> --=_99C0DEE7.04650E39--
> 


-- 
===========================================================================
   Jim Jagielski   [|]   jim@jaguNET.com   [|]   http://www.jaguNET.com/
                "Are you suggesting coconuts migrate??"