Thread: Apache filters

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    2
    Rep Power
    0

    Apache filters


    Dear colleagues
    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?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    2
    Rep Power
    0
    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
    ap_get_brigade(f->next,pbbIn,mode,block,readbytes);

    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.

IMN logo majestic logo threadwatch logo seochat tools logo