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
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
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