httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sutton <p...@c2.net>
Subject Server version bugs
Date Sat, 09 May 1998 14:46:25 GMT
httpd -v, httpd -V and every start of Apache on NT prints a NULL string,
after this patch. It calls ap_get_server_version() before the modules have
been init'ed, which means that server_version is NULL. You probably want
to make sure that the return value of this function is reasonable, such as
SERVER_BASEVERSION if server_version is NULL. Here is a patch. (Also there
is no point displaying "Server Full version" as well as SERVER_BASEVERSION
is the -V output).

//pcs

Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.344
diff -u -r1.344 http_main.c
--- http_main.c	1998/05/09 13:23:56	1.344
+++ http_main.c	1998/05/09 13:45:31
@@ -359,7 +359,7 @@
 
 API_EXPORT(const char *) ap_get_server_version()
 {
-    return server_version;
+    return server_version ? server_version : SERVER_BASEVERSION;
 }
 
 API_EXPORT(void) ap_add_version_component(const char *component)
@@ -2992,7 +2992,6 @@
 #ifdef SERVER_SUBVERSION
     printf("Server sub-version:  %s\n", SERVER_SUBVERSION);
 #endif
-    printf("Server Full version: %s\n", ap_get_server_version());
     printf("Server built:        %s\n", ap_get_server_built());
     printf("Server's Module Magic Number: %u\n", MODULE_MAGIC_NUMBER);
     printf("Server compiled with....\n");


Mime
View raw message