This includes two changes to APR:
* new functions apr_itoa, apr_ltoa, and apr_off_t_toa
that provide itoa-type functionality based on pools
* Inline code in inet_ntop4 to replace sprintf for converting
binary IP addresses into dotted-decimal format
and two changes to Apache:
* use the apr_itoa functions in setting the content length,
in place of apr_psprintf
* use the apr_itoa functions to replace frequent uses of
'sprintf("%d",...)' in mod_log_config.
Submitted by: Brian Pane
Reviewed by: Dean Gaudet, Greg Ames
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89686
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.0.22-dev
+
+ *) Use new APR number conversion functions to reduce CPU consumption
+ when setting the content length, and in mod_log_config.
+ [Brian Pane]
+
*) Fix problem reported by Taketo Kabe <kabe@sra-tohoku.co.jp>
where HEAD response headers were being repeated twice for
files greater than 32K bytes (4*AP_MIN_BYTES_TO_WRITE). This
static char *format_integer(apr_pool_t *p, int i)
{
- return apr_psprintf(p, "%d", i);
+ return apr_itoa(p, i);
}
static char *pfmt(apr_pool_t *p, int i)
return "-";
}
else {
- return apr_psprintf(r->pool, "%ld", r->bytes_sent);
+ return apr_ltoa(r->pool, r->bytes_sent);
}
}
{
r->clength = clength;
apr_table_setn(r->headers_out, "Content-Length",
- apr_psprintf(r->pool, "%" APR_OFF_T_FMT, clength));
+ apr_off_t_toa(r->pool, clength));
}
/*