Discussion:
Problem with Indy + TidHttp + Deflate + IIS
(too old to reply)
dk_sz
2008-07-22 20:25:39 UTC
Permalink
Hi,



I am having problems with some IIS servers and
enabling GZIP/defalte compression in TidHttp.

...

Using D2007 R2 Pro. The latest working fulgan build
I have is from 2007 December (Could not get 2008
April to work due to a Indy/FastMM issue)

...

I create a TidHTTP like this:

FCompressorZLib := TIdCompressorZLib.Create;
FHTTP.Request.AcceptEncoding := 'gzip,deflate,identity';
FHTTP.Compressor := FCompressorZLib;
FHTTP.Request.Accept := 'Accept:
text/xml,application/xml,application/xhtml+xml,text/html,text/plain,*/*';
FHTTP.Request.AcceptCharSet := 'Accept-Charset: utf-8,*;q=0.5';

Then get/connect like this:
FHTTP.GET('AFAIK: IIS website *deflate* compression');
...And you get decompression error exception.

[I can email some examples, but would prefer not to post
customers website URLs here until I have permission]


I suspect it may be Indy/IIS disagreeing on "deflate"
(see comments: http://blog.marcocantu.com/blog/deflatingblog.html)
Perhaps the header that is wrong?

...

Anyways, at this point everything goes wrong afterwards.

Even if one does not use persistent connections,
the cookies / cookiemanager gets out of sync...

And with persistent connections, the socket/buffer is in
error/dirty state? And will yield exceptions and errors :-(

It does not help to:
FHTTP.Request.AcceptEncoding := 'identity';
FHTTP.Compressor := nil;



1)
Is there any way to "reset" tidhttp properly?

2)
How do I prevent this from happening? I think there is
an Indy/IIS issue as well, but maybe it is my usage that is
wrong? (Or perhaps something wrong in ZLib/version?)



best regards
Thomas Schulz
Remy Lebeau (TeamB)
2008-07-23 01:14:15 UTC
Permalink
Could not get 2008 April to work due to a Indy/FastMM issue
What issue is that? Have you tried using any newer snapshots since April?
text/xml,application/xml,application/xhtml+xml,text/html,text/plain,*/*';
FHTTP.Request.AcceptCharSet := 'Accept-Charset: utf-8,*;q=0.5';
You need to remove the prefixes from those string values:

FHTTP.Request.Accept :=
'text/xml,application/xml,application/xhtml+xml,text/html,text/plain,*/*';
FHTTP.Request.AcceptCharSet := 'utf-8,*;q=0.5';
Perhaps the header that is wrong?
Have you looked at the actual headers yet?
Is there any way to "reset" tidhttp properly?
Given the symptoms you have described, I would suggest simply destroying and
recreating it.


Gambit

Loading...