Re: [twsocket] Did I find a bug in THttpCli? (Beta fix availablefor download)

2012-12-31 Thread Arno Garrels
Arno Garrels wrote:
 Here is a fix that is briefly tested once without proxy
 and once with squid proxy and NTLM authentication in V8 only:
 http://delphi.duodata.de/archive/OverbyteIcsHttpProtV7-V8.zip
 These units are based on latest svn revision.
 Please let us know how it works for you (you have to rename the
 units, replace your local OverbyteIcsHttpProt.pas and rebuild).

I checked in those fixes yesterday so more people will test them.
The ZIP file above is no longer available for download, just get 
recent ICS from here:
http://wiki.overbyte.be/wiki/index.php/ICS_Download.

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


Re: [twsocket] Did I find a bug in THttpCli? (Beta fix available for download)

2012-12-17 Thread Albert Wiersch
 Arno Garrels wrote:
 
 Well, I should have said not enough spare time to test it very
 carefully Here is a fix that is briefly tested once without proxy
 and once with squid proxy and NTLM authentication in V8 only:
 http://delphi.duodata.de/archive/OverbyteIcsHttpProtV7-V8.zip
 These units are based on latest svn revision.
 Please let us know how it works for you (you have to rename the
 units, replace your local OverbyteIcsHttpProt.pas and rebuild).

Arno,

Thank you!

I've done a quick test myself and the port now seems to be correctly included
in Location and Host.

I will definitely reply back if there is anything to report after further
testing.

Thanks,
Albert Wiersch

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


Re: [twsocket] Did I find a bug in THttpCli? (Beta fix available for download)

2012-12-15 Thread Arno Garrels
Arno Garrels wrote:
 There are just two 'small' bugs:
 1) property Location doesn't include the port number and 2) the Host header 
 lacks the port number as well which is the
 reason why your php script reports port 80 though the client
 actually is connected to port 8080.
 
 The fix in standard cases ( no proxy and no SSL ) is rather simple.
 However a fix that works with SSL and all proxy authentications
 is not trivial since everything has to be tested carefully.
 I've currently not enough spare time to fix it.

Well, I should have said not enough spare time to test it very
carefully Here is a fix that is briefly tested once without proxy
and once with squid proxy and NTLM authentication in V8 only: 
http://delphi.duodata.de/archive/OverbyteIcsHttpProtV7-V8.zip
These units are based on latest svn revision.
Please let us know how it works for you (you have to rename the
units, replace your local OverbyteIcsHttpProt.pas and rebuild). 

-- 
Arno 

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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-12 Thread Arno Garrels
Albert Wiersch wrote:
 Hi Arno,
 
 I tested with the ICS-V7 snapshot here:
 http://wiki.overbyte.be/wiki/index.php/ICS_Download
 
 And it didn't work. It requested port 80 when it should have
 requested port 8080. It works as expected in Firefox.

Please read my previous messages in TWSocket. There are just 
two 'small' bugs:
1) property Location doesn't include the port number and
2) the Host header lacks the port number as well which is the
reason why your php script reports port 80 though the client
actually is connected to port 8080. 

The fix in standard cases ( no proxy and no SSL ) is rather simple.
However a fix that works with SSL and all proxy authentications
is not trivial since everything has to be tested carefully.
I've currently not enough spare time to fix it.

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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-12 Thread Albert Wiersch

 Please read my previous messages in TWSocket. There are just
 two 'small' bugs:
 1) property Location doesn't include the port number and
 2) the Host header lacks the port number as well which is the
 reason why your php script reports port 80 though the client
 actually is connected to port 8080.
 
 The fix in standard cases ( no proxy and no SSL ) is rather simple.
 However a fix that works with SSL and all proxy authentications
 is not trivial since everything has to be tested carefully.
 I've currently not enough spare time to fix it.

Thanks Arno.

It's interesting that the script reports the wrong port but the connection is
made on port 8080. I suppose you had to use Wireshark to confirm that.

Do you have enough time to fix the simple stuff at least (whatever can easily
be fixed) and leave the more time consuming stuff for later? Or is it the case
that there is no simple fixes possible due to proxy and SSL issues?

Thanks,
Albert

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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-12 Thread RTT


A quick fix that seems to correct the issue is to add a FTargetPort:= 
FPort to the procedure THttpCli.StartRelocation in the 
OverbyteIcsHttpProt unit.


procedure THttpCli.StartRelocation;
...
 CleanupSendStream;
 LoginDelayed;
 end
 else begin
+FTargetPort:= FPort;
 FCtrlSocket.OnSessionClosed := LocationSessionClosed;
 FCtrlSocket.CloseDelayed;
 end;
 end;
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-11 Thread Angus Robertson - Magenta Systems Ltd
 If you GET this URL:
 http://www.htmlvalidator.com/test/cookies/test-redirect.php
 
 Then you get Server port is 80. with the ICS demo, but put the 
 same URL in a browser and you get Server port is 8080.

