Last post Aug 23, 2011 09:51 AM by NozFx
Aug 22, 2011 04:44 AM|NozFx|LINK
I've developed a .NET 2.0 Asynchronous Handler that handles HTTP range requests. The reason I wanted to support this is I wanted Microsoft Background Intelligent Transfer Service (BITS) to connect to my handler to do partial downloads. Now when I test
this using ASP.NET debugging through Cassini and using Windows 7 BITS it works like a charm. As soon as I deploy the handler to my local IIS 7 BITS attempts the download but it appears to restart repeatedly before going into an error state. I assume the
range requests are being garbled as it gets so far and then restarts. I will start to debug the handler in IIS but I was wondering if anyone knows of the obvious thing that maybe going wrong here. Whats going to be the difference between it working in Cassini
and not in IIS?
I've set the virtual application in both classic and integrated modes with no difference. The authentication is annonymous. I have turned off session state in the web.config. The ASP.NET authentication config is set to Windows. I have not made any other
settings to the ASP.NET config otherwise.
Read this on MSDN for BITS download requirements:
BITS supports HTTP and HTTPS downloads and uploads and requires that the server supports the HTTP/1.1 protocol. For downloads, the HTTP server's Head method must return the file size and its Get method must support the Content-Range and Content-Length
headers. As a result, BITS only transfers static file content and generates an error if you try to transfer dynamic content, unless the ASP, ISAPI, or CGI script supports the Content-Range and Content-Length headers.
BITS can use an HTTP/1.0 server as long as it meets the Head and Get method requirements.
To support downloading ranges of a file, the server must support the following requirements:
•Allow MIME headers to include the standard Content-Range and Content-Type headers, plus a maximum of 180 bytes of other headers.
•Allow a maximum of two CR/LFs between the HTTP headers and the first boundary string.
Any IIS 7 gurus that could point me in the direction of making sure I meet these requirements. The ASP.NET handler already handles the range headers, IIS 7 must be blocking something here.
Aug 23, 2011 09:51 AM|NozFx|LINK
Sussed it. It turns out I had a race condition to do with checking modified
HTTP headers which worked in cassini but not in IIS. Basically an obscure bug
that I couldn't suss out. Trouble is I tried to get BITS to attach to Fiddler
proxy to see the requests but although I determined it was going through fiddler
the requests were not being logged. I used ip4.fiddler to get over localhost
problem and it still didn't work. Weird.