Running Apache 2.2.4 on Windows 2003 server, I have two problems with an 
external filter written in C.  The Apache server is running as a reverse 
proxy. 

   1)  The filter is often called with no data passed to it and 
_eof(stdin) indicates the end of file.  I inserted a debug statement in 
mod_ext_filter that shows prior to the filter being called, no data is 
read from the bucket, so nothing is piped into stdin for the filter to 
read.  Yet, after the external filter exits, the client receives the 
entity body which is hundreds or thousands of bytes long. 

   One possible clue, a mod_ext_filter debug statement reports a 
content-type of 'unspecified' when calling the external filter, however 
the HTTP response has a content-type of text/plain when the received by 
the client.  The external filter does not modify the content or 
content-type.

  And more strange, if the response from the origin server is slow (a few 
seconds), the entity body DOES get passed to the external filter.

 2)  When receiving a response with large entity body, such as a 500 KB 
jpg, the filter gets passed the first 7746 bytes and nothing else.  The 
client receives the full response.

  The Apache documentation refers to a 'standard Unix filter model', but I 
am unable to find an example of any Unix filter, let alone a well-behaved 
one.  My filter reads from stdin, examines the data, then writes them to 
stdout.  It seems to function correctly for the most part, but I sure 
would like to compare it to another, well-tested external filter. 

  I've spent many days trying to get around these problems by disabling 
chunking, forcing the proxy to use HTTP 1.0, recoding my I/O processing 
multiple times, etc., all to no avail.  Could someone shed some light on 
these problems?  I need to get this filter working very soon.

Thanks,
 Mark Zetts 
 

Reply via email to