IIS 5 & IIS 6
Setting Bit Rate Throttle programmatically in ISAPI Extension
Last post Apr 16, 2009 02:55 PM by arjenw
Apr 13, 2009 09:46 AM|arjenw|LINK
Hello, When I use Bit Rate Throttling together with TransmitFile in my IIS Extension module this works fine and the default Media Format Rule(s) apply.
I am sending the MP4 file differently though. The metadata (the 'moov' atom) is send with Transmit file by specifing the pHead and HeadLength fields in (HSE_TF_INFO) and the actual movie data (the 'mdat' atom) is send with using the hFile (HANDLE).
Now the Bit Rate Throttling module doesn't kick in. I assume this is because BRT 'only' checks for rules in the given file and doesn't look in the memory that is passed in the header.
If that's the case, then a solution may be to programmatically specify the BRT variables ResponseThrottler-Enabled, ResponseThrottler-FileExtension and ResponseThrottler-EncodedBitRateKbps, but I am uncertain how to specify these variables?
I've tried to set them as part of the HSE_REQ_SEND_RESPONSE_HEADER_EX, but that doesn't seem to work.
I should mention that I am using an ISAPI Extension that has to be compatible with IIS 5.
So my question is: How can I set the BRT variables programmatically in a C++ ISAPI Extension module that is written for IIS 5 and works in IIS 7?
Apr 13, 2009 02:59 PM|anilr|LINK
You cannot set those server-variables using an ISAPI extension - you can only set them using a native/managed module/handler (CHttpModule/IHttpModule/IHttpHandler).
Apr 13, 2009 03:53 PM|arjenw|LINK
Thank you for your swift answer.
So basically I have two options:
1. Convert my IIS Extension to version 7 of the API.
2. Ask the writers of the Bit Rate Throttle module to take into account the header and footer fields (next to the actual FILE).
Is that correct? Or perhaps you have some more ideas, as I prefer not to create another branch for this module?
Apr 16, 2009 01:38 PM|anilr|LINK
Yes, those are the only 2 options I can think of.
Apr 16, 2009 02:55 PM|arjenw|LINK
Just wanted to say thank you for your anwers.