Re: [twsocket] THttpCli v6 - Relocation Problem

2006-07-25 Thread Frans van Daalen

- Original Message - 
From: "Arno Garrels" <[EMAIL PROTECTED]>
To: "ICS support mailing" 
Sent: Tuesday, July 04, 2006 7:29 PM
Subject: Re: [twsocket] THttpCli v6 - Relocation Problem


> Frans van Daalen wrote:
>> Arno,
>>
>> I tested this url and your change (only GetHeaderLineNext) and yes
>> with connection "keep-alive" of no setting on connection all is fine.
>> However with connection set to "close" the relocation fails on the
>> third one. If I try to find where it hangs it shows
>>
>> DoRequestSync
>> Application.ProcessMessages
>> with fstate = httpwaitingbody.
>
> Hmm, I'm still not familiar with this component (looks rather 
> complicated),
> however that error doesn't happen if I include the second change. Just 
> tested
> HTTP1.1 with Connection := 'Close' successfully, are you able to
> reproduce the same?
>
> Arno

mhhh, just found some time to continue... At this moment without your second 
change also a "Close" will work correctly...It seems that the 
httpwaitingbody already had a startrelocation implementated so I think that 
during the tests the server responded rather slow on a connection "close"

...goes away and makes extra checks

arr...forget the above it seems the link is not langer making 3 
relocations but only twoanyone with a new link to test this?

-- 
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


Re: [twsocket] THttpCli v6 - Relocation Problem

2006-07-04 Thread Arno Garrels
Frans van Daalen wrote:
> Arno,
> 
> I tested this url and your change (only GetHeaderLineNext) and yes
> with connection "keep-alive" of no setting on connection all is fine.
> However with connection set to "close" the relocation fails on the
> third one. If I try to find where it hangs it shows
> 
> DoRequestSync
> Application.ProcessMessages
> with fstate = httpwaitingbody.

Hmm, I'm still not familiar with this component (looks rather complicated),
however that error doesn't happen if I include the second change. Just tested 
HTTP1.1 with Connection := 'Close' successfully, are you able to
reproduce the same? 

Arno
 