I have reproduced this using the ICS browser demo, which is useful for
testing stuff such as this due to logging protocol and showing you the
web page at the same time.  

I'll look at a fix, since I have relative relocation bug to fix as well. 

Angus

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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-11 Thread Arno Garrels

- Original Message - 
From: Angus Robertson - Magenta Systems Ltd an...@magsys.co.uk
To: twsocket@elists.org
Sent: Tuesday, December 11, 2012 5:25 PM
Subject: Re: [twsocket] Did I find a bug in THttpCli?


 If you GET this URL:
 http://www.htmlvalidator.com/test/cookies/test-redirect.php
 
 Then you get Server port is 80. with the ICS demo, but put the 
 same URL in a browser and you get Server port is 8080.
 
 I have reproduced this using the ICS browser demo, which is useful for
 testing stuff such as this due to logging protocol and showing you the
 web page at the same time.  
 
 I'll look at a fix, since I have relative relocation bug to fix as well. 

Before you try to fix/break something that works, I urge you to check with 
Wireshark that the redirection works as expected to port number 8080,
the only problem I see so far is property Location should likely include
the port number in this test case.

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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-11 Thread RTT

On 11-12-2012 16:38, Arno Garrels wrote:

- Original Message -
From: Angus Robertson - Magenta Systems Ltd an...@magsys.co.uk
To: twsocket@elists.org
Sent: Tuesday, December 11, 2012 5:25 PM
Subject: Re: [twsocket] Did I find a bug in THttpCli?



If you GET this URL:
http://www.htmlvalidator.com/test/cookies/test-redirect.php

Then you get Server port is 80. with the ICS demo, but put the
same URL in a browser and you get Server port is 8080.

I have reproduced this using the ICS browser demo, which is useful for
testing stuff such as this due to logging protocol and showing you the
web page at the same time.

I'll look at a fix, since I have relative relocation bug to fix as well.

Before you try to fix/break something that works, I urge you to check with
Wireshark that the redirection works as expected to port number 8080,
the only problem I see so far is property Location should likely include
the port number in this test case.

What's weird is that if I test this scenario locally, with a redirect to 
a different port (as in this supposedly problem), it work just fine.
And you are correct. The port after the redirect is the correct 8080. I 
just don't understand why the document returned is not the same as when 
tested in a browser. Is like if the called php script is tricking us.


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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-11 Thread Angus Robertson - Magenta Systems Ltd
 Before you try to fix/break something that works, I urge you to 
 check with Wireshark that the redirection works as expected to port 
 number 8080, the only problem I see so far is property Location
 should likely include the port number in this test case.

The first thing I'll do is fix the logging so we can actually see what is
happening, it should not be necessary to use Wireshark to debug a program.


Angus

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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-11 Thread Arno Garrels

- Original Message - 
From: Angus Robertson - Magenta Systems Ltd an...@magsys.co.uk
To: twsocket@elists.org
Sent: Tuesday, December 11, 2012 6:33 PM
Subject: Re: [twsocket] Did I find a bug in THttpCli?


 Before you try to fix/break something that works, I urge you to 
 check with Wireshark that the redirection works as expected to port 
 number 8080, the only problem I see so far is property Location
 should likely include the port number in this test case.
 
 The first thing I'll do is fix the logging so we can actually see what is
 happening

I do not see the logging is wrong, actually it's logged
what's being sent and the Location property as is (which is wrong).

So I see two problems now, missing port number in both Location
property and Host header line. Relocation itself (connecting
to the correct port) actually works. 

-- 
Arno



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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-11 Thread RTT

On 11-12-2012 17:30, Arno Garrels wrote:

- Original Message -
From: RTT p...@sapo.pt
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, December 11, 2012 5:59 PM
Subject: Re: [twsocket] Did I find a bug in THttpCli?



The port after the redirect is the correct 8080. I
just don't understand why the document returned is not the same as when
tested in a browser. Is like if the called php script is tricking us.

I guess it's because of the Host header sent by THttpCli also
doesn't include the port number, firefox does send the 8080 port.



Then the StartRelocation method may need to recreate the FReqStream 
data. Probably better to handle the Host header separated from this stream.

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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-10 Thread Albert Wiersch
 From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On
 Behalf Of Arno Garrels
 
 If you just recognized that string property Location doesn't include the
 port number then that might be a bug. However relocation works without
 problem for me with the OverbyteIcsWebServ demo listening, for instance,
 on port 81 and the OverbyteIcsHttpTst demo (your sample URL did not work,
 please provide an URL that shows the problem).

Hi Arno,

I think the problem may be more serious.

Please try this URL:
http://www.htmlvalidator.com/test/cookies/test-redirect.php

It should redirect to:
http://www.htmlvalidator.com:8080/test/cookies/test-redirect-port.php

