And here is the main logic loop:
CString strSrc("http://download.howudodat.com/chatterbox/download/client/");
strSrc << csFile << ".ggz";
HRESULT hr = URLDownloadToFile ( NULL, strSrc, strDestZ, 0, this );
if ( SUCCEEDED(hr) ) {
// decompress it
}
else
FormatMessage(...)
URLDownloadToFile returns 800401E4 - Invalid Syntax....I'm really stumped on
this one! The crazy thing is that sometimes it works and sometimes it
doesn't...right now it's not working again so I can try and troubleshoot it.
Peter
"Peter Carlson" <peter@__N.O.S.P.A.M__howudodat.com> wrote in message
news:efwUVzKG...@TK2MSFTNGP09.phx.gbl...
The problem has to do with the fact that the file is a gzip file and
urlmon.dll (or some other system dll) is trying to decompress the file. #1
I dont want it to do that and I cant find a way to turn that feature off.
However somewhere along the line this feature got SERIOUSLY BROKE in MS
libraries. Go figure huh! The end result is an impossible to troublshoot
undocumented "Invalid Syntax" error message. It does not occur on all
systems, but somewhere in all the web and google searches, it's related to a
patch, I dont remember the number and now I really dont care.
Workaround, when we build the gzip file we swap the first two bytes of the
resulting file so the web server and browser wont recognize it as a gzip
file. Voila, no more Invalid Syntax errors.
So much for MS QA department...oh never mind that's right MS uses their
customers and poor sap programmers like us to QA....Sorry I forgot.
Peter
"Peter Carlson" <peter@__N.O.S.P.A.M__howudodat.com> wrote in message
news:efwUVzKG...@TK2MSFTNGP09.phx.gbl...
There's none as far as I know. You can drop down to WinInet level -
WinInet does not decode gzip-encoded data, it gives you the content as
served.
However somewhere along the line this feature got
> SERIOUSLY BROKE in MS libraries. Go figure huh! The end result is
> an impossible to troublshoot undocumented "Invalid Syntax" error
> message. It does not occur on all systems, but somewhere in all the
> web and google searches, it's related to a patch, I dont remember the
> number and now I really dont care.
Yes, I had this problem with gzip - at some point, it just broke. After
a lot of research, it turned out that gzip is broken whenever you use
push mode (which is the only mode supported by URLDownloadToFile). Gzip
still works if you use pull mode (see BINDF_PULLDATA), either with
URLOpenPullStream or just using URL Moniker directly
(IMoniker::BindToStorage).
Pull mode is harder to implement. It's always asynchronous, and you have
to have IBindStatusCallback implementation doing real work. However, it
is much more reliable in my experience. MSHTML uses pull mode
internally, so it probably gets a lot of testing at MS.
This was a couple of years ago, and I'm using pull mode exclusively ever
since, that's probably why your problem did not ring a bell. I should
have suspected gzip from the beginning. Sorry for making you do all this
work, while sitting on the answer the whole time.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
Now on to the other bugs I have :)
Peter