Commit 0d408997 authored by Jeff Trawick's avatar Jeff Trawick
Browse files

Replace ap_get_server_version with ap_get_server_banner() and

ap_get_server_description().

High-level summary:

The full server version information is now included in the error log at
startup as well as server status reports, irrespective of the setting
of the ServerTokens directive.

Third-party modules must now use ap_get_server_banner() or 
ap_get_server_description() in place of ap_get_server_version().



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@440337 13f79535-47bb-0310-9956-ffa450edef68
parent 97556b23
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2,6 +2,12 @@
Changes with Apache 2.3.0
  [Remove entries to the current 2.0 and 2.2 section below, when backported]
  *) The full server version information is now included in the error log at
     startup as well as server status reports, irrespective of the setting
     of the ServerTokens directive.  Third-party modules must now use
     ap_get_server_banner() or ap_get_server_description() in place of 
     ap_get_server_version().  [Jeff Trawick]
  *) mod_proxy_balancer: Extract stickysession routing information contained as
     parameter in the URL correctly. PR 40400.
     [Ruediger Pluem, Tomokazu Harada <harada sysrdc.ns-sol.co.jp>]
+4 −2
Original line number Diff line number Diff line
@@ -121,14 +121,16 @@
 *                         proxy_server (minor)
 * 20060110.3 (2.3.0-dev)  added inreslist member to proxy_conn_rec (minor)
 * 20060110.4 (2.3.0-dev)  Added server_scheme member to server_rec (minor)
 * 20060905.0 (2.3.0-dev)  Replaced ap_get_server_version() with
 *                         ap_get_server_banner() and ap_get_server_description()
 */

#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */

#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20060110
#define MODULE_MAGIC_NUMBER_MAJOR 20060905
#endif
#define MODULE_MAGIC_NUMBER_MINOR 4                     /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 0                     /* 0...n */

/**
 * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+15 −4
Original line number Diff line number Diff line
@@ -420,13 +420,24 @@ typedef struct {
AP_DECLARE(void) ap_get_server_revision(ap_version_t *version);

/**
 * Get the server version string
 * @return The server version string
 * Get the server banner in a form suitable for sending over the
 * network, with the level of information controlled by the
 * ServerTokens directive.
 * @return The server banner
 */
AP_DECLARE(const char *) ap_get_server_version(void);
AP_DECLARE(const char *) ap_get_server_banner(void);

/**
 * Add a component to the version string
 * Get the server description in a form suitable for local displays,
 * status reports, or logging.  This includes the detailed server
 * version and information about some modules.  It is not affected
 * by the ServerTokens directive.
 * @return The server description
 */
AP_DECLARE(const char *) ap_get_server_description(void);

/**
 * Add a component to the server description and banner strings
 * @param pconf The pool to allocate the component from
 * @param component The string to add
 */
+1 −1
Original line number Diff line number Diff line
@@ -1074,7 +1074,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r,
            /* XXX-Can't get specific SSL info from NetWare */
            /*result = ssl_var_lookup_ssl_version(p, var+12);*/
        else if (strcEQ(var, "SERVER_SOFTWARE"))
            result = ap_get_server_version();
            result = ap_get_server_banner();
        else if (strcEQ(var, "API_VERSION")) {
            result = apr_itoa(p, MODULE_MAGIC_NUMBER);
            resdup = FALSE;
+1 −1
Original line number Diff line number Diff line
@@ -546,7 +546,7 @@ static int x_handler(request_rec *r)
    ap_rputs("  </H1>\n", r);
    ap_rputs("  <P>\n", r);
    ap_rprintf(r, "  Apache HTTP Server version: \"%s\"\n",
            ap_get_server_version());
            ap_get_server_banner());
    ap_rputs("  <BR>\n", r);
    ap_rprintf(r, "  Server built: \"%s\"\n", ap_get_server_built());
    ap_rputs("  </P>\n", r);;
Loading