We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

PHP, HttpResponse.Filter and large (chunked) responses.RSS

2 replies

Last post Feb 01, 2010 03:40 AM by vyaces

  • PHP, HttpResponse.Filter and large (chunked) responses.

    Jan 27, 2010 03:20 PM|vyaces|LINK

    Hello guys! I’ve noticed one very strange behaviour. When I setup HttpResponse.Filter property and request a PHP-script which generates a very huge response (more than 5 Mb)—my filter does’t work. I’ve debugged it and found that after PHP handler (which works through FastCGI), IIS sends headers with “Transfer-Encoding: chunked” and calls a lot of SendRequest events. My filter is already set on this stage! But only after these SendRequest calls IIS follows to ReleaseRequestState and the Write method is executed. But since the whole body was already sent, the Write method isn’t actually executed. Only Close and Flush are executed. And as a result my filter doesn’t get the response at all! I’ve tried a large static file—everything is OK. The filter works with huge dynamic response, generated by ASP.NET as well. So the only problem is with PHP. I’ve been also trying to test dumb CGI. It doesn’t work as well, but acts with differences. Immediately after handler IIS calls SendRequest a few times and sends the whole body (of course this time it’s not chunked). Then it passes the body to my filter, which is pretty funny and useless, because a client already got the body. Dear IIS gurus, I really need your help in this. Have you faced with described situations? What would you suggest to me as an alternative? Because I really need to filter PHP responses. Thank you very much for your help and attention.
  • Re: PHP, HttpResponse.Filter and large (chunked) responses.

    Feb 01, 2010 03:16 AM|ksingla|LINK

    Hi Slava.

    Can you send me some sample code which I can try? My email id is ksingla [at] microsoft [dot] com.


  • Re: PHP, HttpResponse.Filter and large (chunked) responses.

    Feb 01, 2010 03:40 AM|vyaces|LINK

    Hello Kanwal! I’ve sent my code to you. Thank you for your response and help.