William A. Rowe, Jr. wrote:

The Enums look great, can we extend apr_query_mpm instead though?

One hurdle for doing that which affects applications is that query-mpm can only return a scalar value, so either an enum with all the granular states in it is needed or multiple query calls must be used by modules that want to know the nuances (e.g., beyond whether or not we're stopping, I wanna know if it is a graceful stop or a hard stop)


Another issue with using the query-mpm function is that the MPM doesn't know about pre/post config hooks.

I like the structure representation because we can add more types of nuances later without breaking existing apps. We can't do that with a single enum that maps everything. It seems friendlier for the app to be able to get a detailed state of the server with a single call and not have to worry about nuances of which part is known by the core code and which part is known by the MPM.

There are various cons for either approach. With the one I outlined, how does core know some of the info that only the MPM knows? We either use the existing query-mpm function, or some new function ap_set_server_state() that the MPM will call when some state transition is made.

I put the declarations below on the list because we had some conversations on the list stall last week, and Sander and I didn't get through discussing it, and I thought it would be nice to show some code.

At 05:17 PM 11/16/2003, Jeff Trawick wrote:

If Sander hadn't gone awol this wouldn't be so fubar. Any comments?

ap_server_state_t {

enum {AP_STARTING, AP_STARTED, AP_STOPPING} state;

enum {AP_FIRST_START, AP_SUBSEQUENT_START} start_type; /* if AP_STARTING */

enum {AP_GRACEFUL_STOP, AP_HARD_STOP} stop_type; /* if AP_STOPPING */

int         init_hook_last_pass; /* boolean; if AP_STARTING;
                                    gives hints to pre/post config hook
                                    for those that need to do something
                                    exactly once */
};

/* server maintains a global ap_server_state_t...  ap_get_server_state()
* returns address of it */

void ap_get_server_state(ap_server_state_t **);





Reply via email to