]> granicus.if.org Git - apache/commitdiff
Merge r1429564 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 11 Mar 2013 16:33:42 +0000 (16:33 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 11 Mar 2013 16:33:42 +0000 (16:33 +0000)
Use ap_bin2hex instead of sprintf(..., "%02x". It gives the same output and is faster.

No real speedup should be achieved on production machine, because this is done
only for characters that need to be escaped.
However, this will close PR 50919.

Submitted by: jailletc36
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1455222 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/loggers/mod_log_forensic.c

diff --git a/STATUS b/STATUS
index a004c46941c1cf10f795621c5df0bebddb242ca6..a448bc608e38fed4d6b5360b64d3d521de972daa 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -117,11 +117,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
     2.4.x cumulative patch: http://people.apache.org/~jailletc36/backport5.patch (minus CHANGES for 1448171)
     +1: jailletc36, igalic, jim
 
-  * mod_log_forensic: Speed up logging of characters that need to be escaped. PR 50919
-    trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1429564
-    2.4.x patch: trunk patch applies.
-    +1: jailletc36, humbedooh, jim
-
   * ssl_util_ssl: Speed up logging function by x4 using ap_bin2hex intoduced in 2.4.4
     It will be in lowercase instead of uppercase, but it is only for logging. I don't think this is a real issue.
     trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1429559
index 1be123024b04d2c899cb15c7362ef560bd3f12c4..bb808e88887b74860b05db7621beed4c395d0d76 100644 (file)
@@ -126,7 +126,7 @@ static char *log_escape(char *q, const char *e, const char *p)
         if (test_char_table[*(unsigned char *)p]&T_ESCAPE_FORENSIC) {
             ap_assert(q+2 < e);
             *q++ = '%';
-            sprintf(q, "%02x", *(unsigned char *)p);
+            ap_bin2hex(p, 1, q);
             q += 2;
         }
         else