Apache Modules!
Heya LQ, it's been almost a year since I've been on here, but I've got a question!!
I'm writing a module for Apache 2.2, and I'm able to get the module loading correctly and modifying the response content.. That part is all good - but! I have to check the content type, the URI etc to check whether I should be transforming said resource or leave it alone.
The problem is, in my output filter which takes "ap_filter_t *f", f->r is of type request_rec with the information about the request... However, f->r->headers_in and headers_out, uri, unparsed_uri, parsed_uri and all the useful stuff is null!! f->r->args is not null and I can use ap_get_server_name() to get the virtual host and concatenate it with args to get the URI but I also need f->r->content_type, and that's null too...
In all the modules I've looked at (eg mod_deflate.c in the Apache source) and numerous other examples, there's absolutely no hint to what they're doing to be able to obtain the data from these structs.
My question: Does anyone out there know why these values are null, or if there's another handler/filter that populates these values, or a flag I have to set? I can't be the only one in the world with this problem, so if anyone's ever had a similar issue, please let me know how you got on!
Cheers all,
Aaron
EDIT: Issue resolved (problem with libapr headers and the size of apr_off_t)
Last edited by nevelis; 10-22-2008 at 07:33 PM.
|