View | Details | Raw Unified | Return to bug 49328
Collapse All | Expand All

(-)include/util_filter.h (-4 / +7 lines)
Lines 217-226 Link Here
217
    /** The function to call when this filter is invoked. */
217
    /** The function to call when this filter is invoked. */
218
    ap_filter_func filter_func;
218
    ap_filter_func filter_func;
219
219
220
    /** The function to call before the handlers are invoked. Notice
220
    /** The function to call directly before the handlers are invoked
221
     * that this function is called only for filters participating in
221
     * for a request.  The init function is called once directly
222
     * the http protocol. Filters for other protocols are to be
222
     * before running the handlers for a request or subrequest.  The
223
     * initialized by the protocols themselves.
223
     * init function is never called for a connection filter (with
224
     * ftype >= AP_FTYPE_CONNECTION).  Any use of this function for
225
     * filters for protocols other than HTTP is specified by the
226
     * module supported that protocol.
224
     */
227
     */
225
    ap_init_filter_func filter_init_func;
228
    ap_init_filter_func filter_init_func;
226
229
(-)server/config.c (-4 / +8 lines)
Lines 312-321 Link Here
312
    return create_empty_config(p);
312
    return create_empty_config(p);
313
}
313
}
314
314
315
static int ap_invoke_filter_init(ap_filter_t *filters)
315
/* Invoke the filter_init_func for all filters with FILTERS where f->r
316
 * matches R.  Restricting to a matching R avoids re-running init
317
 * functions for filters configured for r->main where r is a
318
 * subrequest.  */
319
static int invoke_filter_init(request_rec *r, ap_filter_t *filters)
316
{
320
{
317
    while (filters) {
321
    while (filters) {
318
        if (filters->frec->filter_init_func) {
322
        if (filters->frec->filter_init_func && filters->r == r) {
319
            int result = filters->frec->filter_init_func(filters);
323
            int result = filters->frec->filter_init_func(filters);
320
            if (result != OK) {
324
            if (result != OK) {
321
                return result;
325
                return result;
Lines 354-364 Link Here
354
     * run their init function to let them do any magic before we could
358
     * run their init function to let them do any magic before we could
355
     * start generating data.
359
     * start generating data.
356
     */
360
     */
357
    result = ap_invoke_filter_init(r->input_filters);
361
    result = invoke_filter_init(r, r->input_filters);
358
    if (result != OK) {
362
    if (result != OK) {
359
        return result;
363
        return result;
360
    }
364
    }
361
    result = ap_invoke_filter_init(r->output_filters);
365
    result = invoke_filter_init(r, r->output_filters);
362
    if (result != OK) {
366
    if (result != OK) {
363
        return result;
367
        return result;
364
    }
368
    }

Return to bug 49328