]> granicus.if.org Git - apache/commitdiff
Merge r1648719 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 12 Jan 2015 13:59:57 +0000 (13:59 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 12 Jan 2015 13:59:57 +0000 (13:59 +0000)
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

CHANGES
STATUS
support/split-logfile.in

diff --git a/CHANGES b/CHANGES
index 5cfa3c86a406e1b300b70dc7f8a793c00d8efd95..77415730108466f8400da9580ed404348bc4b71f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -21,6 +21,10 @@ Changes with Apache 2.4.11
      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>]
diff --git a/STATUS b/STATUS
index 378d273fc264a50910b18b035ac53aa5e3398351..d5bc41c85b3c498490f736d26761818dd5efe89c 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -110,11 +110,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      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.
index 59eda713f9a64cee7aa56a78e5d3b75be32f331c..e5abfc7d250040d3b33b82c1262322612ffcefa0 100644 (file)
@@ -29,7 +29,7 @@
 use strict;
 use warnings;
 
-my %is_open = ();
+my %log_file = ();
 
 while (my $log_line = <STDIN>) {
     #
@@ -54,10 +54,9 @@ 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
@@ -65,6 +64,6 @@ while (my $log_line = <STDIN>) {
     # record to the current log file.
     #
     $log_line =~ s/^\S*\s+//;
-    printf $vhost "%s", $log_line;
+    print {$log_file{$vhost}} $log_line;
 }
 exit 0;