coar 98/03/03 18:28:27
Modified: . STATUS
src CHANGES buildmark.c
src/include httpd.h
src/main http_main.c http_protocol.c util_script.c
src/modules/example mod_example.c
src/modules/proxy proxy_connect.c
src/modules/standard mod_info.c mod_rewrite.c mod_status.c
src/os/unix os.h
Log:
Abstract the SERVER_BUILT and SERVER_VERSION values through
API routines - and fix a problem with os/unix/os.h and -DHIDE.
A similar fix may be needed for the other os/* directories,
and a new 'make depend' needs to be run once a default value for
the HIDE rule is determined.
Revision Changes Path
1.171 +2 -0 apache-1.3/STATUS
Index: STATUS
===================================================================
RCS file: /export/home/cvs/apache-1.3/STATUS,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -r1.170 -r1.171
--- STATUS 1998/03/03 13:38:56 1.170
+++ STATUS 1998/03/04 02:28:09 1.171
@@ -63,6 +63,8 @@
* Dean's rewrite of absoluteURI handling vhost matching
* Dean's new mod_test_util_uri.c
* back out USE_PTHREAD_SERIALIZED_ACCEPT for solaris
+ * Ken's abstraction of SERVER_{BUILT,VERSION}
+ * Ken's fix for os/unix/os.h and the new -DHIDE functionality
Available Patches:
1.680 +6 -0 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.679
retrieving revision 1.680
diff -u -r1.679 -r1.680
--- CHANGES 1998/03/03 21:16:47 1.679
+++ CHANGES 1998/03/04 02:28:10 1.680
@@ -1,5 +1,11 @@
Changes with Apache 1.3b6
+ *) To deal with modules being compiled and [dynamically] linked
+ at a different time from the core, the SERVER_VERSION and
+ SERVER_BUILT symbols have been abstracted through the new
+ API routines apapi_get_server_version() and apapi_get_server_built().
+ [Ken Coar]
+
*) WIN32: Preserve trailing slash in canonical path (and hence
in PATH_INFO). [Paul Sutton, Ben Laurie]
1.3 +68 -2 apache-1.3/src/buildmark.c
Index: buildmark.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/buildmark.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- buildmark.c 1998/02/28 15:39:29 1.2
+++ buildmark.c 1998/03/04 02:28:11 1.3
@@ -1,6 +1,72 @@
+/* ====================================================================
+ * Copyright (c) 1995-1998 The Apache Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the Apache Group
+ * for use in the Apache HTTP server project (http://www.apache.org/)."
+ *
+ * 4. The names "Apache Server" and "Apache Group" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * [EMAIL PROTECTED]
+ *
+ * 5. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the Apache Group
+ * for use in the Apache HTTP server project (http://www.apache.org/)."
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Group and was originally based
+ * on public domain software written at the National Center for
+ * Supercomputing Applications, University of Illinois, Urbana-Champaign.
+ * For more information on the Apache Group and the Apache HTTP server
+ * project, please see <http://www.apache.org/>.
+ *
+ */
+
#include "conf.h"
+#include "httpd.h"
+
#if defined(__DATE__) && defined(__TIME__)
-const char SERVER_BUILT[] = __DATE__ " " __TIME__;
+static const char server_built[] = __DATE__ " " __TIME__;
#else
-const char SERVER_BUILT[] = "unknown";
+static const char server_built[] = "unknown";
#endif
+static const char server_version[] = SERVER_VERSION;
+
+const char *apapi_get_server_built()
+{
+ return server_built;
+}
+
+const char *apapi_get_server_version()
+{
+ return server_version;
+}
1.190 +3 -0 apache-1.3/src/include/httpd.h
Index: httpd.h
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/include/httpd.h,v
retrieving revision 1.189
retrieving revision 1.190
diff -u -r1.189 -r1.190
--- httpd.h 1998/03/02 06:51:04 1.189
+++ httpd.h 1998/03/04 02:28:13 1.190
@@ -364,6 +364,9 @@
#endif
extern MODULE_VAR_EXPORT const char SERVER_BUILT[];
+const char *apapi_get_server_version();
+const char *apapi_get_server_built();
+
/* Numeric release version identifier: major minor bugfix betaseq
* Always increases along the same track as the source branch.
*/
1.299 +11 -11 apache-1.3/src/main/http_main.c
Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.298
retrieving revision 1.299
diff -u -r1.298 -r1.299
--- http_main.c 1998/03/02 06:51:08 1.298
+++ http_main.c 1998/03/04 02:28:15 1.299
@@ -2810,9 +2810,9 @@
printf("Server base version: \"%s\"\n", SERVER_BASEVERSION);
printf("Server sub-version: \"%s\"\n", SERVER_SUBVERSION);
#else
- printf("Server version \"%s\"\n", SERVER_VERSION);
+ printf("Server version \"%s\"\n", apapi_get_server_version());
#endif
- printf("Server built: %s\n", SERVER_BUILT);
+ printf("Server built: %s\n", apapi_get_server_built());
printf("Server's Module Magic Number: %u\n", MODULE_MAGIC_NUMBER);
printf("Server compiled with....\n");
#ifdef BIG_SECURITY_HOLE
@@ -3636,9 +3636,9 @@
aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf,
"%s configured -- resuming normal operations",
- SERVER_VERSION);
+ apapi_get_server_version());
aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf,
- "Server built: %s", SERVER_BUILT);
+ "Server built: %s", apapi_get_server_built());
restart_pending = shutdown_pending = 0;
while (!restart_pending && !shutdown_pending) {
@@ -3812,8 +3812,8 @@
ap_cpystrn(server_confname, optarg, sizeof(server_confname));
break;
case 'v':
- printf("Server version %s.\n", SERVER_VERSION);
- printf("Server built: %s\n", SERVER_BUILT);
+ printf("Server version %s.\n", apapi_get_server_version());
+ printf("Server built: %s\n", apapi_get_server_built());
exit(0);
case 'V':
show_compile_settings();
@@ -3838,7 +3838,7 @@
}
#ifdef __EMX__
- printf("%s \n", SERVER_VERSION);
+ printf("%s \n", apapi_get_server_version());
#endif
suexec_enabled = init_suexec();
@@ -4956,8 +4956,8 @@
ap_cpystrn(server_confname, optarg, sizeof(server_confname));
break;
case 'v':
- printf("Server version %s.\n", SERVER_VERSION);
- printf("Server built: %s\n", SERVER_BUILT);
+ printf("Server version %s.\n", apapi_get_server_version());
+ printf("Server built: %s\n", apapi_get_server_built());
exit(0);
case 'V':
show_compile_settings();
@@ -4977,11 +4977,11 @@
}
#ifdef __EMX__
- printf("%s \n", SERVER_VERSION);
+ printf("%s \n", apapi_get_server_version());
#endif
#ifdef WIN32
if (!child) {
- printf("%s \n", SERVER_VERSION);
+ printf("%s \n", apapi_get_server_version());
}
#endif
if (!child && run_as_service) {
1.194 +1 -1 apache-1.3/src/main/http_protocol.c
Index: http_protocol.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -r1.193 -r1.194
--- http_protocol.c 1998/03/02 06:51:09 1.193
+++ http_protocol.c 1998/03/04 02:28:16 1.194
@@ -1022,7 +1022,7 @@
protocol, " ", r->status_line, "\015\012", NULL);
send_header_field(r, "Date", gm_timestr_822(r->pool, r->request_time));
- send_header_field(r, "Server", SERVER_VERSION);
+ send_header_field(r, "Server", apapi_get_server_version());
table_unset(r->headers_out, "Date"); /* Avoid bogosity */
table_unset(r->headers_out, "Server");
1.98 +1 -1 apache-1.3/src/main/util_script.c
Index: util_script.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/util_script.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- util_script.c 1998/02/23 07:58:45 1.97
+++ util_script.c 1998/03/04 02:28:17 1.98
@@ -235,7 +235,7 @@
#endif
table_setn(e, "PATH", env_path);
- table_setn(e, "SERVER_SOFTWARE", SERVER_VERSION);
+ table_setn(e, "SERVER_SOFTWARE", apapi_get_server_version());
table_setn(e, "SERVER_NAME", get_server_name(r));
ap_snprintf(port, sizeof(port), "%u", get_server_port(r));
table_setn(e, "SERVER_PORT", pstrdup(r->pool,port));
1.24 +3 -2 apache-1.3/src/modules/example/mod_example.c
Index: mod_example.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/example/mod_example.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- mod_example.c 1998/01/07 16:46:33 1.23
+++ mod_example.c 1998/03/04 02:28:20 1.24
@@ -523,9 +523,10 @@
rputs(" <H1><SAMP>mod_example</SAMP> Module Content-Handler Output\n",
r);
rputs(" </H1>\n", r);
rputs(" <P>\n", r);
- rprintf(r, " Apache HTTP Server version: \"%s\"\n", SERVER_VERSION);
+ rprintf(r, " Apache HTTP Server version: \"%s\"\n",
+ apapi_get_server_version());
rputs(" <BR>\n", r);
- rprintf(r, " Server built: \"%s\"\n", SERVER_BUILT);
+ rprintf(r, " Server built: \"%s\"\n", apapi_get_server_built());
rputs(" </P>\n", r);;
rputs(" <P>\n", r);
rputs(" The format for the callback trace is:\n", r);
1.22 +2 -2 apache-1.3/src/modules/proxy/proxy_connect.c
Index: proxy_connect.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/proxy_connect.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- proxy_connect.c 1998/02/22 21:35:30 1.21
+++ proxy_connect.c 1998/03/04 02:28:22 1.22
@@ -188,13 +188,13 @@
r->uri);
write(sock, buffer, strlen(buffer));
ap_snprintf(buffer, sizeof(buffer),
- "Proxy-agent: %s" CRLF CRLF, SERVER_VERSION);
+ "Proxy-agent: %s" CRLF CRLF, apapi_get_server_version());
write(sock, buffer, strlen(buffer));
}
else {
Explain0("Returning 200 OK Status");
rvputs(r, "HTTP/1.0 200 Connection established" CRLF, NULL);
- rvputs(r, "Proxy-agent: ", SERVER_VERSION, CRLF CRLF, NULL);
+ rvputs(r, "Proxy-agent: ", apapi_get_server_version(), CRLF CRLF, NULL);
bflush(r->connection->client);
}
1.37 +2 -2 apache-1.3/src/modules/standard/mod_info.c
Index: mod_info.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_info.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- mod_info.c 1998/02/20 10:44:35 1.36
+++ mod_info.c 1998/03/04 02:28:23 1.37
@@ -397,10 +397,10 @@
if (!r->args || !strcasecmp(r->args, "server")) {
rprintf(r, "<a name=\"server\"><strong>Server Version:</strong> "
"<font size=+1><tt>%s</tt></a></font><br>\n",
- SERVER_VERSION);
+ apapi_get_server_version());
rprintf(r, "<strong>Server Built:</strong> "
"<font size=+1><tt>%s</tt></a></font><br>\n",
- SERVER_BUILT);
+ apapi_get_server_built());
rprintf(r, "<strong>API Version:</strong> "
"<tt>%d</tt><br>\n",
MODULE_MAGIC_NUMBER);
1.79 +1 -1 apache-1.3/src/modules/standard/mod_rewrite.c
Index: mod_rewrite.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- mod_rewrite.c 1998/03/02 06:51:19 1.78
+++ mod_rewrite.c 1998/03/04 02:28:23 1.79
@@ -3282,7 +3282,7 @@
result = r->protocol;
}
else if (strcasecmp(var, "SERVER_SOFTWARE") == 0) {
- result = pstrdup(r->pool, SERVER_VERSION);
+ result = pstrdup(r->pool, apapi_get_server_version());
}
else if (strcasecmp(var, "API_VERSION") == 0) { /* non-standard */
ap_snprintf(resultbuf, sizeof(resultbuf), "%d", MODULE_MAGIC_NUMBER);
1.77 +4 -5 apache-1.3/src/modules/standard/mod_status.c
Index: mod_status.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- mod_status.c 1998/02/22 15:31:35 1.76
+++ mod_status.c 1998/03/04 02:28:24 1.77
@@ -323,11 +323,10 @@
rputs("<HTML><HEAD>\n<TITLE>Apache Status</TITLE>\n</HEAD><BODY>\n", r);
rputs("<H1>Apache Server Status for ", r);
rvputs(r, server->server_hostname, "</H1>\n\n", NULL);
-#if 0
- /* We don't do this until we resolve shared lib concerns */
- rvputs(r, "Server Version:", SERVER_VERSION, "<br>\n", NULL);
- rvputs(r, "Server Built:", SERVER_BUILT, "<br>\n<hr>\n", NULL);
-#endif
+ rvputs(r, "Server Version:", apapi_get_server_version(), "<br>\n",
+ NULL);
+ rvputs(r, "Server Built:", apapi_get_server_built(), "<br>\n<hr>\n",
+ NULL);
rvputs(r, "Current Time: ", asctime(localtime(&nowtime)), "<br>\n",
NULL);
rvputs(r, "Restart Time: ", asctime(localtime(&restart_time)), "<br>\n",
NULL);
1.8 +66 -0 apache-1.3/src/os/unix/os.h
Index: os.h
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/os/unix/os.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- os.h 1998/03/02 17:51:33 1.7
+++ os.h 1998/03/04 02:28:26 1.8
@@ -1,3 +1,67 @@
+/* ====================================================================
+ * Copyright (c) 1998 The Apache Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the Apache Group
+ * for use in the Apache HTTP server project (http://www.apache.org/)."
+ *
+ * 4. The names "Apache Server" and "Apache Group" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * [EMAIL PROTECTED]
+ *
+ * 5. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the Apache Group
+ * for use in the Apache HTTP server project (http://www.apache.org/)."
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Group and was originally based
+ * on public domain software written at the National Center for
+ * Supercomputing Applications, University of Illinois, Urbana-Champaign.
+ * For more information on the Apache Group and the Apache HTTP server
+ * project, please see <http://www.apache.org/>.
+ *
+ */
+
+#ifndef APACHE_OS_H
+#define APACHE_OS_H
+
+/*
+ * We can't include conf.h (where the hide.h stuff is done) because it
+ * includes us. So we do the hide.h stuff ourself.
+ */
+#ifdef HIDE
+#include "hide.h"
+#endif
+
/*
* This file in included in all Apache source code. It contains definitions
* of facilities available on _this_ operating system (HAVE_* macros),
@@ -61,3 +125,5 @@
#define os_dl_unload(l) dlclose(l)
#define os_dl_sym(h,s) dlsym(h,s)
#define os_dl_error() dlerror()
+
+#endif /* !APACHE_OS_H */