October 25, 2007

URLOpenBlockingStream() won't work with ISS compression.

In C++, URLOpenBlockingStream() method creates a blocking type stream object from a URL and downloads the data from the Internet.

We had issue where user was getting exceptions while using this method. Apparently it was happening due to ISS compression enabled on sever.

On a Windows 2003 Server (IIS 6 and compression are only available on this platform), you find the metabase.xml file. Right click on the file and click edit.

In the metabase.xml, you delete the asp file extension from the deflate and gzip compression sections (highlighted in red below)



<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/deflate"
HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
HcCreateFlags="0"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="FALSE"
HcDynamicCompressionLevel="0"
HcFileExtensions="htm
html
txt"

HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="exe

asp
dll"

>
</IIsCompressionScheme>
<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/gzip"
HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
HcCreateFlags="1"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="TRUE"
HcDynamicCompressionLevel="0"
HcFileExtensions="htm
html
txt"

HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="exe

asp
dll"
>