Skip to content

Commit

Permalink
Merge r1429564 from trunk:
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jim Jagielski committed Mar 11, 2013
1 parent 8231607 commit bec4b54
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions STATUS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/loggers/mod_log_forensic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bec4b54

Please sign in to comment.