Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Feb : IdHttp: OnHeaderReceived?

www.cryer.info
Managed Newsgroup Archive

IdHttp: OnHeaderReceived?

Subject:IdHttp: OnHeaderReceived?
Posted by:"Werner Lehmann" (forums@remove.dm17.deletethis.com)
Date:Sun, 13 Feb 2005 18:07:01

Hi,

to resume a partial download with TIdHttp, is there a way to avoid an
additional HEAD request just to learn whether the server supports
content ranges on the requested URI? Theoretically it should be possible
to examine the received header after a GET request and if the server
does not support content ranges the content stream could be reset to
zero size.

It seems that this cannot be done with TIdHttp because
- it remembers the current stream position first thing in the
DoRequest() method which might confuse it if I set the position or size
to 0 later on.
- I don't know where to kick in to process the GET header just before
the actual entity is received. I tried OnWorkBegin but at this point the
stream's size has increased by ContentLength bytes already.

Do I really have to issue an additional HEAD request?

Werner

Replies:

www.cryer.info
Managed Newsgroup Archive