I did find a work-around, but it is not pretty:

while httpcli.State <> httpready do
  begin
  a:=a+1;
  log.Lines.add('Waiting '+inttostr(a));
  application.ProcessMessages;
  end;

This is only needed after a 302.  The counter ranges from 400-1000 before 
the state turns to httpready.  And I am not sure that they are real 302s. 
The same pages give a statuscode of 302 consistently when downloaded in the 
same order, but may give a 200 if downloaded in a different order.  Could a 
bug in my program make httpcli give a fake 302 statuscode?
(The above code gives an infinite loop if application.processmessages is 
removed)


----- Original Message ----- 
From: "Ronny" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Saturday, February 25, 2006 10:08 AM
Subject: Re: [twsocket] HttpCli problem


> The problem is that the STATE is not ready after the abort, so when I use
> httpcli to grab another file after a 302, I would get an error. (http
> component busy, I think).
> After an abort in such a case, is there anything that I have to do to make
> sure that the component is ready for the next use?
> (This only happens after a 302, anything else (200, 404, etc) works well.)
> -Ronny
>
> ----- Original Message ----- 
> From: "Francois PIETTE" <[EMAIL PROTECTED]>
> To: "ICS support mailing" <twsocket@elists.org>
> Sent: Saturday, February 25, 2006 3:59 AM
> Subject: Re: [twsocket] HttpCli problem
>
>
>>> After httpcli.abort is called, the statuscode is normally 404 if the
>>> statuscode before the call is 200.  The statuscode is 0 if the original
>>> statuscode is 302.  This is causing me problems (i.e. httpcli state is
>>> not
>>> ready after an abort is called if the statuscode was 302).  See example:
>>>
>>>  log.Lines.Add(inttostr(httpcli.StatusCode);
>>>  httpcli.abort;
>>>  log.Lines.Add(inttostr(httpcli.StatusCode);
>>>
>>> D7, ICS V6 beta V1.91
>>
>> StatusCode value is valid only when or after OnRequestDone has been
>> triggered.
>> Anyway, if you abort, you obviously know what you are doing. No need to
>> rely
>> on StatusCode.
>>
>> --
>> [EMAIL PROTECTED]
>> http://www.overbyte.be
>>
>> -- 
>> To unsubscribe or change your settings for TWSocket mailing list
>> please goto http://www.elists.org/mailman/listinfo/twsocket
>> Visit our website at http://www.overbyte.be
>
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to