httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject Re: [PATCH]: Update request in connection based filters
Date Wed, 18 Sep 2002 13:41:40 GMT
There is another possibility to fix this, and that's within the module
itself (I've tested it and it works):

--------------------------------------------------
static void logio_create_req(request_rec *r) {
    ap_filter_t *f;
    conn_rec *c = r->connection;

    /* Tie connection filters with request */
    for (f = c->input_filters; f; f = f->next)
        f->r = r;

    for (f = c->output_filters; f; f = f->next)
        f->r = r;
}

static void register_hooks(apr_pool_t *p) {
    ap_hook_pre_connection(logio_pre_conn, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_create_request(logio_create_req, NULL, NULL,
APR_HOOK_MIDDLE);
    
    ap_register_input_filter(logio_filter_name, logio_in_filter, NULL,
                             AP_FTYPE_CONNECTION);
    ap_register_output_filter(logio_filter_name, logio_out_filter, NULL,
                              AP_FTYPE_CONNECTION);
}
--------------------------------------------------

Since this looks like modules own business, it seems like a good
compromise to me. What do you guys think?

Also, I've think that the correct thing to do in mod_logio is to be
AP_FTYPE_CONNECTION + 6, since SSL is AP_FTYPE_CONNECTION + 5, and we
want to be before it in input filtering and after it in output
filtering. I have the module working with r->notes for now.

Bojan

On Wed, 2002-09-18 at 13:22, rbb@apache.org wrote:
> 
> You don't want to do this.  A connection based filter is connection
> oriented.  By definition, it has no concept of a request.  While this
> might make sense for HTTP, other protocol modules will have a much harder
> time with this change.
> 
> Ryan


Mime
View raw message