October 6th, 2012, 06:16 AM
I need some help in Apache filter programming on C from high-experienced specialists. I am not novice in Apache filters and would be useful for other participants. Does my interest correspond to general direction of this forum?
October 8th, 2012, 03:27 AM
So, I try to describe my problem. I wrote the input filter, and it works. The header of this filter is:
static apr_status_t gate_in_filter( ap_filter_t *f, apr_bucket_brigade *pbbOut, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes)
It read the input brigade by
then split it into buckets, filter it accordingly with my business logic, form pbbOut-brigade and finish. All was right, while I faced with requests, that consist of several brigades. I solved problem in following way. I wrapped ap_get_brigade by infinite cycle for(; ; ), that breaked, if I found EOS-bucket at brigade or get empty brigade (without buckets). In this cycle I gather all data from all coming brigades, filter it, concatenate in ONE brigade pbbOut, then finish. It works too. But for some large requests number of brigades excceeds some limit, and one resulting brigade for that request becomes the bad solution: my input filter finishes successfully, but Apache further down in "Segmentation fault" and request does not achieve web-server. So, my question is: how I can send out in filter chain gathered data by MULTIPLE BRIGADES, not the only pbbOut? Does the Apache development technique allow that? Or I have to rebuild in some way my input filter? Could anybody give me qualified advice? Thanks in advance.