IdHttp 304 Response

Giganews Newsgroups
Subject: IdHttp 304 Response
Posted by:  Ariel (
Date: Mon, 28 Aug 2006

Hello. I'm using the TIdHttp component, and I have a problem. When the
return code is 304, the component tries to read content, but there
isn't any content to read, so it waits until the timeout occurs.

I debug it and it happens in IdHttp.pas in line 1035:

"if AResponse.ContentLength > 0 then // If chunked then this is also 0"

then it goes into IOHandler.ReadStream(...).

is there any way to solve that? I think that when there is a 304
responsecode, it should just return an empty content, as fast as
posible. no?

I was looking at the ICS implementation and found this:

Mar 12, 2004 Fixed GetHeaderLineNext to check for StatusCode < 200, 204
            304 in order to not wait for body.