split-logfile: Fix perl error: 'Can't use string ("example.org:80")
as a symbol ref while "strict refs"'. PR 56329.
Submitted By: Holger Mauermann <mauermann gmail.com>
Committed By: covener
Submitted by: covener
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1651095 13f79535-47bb-0310-9956-
ffa450edef68
request headers earlier. Adds "MergeTrailers" directive to restore
legacy behavior. [Edward Lu, Yann Ylavic, Joe Orton, Eric Covener]
+ *) split-logfile: Fix perl error: 'Can't use string ("example.org:80")
+ as a symbol ref while "strict refs"'. PR 56329.
+ [Holger Mauermann <mauermann gmail.com>]
+
*) mod_proxy: Prevent ProxyPassReverse from doing a substitution when
the URL parameter interpolates to an empty string. PR 56603.
[<ajprout hotmail.com>]
2.4.x patch: https://issues.apache.org/bugzilla/attachment.cgi?id=32209
+1: druggeri, gsmith, rjung
- * split-logfile: Fix perl strict refs error PR56329.
- trunk patch: 1648719
- 2.4.x patch: trunks works
- +1 covener, rjung, jim
-
* mod_proxy_ajp: Fix get_content_length().
clength in request_rec is for response sizes, not request body size.
It is initialized to 0, so the "if" branch was never taken.
use strict;
use warnings;
-my %is_open = ();
+my %log_file = ();
while (my $log_line = <STDIN>) {
#
# If the log file for this virtual host isn't opened
# yet, do it now.
#
- if (! $is_open{$vhost}) {
- open $vhost, ">>${vhost}.log"
+ if (! $log_file{$vhost}) {
+ open $log_file{$vhost}, ">>${vhost}.log"
or die ("Can't open ${vhost}.log");
- $is_open{$vhost} = 1;
}
#
# Strip off the first token (which may be null in the
# record to the current log file.
#
$log_line =~ s/^\S*\s+//;
- printf $vhost "%s", $log_line;
+ print {$log_file{$vhost}} $log_line;
}
exit 0;