Fix crash in mod_log_config when logging
request end time for a failed request
(LogFormat contains %{end}t).
The request_config for mod_log_config might
not be initialized.
PR 54828.
Submitted by: rjung
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1467981 13f79535-47bb-0310-9956-
ffa450edef68
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_log_config: Fix crash when logging request end time for a failed request.
- PR 54828
- trunk patch: http://svn.apache.org/r1467765
- 2.4.x patch: trunk patchs applies
- +1: rjung, covener, jim
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
{
log_request_state *state = (log_request_state *)ap_get_module_config(r->request_config,
&log_config_module);
+ if (!state) {
+ state = apr_pcalloc(r->pool, sizeof(log_request_state));
+ ap_set_module_config(r->request_config, &log_config_module, state);
+ }
if (state->request_end_time == 0) {
state->request_end_time = apr_time_now();
}