You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Tony Finch <fa...@demon.net> on 1999/02/24 18:02:16 UTC

server signature and version strings

Is there any reason that ap_psignature uses SERVER_BASEVERSION instead
of ap_get_server_version?

Tony.
-- 
f.a.n.finch  dot@dotat.at  fanf@demon.net


--- http_core.c	Thu Feb  4 23:46:08 1999
+++ http_core.patched.c	Wed Feb 24 16:57:49 1999
@@ -2333,13 +2333,14 @@
     ap_snprintf(sport, sizeof sport, "%u", (unsigned) ap_get_server_port(r));
 
     if (conf->server_signature == srv_sig_withmail) {
-	return ap_pstrcat(r->pool, prefix, "<ADDRESS>" SERVER_BASEVERSION
+	return ap_pstrcat(r->pool, prefix, "<ADDRESS>",
+			  ap_get_server_version(),
 			  " Server at <A HREF=\"mailto:",
 			  r->server->server_admin, "\">",
 			  ap_get_server_name(r), "</A> Port ", sport,
 			  "</ADDRESS>\n", NULL);
     }
-    return ap_pstrcat(r->pool, prefix, "<ADDRESS>" SERVER_BASEVERSION
+    return ap_pstrcat(r->pool, prefix, "<ADDRESS>", ap_get_server_version(),
 		      " Server at ", ap_get_server_name(r), " Port ", sport,
 		      "</ADDRESS>\n", NULL);
 }

Re: server signature and version strings

Posted by Martin Kraemer <ma...@deejai.mch.sni.de>.
I said...
> >+1 -- you´re absolutely right.
> 
> You probably also want the following patch then, brought to you by the
> magic of `find . | xargs grep SERVER_BASEVERSION`.

Hmmm. In the meantime, I applied these patches and now remember why I
never tried to use ap_get_server_version() for psignature(): it contains
just too much information if you happen to have 3rd party modules in
your server.

Imagine the unsuspecting windows user who happens to use a unix machine
with apache as a proxy, and is confronted with an error message like...

  Proxy error blah blah
  ----
  Apache/1.3.4 (Unix) mod_ssl/2.2.2 OpenSSL/0.9.1c mod_php/3.0.7 mod_perl/x.y Server at myhost.my.dom Port 80

where most of the last line is purely technical insider information
Therefore, I think I will keep the current

  Proxy error blah blah
  ----
  Apache/1.3.4 Server at myhost.my.dom Port 80

Sorry for changing my mind -- I was just about to commit your patches :-(

    Martin
-- 
<Ma...@MchP.Siemens.De>      |        Siemens Information and
Phone: +49-89-636-46021               |        Communication  Products
FAX:   +49-89-636-47816               |        81730  Munich,  Germany

Re: server signature and version strings

Posted by Tony Finch <do...@dotat.at>.
Martin Kraemer <ma...@deejai.mch.sni.de> wrote:
>
>> -    return ap_pstrcat(r->pool, prefix, "<ADDRESS>" SERVER_BASEVERSION
>> +    return ap_pstrcat(r->pool, prefix, "<ADDRESS>", ap_get_server_version(),
>
>+1 -- you�re absolutely right.

You probably also want the following patch then, brought to you by the
magic of `find . | xargs grep SERVER_BASEVERSION`.

Tony.
-- 
f.a.n.finch  dot@dotat.at  fanf@demon.net


--- src/modules/proxy/proxy_http.c	Tue Jan 12 16:03:43 1999
+++ src/modules/proxy/proxy_http.version.c	Fri Feb 26 12:28:06 1999
@@ -327,7 +327,7 @@
 				HTTP_VERSION_MAJOR(r->proto_num),
 				HTTP_VERSION_MINOR(r->proto_num),
 				ap_get_server_name(r), portstr,
-				SERVER_BASEVERSION)
+				ap_get_server_version())
 			: ap_psprintf(p, "%d.%d %s%s",
 				HTTP_VERSION_MAJOR(r->proto_num),
 				HTTP_VERSION_MINOR(r->proto_num),
@@ -420,7 +420,7 @@
 			    ? ap_psprintf(p, "%d.%d %s%s (%s)",
 				major, minor,
 				ap_get_server_name(r), portstr,
-				SERVER_BASEVERSION)
+				ap_get_server_version())
 			    : ap_psprintf(p, "%d.%d %s%s",
 				major, minor,
 				ap_get_server_name(r), portstr)

Re: server signature and version strings

Posted by Martin Kraemer <ma...@deejai.mch.sni.de>.
On Wed, Feb 24, 1999 at 05:02:16PM +0000, Tony Finch wrote:
> Is there any reason that ap_psignature uses SERVER_BASEVERSION instead
> of ap_get_server_version?

No, other than historic reasons (when I wrote psignature(), we didn't
have ap_get_server_version() yet).

> --- http_core.c	Thu Feb  4 23:46:08 1999
> +++ http_core.patched.c	Wed Feb 24 16:57:49 1999
> @@ -2333,13 +2333,14 @@
>      ap_snprintf(sport, sizeof sport, "%u", (unsigned) ap_get_server_port(r));
>  
>      if (conf->server_signature == srv_sig_withmail) {
> -	return ap_pstrcat(r->pool, prefix, "<ADDRESS>" SERVER_BASEVERSION
> +	return ap_pstrcat(r->pool, prefix, "<ADDRESS>",
> +			  ap_get_server_version(),
>  			  " Server at <A HREF=\"mailto:",
>  			  r->server->server_admin, "\">",
>  			  ap_get_server_name(r), "</A> Port ", sport,
>  			  "</ADDRESS>\n", NULL);
>      }
> -    return ap_pstrcat(r->pool, prefix, "<ADDRESS>" SERVER_BASEVERSION
> +    return ap_pstrcat(r->pool, prefix, "<ADDRESS>", ap_get_server_version(),
>  		      " Server at ", ap_get_server_name(r), " Port ", sport,
>  		      "</ADDRESS>\n", NULL);
>  }

+1 -- you´re absolutely right.

    Martin
-- 
<Ma...@MchP.Siemens.De>      |        Siemens Information and
Phone: +49-89-636-46021               |        Communication  Products
FAX:   +49-89-636-47816               |        81730  Munich,  Germany