But THttpCli seems to ignore the port because it uses port 80 when it requests
the redirected URL  the Location property (in onLocationChange) does not
include the port number. If I open the URL in a web browser, then it correctly
uses port 8080 for the redirect.

Can you help me fix this issue?

I need ICS to report (via the Location property) the full URL, including port
number, and I need it to use the correct port.

Thanks,
Albert

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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-10 Thread Arno Garrels
Albert Wiersch wrote:
 From: twsocket-boun...@elists.org
 [mailto:twsocket-boun...@elists.org] On Behalf Of Arno Garrels
 
 If you just recognized that string property Location doesn't include
 the port number then that might be a bug. However relocation works
 without problem for me with the OverbyteIcsWebServ demo listening,
 for instance, on port 81 and the OverbyteIcsHttpTst demo (your
 sample URL did not work, please provide an URL that shows the
 problem). 
 
 Hi Arno,
 
 I think the problem may be more serious.
 
 Please try this URL:
 http://www.htmlvalidator.com/test/cookies/test-redirect.php
 
 It should redirect to:
 http://www.htmlvalidator.com:8080/test/cookies/test-redirect-port.php

I tested with current ICSv8/v7 and it works perfectly (checked with Wireshark).
The only problem is that property Location doesn't include the non-default
port number. A workaround would be to get the Location header manually.  

 
 But THttpCli seems to ignore the port 

No it doesn't with a recent ICS, only property Location is a bit buggy IMO.

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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-10 Thread RTT

I tested with current ICSv8/v7 and it works perfectly (checked with Wireshark).
The only problem is that property Location doesn't include the non-default
port number. A workaround would be to get the Location header manually.



In a browser I get an html that says:
Server port is 8080.

With ICSv8 OverbyteIcsHttpTst I get an html that says:

Server port is 80.

So something is working differently.

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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-10 Thread Albert Wiersch

Yes, something is wrong.

I also just compiled v8 and the OverbyteIcsHttpTst demo as well.

If you GET this URL:
http://www.htmlvalidator.com/test/cookies/test-redirect.php

Then you get Server port is 80. with the ICS demo, but put the same URL in a
browser and you get Server port is 8080., so ICS is not handling the port
change correctly, nor is it indicating the port in the Location property.

I've been using ICS for a while and this never came up until someone using
non-standard ports  redirection on their development server reported this
issue.

I'd really like a fix for this. I'm not sure who I should contact about
getting this resolved in the code base?

Thanks,
Albert Wiersch


 -Original Message-
 From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On
 Behalf Of RTT
 Sent: Monday, December 10, 2012 10:40 AM
 To: ICS support mailing
 Subject: Re: [twsocket] Did I find a bug in THttpCli?
 
  I tested with current ICSv8/v7 and it works perfectly (checked with
 Wireshark).
  The only problem is that property Location doesn't include the non-default
  port number. A workaround would be to get the Location header manually.
 
 
 In a browser I get an html that says:
 Server port is 8080.
 
 With ICSv8 OverbyteIcsHttpTst I get an html that says:
 
 Server port is 80.
 
 So something is working differently.
 
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be

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


Re: [twsocket] Did I find a bug in THttpCli?

2012-12-08 Thread Arno Garrels
Albert Wiersch wrote:
 If a request is redirected and contains a port number, then it seems
 that the new request drops the port number.

If you just recognized that string property Location doesn't include the
port number then that might be a bug. However relocation works without 
problem for me with the OverbyteIcsWebServ demo listening, for instance,
on port 81 and the OverbyteIcsHttpTst demo (your sample URL did not work,
please provide an URL that shows the problem).

-- 
Arno

 




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


[twsocket] Did I find a bug in THttpCli?

2012-12-07 Thread Albert Wiersch

If a request is redirected and contains a port number, then it seems that the
new request drops the port number.

In the below example, the request is redirected to
http://www.htmlvalidator.com:8080/test/cookies/test-redirect2.php;, but
HttpCli1-Location seems to drop the port number.

Is this a bug in THttpCli or am I doing something wrong?

I need to know what the location changed to, including port number.

Example:

Command GET /test/cookies/test-redirect.php HTTP/1.1
Command Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Command Connection: close
Command User-Agent: CSE HTML Validator Enterprise
(http://www.htmlvalidator.com/)
Command Host: www.htmlvalidator.com
Command 
Header HTTP/1.1 302 Found
Header Date: Fri, 07 Dec 2012 22:02:07 GMT
Header Server: Apache
Header X-Powered-By: PHP/5.3.19
Header Location:
http://www.htmlvalidator.com:8080/test/cookies/test-redirect2.php
Header Content-Length: 0
Header Connection: close
Header Content-Type: text/html; charset=utf-8
Location Changing to:
http://www.htmlvalidator.com/test/cookies/test-redirect2.php

Thanks,
Albert Wiersch


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