Bug 53981 - move def of log_request_state from mod_log_config.c to mod_log_config.h
Summary: move def of log_request_state from mod_log_config.c to mod_log_config.h
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_log_config (show other bugs)
Version: 2.4.3
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-08 18:04 UTC by Daniel Lescohier
Modified: 2012-10-15 15:54 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Lescohier 2012-10-08 18:04:49 UTC
I'd like this:

/*
 * log_request_state holds request specific log data that is not
 * part of the request_rec.
 */
typedef struct {
    apr_time_t request_end_time;
} log_request_state;

moved from mod_log_config.c to mod_log_config.h.

The reason is that I have a custom module that registers log handler functions with mod_log_config, and one of the custom handlers is a GMT version of log_request_time. Currently, I make a copy of this typedef in my custom module. However, my custom module already includes mod_log_config.h (needed to get the definition for ap_register_log_handler), so I think this typedef should also go there; in case the structure changes in a future version, I'd automatically get the new definition.

A reason for my module to re-use the state variable used by mod_log_config, instead of storing it's own module-specific state variable in the request_rec, is in the case that you log the request end time in both localtime and gmtime, you'd have the end time saved once, which prevents different seconds being logged if the second log item happened to be after the clock ticked over to the next second.