ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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!
EDIT: Issue resolved (problem with libapr headers and the size of apr_off_t)