rse 98/02/28 00:12:50
Modified: src CHANGES htdocs/manual/mod mod_log_config.html src/modules/standard mod_log_config.c Log: Add %a to mod_log_config for inserting the remote IP-address. This is the adapted patch against 1.3 of Todd Eigenschink <[EMAIL PROTECTED]>'s original patch for 1.2.5. For 1.2.5 we don't want it because its a feature. I also added corresponding entries to the CHANGES and mod_log_config.html file. Submitted by: Todd Eigenschink <[EMAIL PROTECTED]> Reviewed by: Ralf S. Engelschall Revision Changes Path 1.672 +3 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.671 retrieving revision 1.672 diff -u -r1.671 -r1.672 --- CHANGES 1998/02/27 15:15:13 1.671 +++ CHANGES 1998/02/28 08:12:46 1.672 @@ -1,5 +1,8 @@ Changes with Apache 1.3b6 + *) Add the `%a' construct to LogFormat and CustomLog to log the client IP + address. [Todd Eigenschink <[EMAIL PROTECTED]>, PR#1885] + *) For testing purposes, I added a new source called main/util_uri.c; It contains a routine parse_uri_components_regex() and friends which tries to break an URI into its parts. These parts are stored in a new 1.24 +1 -0 apache-1.3/htdocs/manual/mod/mod_log_config.html Index: mod_log_config.html =================================================================== RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/mod_log_config.html,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- mod_log_config.html 1998/02/05 20:04:53 1.23 +++ mod_log_config.html 1998/02/28 08:12:48 1.24 @@ -110,6 +110,7 @@ %...f: Filename %...{FOOBAR}e: The contents of the environment variable FOOBAR %...h: Remote host +%...a: Remote IP-address %...{Foobar}i: The contents of Foobar: header line(s) in the request sent to the server. %...l: Remote logname (from identd, if supplied) 1.45 +9 -0 apache-1.3/src/modules/standard/mod_log_config.c Index: mod_log_config.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_log_config.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- mod_log_config.c 1998/02/27 15:15:28 1.44 +++ mod_log_config.c 1998/02/28 08:12:49 1.45 @@ -117,6 +117,7 @@ * %...{FOOBAR}e: The contents of the environment variable FOOBAR * %...f: filename * %...h: remote host + * %...a: remote IP-address * %...{Foobar}i: The contents of Foobar: header line(s) in the request * sent to the client. * %...l: remote logname (from identd, if supplied) @@ -276,6 +277,11 @@ REMOTE_NAME); } +static char *log_remote_address(request_rec *r, char *a) +{ + return r->connection->remote_ip; +} + static char *log_remote_logname(request_rec *r, char *a) { return (char *) get_remote_logname(r); @@ -432,6 +438,9 @@ { 'h', log_remote_host, 0 + }, + { + 'a', log_remote_address, 0 }, { 'l', log_remote_logname, 0