httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Høgedal <stud...@itu.dk>
Subject Apache input filter
Date Sat, 26 May 2007 14:08:45 GMT
I am currently writing a Thesis with the pupose of constructing a security
module for the Apache Webserver based on information send by client
requests. To do this i need to acquire POST data when a POST request is
made, but still preserving the POST data for the content generator. I
decided to implement an input filter to carry out this task. Now the filter
is doing what is is suppose to do, but it does it at the wrong time. I seems
the filter is activated after the content generator (as an output filter)
and not before. So i tried constructing a simple input filter that in
reality does do anything. But it is still running as an outputfilter.

I made this simple input filter but the problem remains:

 

 

int do_nothing_input_filter(ap_filter_t *f, apr_bucket_brigade *bb,
ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes){

                      request_rec *r = f->r;

                      int rv;

                      rv= ap_get_brigade(f->next,bb,mode,block,readbytes);

                      return rv;

}

 

static void RegisterHooks(apr_pool_t *p){

 ap_register_input_filter("do_nothing", do_nothing_input_filter, NULL,
AP_FTYPE_RESOURCE) ;

}

 

 

 

module AP_MODULE_DECLARE_DATA do_nothing_module = 

                      {

    STANDARD20_MODULE_STUFF,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    RegisterHooks

};

}

 

(You might recognise the do_nothing_input_filter from Nick Kew’s Book).

 

Activating the module through httpd.conf:

 

SetInputFilter "do_nothing"

 

Writing to the log in the input filter and from the the PHP Content
generator shows that the content generator is activated before the input
filter. So how do you make an actual input filter?

 

Im using Apache 2.2.2 if this helps anyone.

 

I know this is probably a simple question for most of you but it seems tough
for me though.

 

This is my first try at mailinglists so hopefully I haven’t done anything
wrong.

 

Thank you fo your input.

 

Martin.

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message