> 
> 
> - Original Message -
> From: "Arno Garrels" <[EMAIL PROTECTED]>
> To: "ICS support mailing" 
> Sent: Tuesday, July 04, 2006 8:07 AM
> Subject: Re: [twsocket] THttpCli v6 - Relocation Problem
> 
> 
>> Frans van Daalen wrote:
>>> If you want me to
>>> check it in detail just let me know and I will do so for you.
>> 
>> Thanks, could you please check my small changes below? Try with both
>> HTTP 1.0/1.1, with as well as w/o property Connection set to 'Keep-
>> Alive'/ 'Close'.
>> It's working here using GET, only I'm not sure whether it might have
>> some other side effects, RequestDone is not triggered on each
>> relocation. Problem URL:
>> http://feeds.feedburner.com/foxsports/RSS/headlines?m=4765 leads to
>> three relocations, first goes to a different host. 
>> 
>> 
>> 1 - procedure THttpCli.GetHeaderLineNext
>> 
>> [..]
>> { FContentLength = -1 when server doesn't send a value }
>>if ((FContentLength = -1) and  { Added 12/03/2004 }
>>((FStatusCode < 200) or{ Added 12/03/2004 }
>> (FStatusCode = 204) or{ Added 12/03/2004 }
>> (FStatusCode = 301) or{ Added 06/10/2004 }
>> (FStatusCode = 302) or{ Added 06/10/2004 }
>> (FStatusCode = 304) or{ Added 12/03/2004 }
>> (FStatusCode = 401) or{ Added 12/28/2005 }
>> //AG 12/28/05
>> (FStatusCode = 407))) { Added 12/28/2005 }
>> //AG 12/28/05
>>   or
>>(FContentLength = 0)
>>   or
>>(FRequestType = httpHEAD) then  begin
>>{ TriggerHeaderEnd;  }{ Removed 10/01/2004 }
>>if {(FResponseVer = '1.0') or (FRequestVer = '1.0') or}
>>   { [rawbite 31.08.2004 Connection controll] }
>>FCloseReq then begin
>>if FLocationFlag then  { Added 16/02/2004
>> }StartRelocation{ Added
>> 16/02/2004 }else begin {
>> Added 16/02/2004 }if FRequestType = httpHEAD
>> then begin { Added 23/07/04 }
>>{ With HEAD command, we don't expect a
>> document }
>>{ but some server send one
>>   }
>>FReceiveLen := 0;  { Cancel received
>> ta   }
>>StateChange(httpWaitingBody);
>>FNext := nil;
>>end;
>>FCtrlSocket.CloseDelayed;  { Added 10/01/2004
>> }end;
>>end
>> =>  else begin // not FCloseReq
>> =>  if FLocationFlag then
>> =>  StartRelocation
>>else
>>SetReady;
>> =>  end;
>>Exit;
>>end;
>> [..]
>> 
>> 
>> 2 - Not so important, but LocationChangeCurCount has been counted
>> incorrectly.
>> procedure THttpCli.StartRelocation
>> [..]
>>FRcvdCount:= 0;
>>FReceiveLen   := 0;
>>FHeaderLineCount  := 0;
>>FBodyLineCount:= 0;
>> 
>>if {(FResponseVer = '1.1') and}
>>{ [rawbite 31.08.2004 Connection controll] }
>>   (FCurrentHost = FHostName) and
>>   (FCurrentPort = FPort) and
>>   (FCurrentProtocol = FProtocol) and
>>   (not FCloseReq) then begin  { SAE 01/06/04 }
>> 
>>{ This block moved 03/07/2006 }
>> =>  {  V1.90 25 Nov 2005 - restrict number of relocations to
>> avoid continuous loops }
>>inc (FLocationChangeCurCount) ;
>>if FLocation

Re: [twsocket] THttpCli v6 - Relocation Problem

2006-07-04 Thread Frans van Daalen
Arno,

I tested this url and your change (only GetHeaderLineNext) and yes with 
connection "keep-alive" of no setting on connection all is fine. However 
with connection set to "close" the relocation fails on the third one. If I 
try to find where it hangs it shows

DoRequestSync
Application.ProcessMessages
with fstate = httpwaitingbody.



- Original Message - 
From: "Arno Garrels" <[EMAIL PROTECTED]>
To: "ICS support mailing" 
Sent: Tuesday, July 04, 2006 8:07 AM
Subject: Re: [twsocket] THttpCli v6 - Relocation Problem


> Frans van Daalen wrote:
>> If you want me to
>> check it in detail just let me know and I will do so for you.
>
> Thanks, could you please check my small changes below? Try with both
> HTTP 1.0/1.1, with as well as w/o property Connection set to 'Keep-Alive'/
> 'Close'.
> It's working here using GET, only I'm not sure whether it might have some
> other side effects, RequestDone is not triggered on each relocation.
> Problem URL: http://feeds.feedburner.com/foxsports/RSS/headlines?m=4765
> leads to three relocations, first goes to a different host.
>
>
> 1 - procedure THttpCli.GetHeaderLineNext
>
> [..]
> { FContentLength = -1 when server doesn't send a value }
>if ((FContentLength = -1) and  { Added 12/03/2004 }
>((FStatusCode < 200) or{ Added 12/03/2004 }
> (FStatusCode = 204) or{ Added 12/03/2004 }
> (FStatusCode = 301) or{ Added 06/10/2004 }
> (FStatusCode = 302) or{ Added 06/10/2004 }
> (FStatusCode = 304) or{ Added 12/03/2004 }
> (FStatusCode = 401) or{ Added 12/28/2005 } //AG 
> 12/28/05
> (FStatusCode = 407))) { Added 12/28/2005 } //AG 
> 12/28/05
>   or
>(FContentLength = 0)
>   or
>(FRequestType = httpHEAD) then  begin
>{ TriggerHeaderEnd;  }{ Removed 10/01/2004 }
>if {(FResponseVer = '1.0') or (FRequestVer = '1.0') or}
>   { [rawbite 31.08.2004 Connection controll] }
>FCloseReq then begin
>if FLocationFlag then  { Added 16/02/2004 }
>StartRelocation{ Added 16/02/2004 }
>else begin { Added 16/02/2004 }
>if FRequestType = httpHEAD then begin { Added 
> 23/07/04 }
>{ With HEAD command, we don't expect a 
> document }
>{ but some server send one 
>   }
>FReceiveLen := 0;  { Cancel received 
> ta   }
>StateChange(httpWaitingBody);
>FNext := nil;
>end;
>FCtrlSocket.CloseDelayed;  { Added 10/01/2004 }
>end;
>end
> =>  else begin // not FCloseReq
> =>  if FLocationFlag then
> =>  StartRelocation
>else
>SetReady;
> =>  end;
>Exit;
>end;
> [..]
>
>
> 2 - Not so important, but LocationChangeCurCount has been counted 
> incorrectly.
> procedure THttpCli.StartRelocation
> [..]
>FRcvdCount:= 0;
>FReceiveLen   := 0;
>FHeaderLineCount  := 0;
>FBodyLineCount:= 0;
>
>if {(FResponseVer = '1.1') and}
>{ [rawbite 31.08.2004 Connection controll] }
>   (FCurrentHost = FHostName) and
>   (FCurrentPort = FPort) and
>   (FCurrentProtocol = FProtocol) and
>   (not FCloseReq) then begin  { SAE 01/06/04 }
>
>{ This block moved 03/07/2006 }
> =>  {  V1.90 25 Nov 2005 - restrict number of relocations to avoid 
> continuous loops }
>inc (FLocationChangeCurCount) ;
>if FLocationChangeCurCount > FLocationChangeMaxCount then begin
>AllowMoreRelocations := false;
>if Assigned (FOnLocationChangeExceeded) then
>FOnLocationChangeExceeded(Self, FLocationChangeCurCount,
>  AllowMoreRelocations);
>if not AllowMoreRelocations then begin
>SetReady;
>exit;
>end;
> =>  end;
>
>{ No need to disconnect }
>{ Trigger the location changed event  27/04/2003 }
> [..]
>
>
> ---
> Arno Garrels [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html
>
>
> Frans van Daalen wrote:
>> -

Re: [twsocket] THttpCli v6 - Relocation Problem

2006-07-03 Thread Arno Garrels
Frans van Daalen wrote:
> If you want me to
> check it in detail just let me know and I will do so for you.

Thanks, could you please check my small changes below? Try with both
HTTP 1.0/1.1, with as well as w/o property Connection set to 'Keep-Alive'/
'Close'.
It's working here using GET, only I'm not sure whether it might have some
other side effects, RequestDone is not triggered on each relocation.   
Problem URL: http://feeds.feedburner.com/foxsports/RSS/headlines?m=4765
leads to three relocations, first goes to a different host.


1 - procedure THttpCli.GetHeaderLineNext

[..]
{ FContentLength = -1 when server doesn't send a value }
if ((FContentLength = -1) and  { Added 12/03/2004 }
((FStatusCode < 200) or{ Added 12/03/2004 }
 (FStatusCode = 204) or{ Added 12/03/2004 }
 (FStatusCode = 301) or{ Added 06/10/2004 }
 (FStatusCode = 302) or{ Added 06/10/2004 }
 (FStatusCode = 304) or{ Added 12/03/2004 }
 (FStatusCode = 401) or{ Added 12/28/2005 } //AG 
12/28/05
 (FStatusCode = 407))) { Added 12/28/2005 } //AG 
12/28/05
   or
(FContentLength = 0)
   or
(FRequestType = httpHEAD) then  begin
{ TriggerHeaderEnd;  }{ Removed 10/01/2004 }
if {(FResponseVer = '1.0') or (FRequestVer = '1.0') or}
   { [rawbite 31.08.2004 Connection controll] }
FCloseReq then begin
if FLocationFlag then  { Added 16/02/2004 }
StartRelocation{ Added 16/02/2004 }
else begin { Added 16/02/2004 }
if FRequestType = httpHEAD then begin { Added 23/07/04 }
{ With HEAD command, we don't expect a document }
{ but some server send one !}
FReceiveLen := 0;  { Cancel received data   }
StateChange(httpWaitingBody);
FNext := nil;
end;
FCtrlSocket.CloseDelayed;  { Added 10/01/2004 }
end;
end
=>  else begin // not FCloseReq
=>  if FLocationFlag then  
=>  StartRelocation 
else   
SetReady;
=>  end;
Exit;
end;
[..]


2 - Not so important, but LocationChangeCurCount has been counted incorrectly.
procedure THttpCli.StartRelocation
[..]
FRcvdCount:= 0;
FReceiveLen   := 0;
FHeaderLineCount  := 0;
FBodyLineCount:= 0;

if {(FResponseVer = '1.1') and}
{ [rawbite 31.08.2004 Connection controll] }
   (FCurrentHost = FHostName) and
   (FCurrentPort = FPort) and
   (FCurrentProtocol = FProtocol) and
   (not FCloseReq) then begin  { SAE 01/06/04 }

{ This block moved 03/07/2006 }
=>  {  V1.90 25 Nov 2005 - restrict number of relocations to avoid 
continuous loops }
inc (FLocationChangeCurCount) ;
if FLocationChangeCurCount > FLocationChangeMaxCount then begin
AllowMoreRelocations := false;
if Assigned (FOnLocationChangeExceeded) then
FOnLocationChangeExceeded(Self, FLocationChangeCurCount,
  AllowMoreRelocations);
if not AllowMoreRelocations then begin
SetReady;
exit;
end;
=>  end;

{ No need to disconnect }
{ Trigger the location changed event  27/04/2003 }
[..]


---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


Frans van Daalen wrote:
> - Original Message -
> From: "Arno Garrels" <[EMAIL PROTECTED]>
> ..>
>> Since I've never been using THttpCli in one of my applications I'm
>> not very familiar with HTTP as well as the THttpCli. That's why I
>> wonder whether it is intented to trigger RequestDone on each
>> relocation or not (sometimes it's triggered in V5, V6 sometimesnot),
>> probably someone more familiar with the component can clear me up?
>> With two simple changes I can make the FollowRelocation feature
>> working for the problem URL of the OP, however w/o RequestDone being
>> triggered on relocation.
>> 
>> 
> If I remember correctly, to late to really check it :), requestdone
> is only triggered after relocate is finished (followreloc is true). I
> use v6 beta and the thttpcli for some years now. If you want me to
> check it in detail just let me know and I will do so for you.
-- 
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


Re: [twsocket] THttpCli v6 - Relocation Problem

2006-07-03 Thread Frans van Daalen

- Original Message - 
From: "Arno Garrels" <[EMAIL PROTECTED]>
..>
> Since I've never been using THttpCli in one of my applications I'm
> not very familiar with HTTP as well as the THttpCli. That's why I
> wonder whether it is intented to trigger RequestDone on each
> relocation or not (sometimes it's triggered in V5, V6 sometimesnot),
> probably someone more familiar with the component can clear me up?
> With two simple changes I can make the FollowRelocation feature
> working for the problem URL of the OP, however w/o RequestDone being
> triggered on relocation.
>
>
If I remember correctly, to late to really check it :), requestdone is only 
triggered after relocate is finished (followreloc is true). I use v6 beta 
and the thttpcli for some years now. If you want me to check it in detail 
just let me know and I will do so for you.

-- 
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


Re: [twsocket] THttpCli v6 - Relocation Problem

2006-07-03 Thread Arno Garrels
Angela Kaylen wrote:
>> I can reproduce the problem, even with latest V5 beta.
> 
> Yes sorry, i was using V4, not V5, I have reinstalled V4 now and the
> function works again.
> 
>> Do you
>> remember whether your old version triggered RequestDone on each
>> relocation?
> 
> It does not, ive put a showmessage into the
> requestdone event, but it always only shows up one time,
> regardless if its a relocation url or not.

Can you please send me a copy of this HttpCli.pas?
 
>> Possibly with StatusCode 302?
> How do I read it out?

StatusCode is a property of THttpCli, however if RequestDone is
not triggered on each relocation in your version it doesn't matter. 

Since I've never been using THttpCli in one of my applications I'm
not very familiar with HTTP as well as the THttpCli. That's why I 
wonder whether it is intented to trigger RequestDone on each
relocation or not (sometimes it's triggered in V5, V6 sometimesnot),
probably someone more familiar with the component can clear me up?
With two simple changes I can make the FollowRelocation feature
working for the problem URL of the OP, however w/o RequestDone being
triggered on relocation.


---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


> 
> 
> 
> -
> Do you Yahoo!?
>  Everyone is raving about the  all-new Yahoo! Mail Beta.
-- 
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


Re: [twsocket] THttpCli v6 - Relocation Problem

2006-07-03 Thread Angela Kaylen
>I can reproduce the problem, even with latest V5 beta.

Yes sorry, i was using V4, not V5, I have reinstalled V4 now and the function 
works again.

>Do you 
>remember whether your old version triggered RequestDone on each
>relocation?

It does not, ive put a showmessage into the
requestdone event, but it always only shows up one time,
regardless if its a relocation url or not.

>Possibly with StatusCode 302? 
How do I read it out?



-
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail Beta.
-- 
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


Re: [twsocket] THttpCli v6 - Relocation Problem

2006-07-03 Thread Arno Garrels
Angela Kaylen wrote:
> Hi,
> i have been using V5 so far, and today ive updated to V6. 

I can reproduce the problem, even with latest V5 beta. Do you 
remember whether your old version triggered RequestDone on each
relocation? Possibly with StatusCode 302? 

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html



But now
> this simple Function doesnt work anymore. FollowRelocations is true
> and MaxLocations is set to 5. Also tried the newest beta version but
> same result with it. Neither head() or Get() works, its just hangs
> and is busy. But its odd, this address works,
> http://feeds.feedburner.com/foxsports/RSS/headlines?m=4775 but this
> one does not
> http://feeds.feedburner.com/foxsports/RSS/headlines?m=4765 .   
> 
> function GetActualURL: String;
> begin
>   Try
> frmMain.HttpCli1.URL := frmMain.strItemLink;
> frmMain.HttpCli1.Get;
> Result := frmMain.HTTPCli1.Location;
> //Sleep(50);
>   Except  // bei HTTPS
> Result := frmMain.strItemLink;
>   End;
> end;
> 
> I hope you can help me.
> 
> 
> -
> Yahoo! Music Unlimited - Access over 1 million songs.Try it free.
-- 
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