mod_annot editor

Annotate Section

Using Pools in Apache: Other Cases

Most Apache modules involve the initialisation and request-processing we have discussed. But there are two other cases to deal with:

Connection Functions

The pre_connection and process_connection connection-level hooks pass a conn_rec as first argument, and are directly analagous to request functions as far as pool resources are concerned. The create_connection connection-initialisation hook passes the pool as its first argument: any module implementing it takes responsibility for setting up the connection.

Filter Functions

Filter functions recieve an ap_filter_t as their first argument. This ambiguously contains both a request_rec and a conn_rec as members, regardless of whether it is a request-level or a connection-level filter. Request-level filters (those declared as AP_FTYPE_RESOURCE or AP_FTYPE_CONTENT_SET) should normally use the request pool. Connection-level filters will get a junk pointer in f->r and must use the connection pool. This can be a gotcha for the unwary!