dgaudet 98/03/09 21:14:20
Modified: src CHANGES
src/main util_script.c
Log:
The CGI spec says that REMOTE_HOST should be set to the remote hosts's
name, or left unset if this value is unavailable. Apache was setting
it to the IP address when unavailable.
PR: 1925
Submitted by: Tony Fincg <[EMAIL PROTECTED]>
Revision Changes Path
1.695 +5 -0 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.694
retrieving revision 1.695
diff -u -r1.694 -r1.695
--- CHANGES 1998/03/09 16:47:06 1.694
+++ CHANGES 1998/03/10 05:14:16 1.695
@@ -1,5 +1,10 @@
Changes with Apache 1.3b6
+ *) The CGI spec says that REMOTE_HOST should be set to the remote hosts's
+ name, or left unset if this value is unavailable. Apache was setting
+ it to the IP address when unavailable.
+ [Tony Fincg <[EMAIL PROTECTED]>] PR#1925
+
*) Various improvements to the configuration and build support for
compiling
modules as shared objects. Especially Solaris 2.x support with GCC and
WorkShop Compilers 4.2 was added. This way shared object support is now
1.99 +5 -2 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.98
retrieving revision 1.99
diff -u -r1.98 -r1.99
--- util_script.c 1998/03/04 02:28:17 1.98
+++ util_script.c 1998/03/10 05:14:19 1.99
@@ -185,6 +185,7 @@
#ifdef WIN32
char *env_temp;
#endif
+ const char *host;
array_header *hdrs_arr = table_elts(r->headers_in);
table_entry *hdrs = (table_entry *) hdrs_arr->elts;
@@ -239,8 +240,10 @@
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));
- table_setn(e, "REMOTE_HOST",
- pstrdup(r->pool, get_remote_host(c, r->per_dir_config,
REMOTE_NAME)));
+ host = get_remote_host(c, r->per_dir_config, REMOTE_HOST);
+ if (host) {
+ table_setn(e, "REMOTE_HOST", pstrdup(r->pool, host));
+ }
table_setn(e, "REMOTE_ADDR", c->remote_ip);
table_setn(e, "DOCUMENT_ROOT", document_root(r)); /* Apache */
table_setn(e, "SERVER_ADMIN", s->server_admin); /* Apache */