🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #4744

Re: TIdHTTP OnWork

#4744
From: Ted Tripp
Date: Fri, 24 Dec 2004 18:50
53 lines
3064 bytes
Thanks Remy

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:41c93d7b$1@newsgroups.borland.com...
>
> "Ted Tripp" <ttripp@rankexec.com> wrote in message
> news:41c90294$1@newsgroups.borland.com...
>
>> I am running into a situation where, when doing a Get on a particular
> page(s),
>> the data comes in chunks.
>
> That is likely if the content is large.
>
>> In other words the WorkStart event occurs maybe ten times for a
>> single page, thus causing the OnWork to occur 10+ times on the
>> same page.
>
> OnWork is usually triggered in a loop by Indy reading data streams in
> fixed-sized pieces internally.
>
> If you are getting multiple OnWorkBegin events, it is likely that the HTTP
> server itself is sending the data in multiple blocks rather than one
> continuous stream (the "Transfer-Encoding" header is set to "chunked").
> Thus TIdHTTP has to read the data in multiple blocks and then piece them
> back together.  Each block would have its own set of
> OnWorkBegin/OnWork/OnWorkEnd events being triggered, because TIdHTTP has 
> no
> way of knowing ahead of time how much many blocks are being sent or how
> large each block is.  The OnWork event will not provide an accurate count,
> though, because TIdHTTP will be calling ReadLn() during a chunked 
> transfer.
> ReadLn() triggers OnWork as well, so the total reported count will not be
> the same as the Size of the data actually being returned to you in the 
> final
> response.
>
>> Is this a result of the RecBuf size I set
>
> No.  The triggering of the OnWork events is directly related to how the 
> data
> is being transferred, not how large the data is.
>
>> and if so, how do I get an accurate total of data received.
>
> You could query the TIdHTTP.Response.ContentStream.Size property during 
> the
> transfer.
>
>
> Gambit
>
> 
Technical Details
Message-ID: <41cc64ea$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41c89ab7$1@newsgroups.borland.com> <41c8a682$1@newsgroups.borland.com> <41c90294$1@newsgroups.borland.com> <41c93d7b$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,a208acfa73369e15
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Ted Tripp" <ttripp@rankexec.com>
From: "Ted Tripp" <ttripp@rankexec.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <41c89ab7$1@newsgroups.borland.com> <41c8a682$1@newsgroups.borland.com> <41c90294$1@newsgroups.borland.com> <41c93d7b$1@newsgroups.borland.com>
Subject: Re: TIdHTTP OnWork
Date: Fri, 24 Dec 2004 12:50:16 -0600
Lines: 55
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 216.160.57.213
Message-ID: <41cc64ea$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1103914218 216.160.57.213 (24 Dec 2004 10:50:18 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail