RE: [twsocket] No response problem [THttpServer - TCustomLineWSocket]

2005-06-20 Thread Bjørnar Nielsen
 When users clicks links or post forms in their browsers, 
 sometimes they don't get any answer. By debugging the server 
 I realized that in such a case the OnPostDocument event is 
 never triggered.

Are you sure the request you don't get an answer from is received on the
server?

When you run a server on a non-server-platform you might miss some requests
when many requests arrive at the same time. On a non-server-platform (w2000,
XP etc) there is a listen backlog set to 5. That means that 5 connects is
queued by the os if your server is not ready to accept the connection yet.
The sixth connection will be lost. On a server-platform (w2000 server, w2003
server etc), this backlog is set to 200.

Regards
Bjørnar



--
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] No response problem [THttpServer - TCustomLineWSocket]

2005-06-20 Thread Francois Piette
The first important thing is: Are you using the very latest ICS version 
downloaded from my website ?

 When users clicks links or post forms in their browsers, sometimes they 
 don't get any answer. By debugging the server I realized that in such a 
 case the OnPostDocument event is never triggered.

Do you have a reproductible case ?
Does it occurs with the sample WebServ delivered with ICS ?

--
[EMAIL PROTECTED]
http://www.overbyte.be


- Original Message - 
From: Christophe [EMAIL PROTECTED]
To: twsocket@elists.org
Sent: Monday, June 20, 2005 4:01 AM
Subject: [twsocket] No response problem [THttpServer - TCustomLineWSocket]


 Hi,
 
 First of all, I'd like to apologize if my question is inapropriate, it 
 is the first time I am using a mailing list (I usually use php based 
 forums for development issues).
 
 I searched a lot about the following problem, but I still don't have a 
 clue of what's happening:
 
 I have been developping few applications that use the THttpServer 
 component. I noticed that sometimes (randomly), the server gives no 
 answer to clients.
 When users clicks links or post forms in their browsers, sometimes they 
 don't get any answer. By debugging the server I realized that in such a 
 case the OnPostDocument event is never triggered.
 
 I checked the call stack at that time, and it seems the problem is in 
 TCustomLineWSocket.TriggerDataAvailable (Unit WSocket). At the beginning 
 of this function there is the following test:
 if (not FLineMode) or (Length(FLineEnd) = 0) or (FSocksState  socksData)
 then begin
Result := inherited TriggerDataAvailable(Error);
Exit;
 end;
 
 I placed breakpoints and I am pretty sure that if FLineMode is false, 
 then there is no problem (the component will continue and send back data 
 to the client).
 If FLineMode is false, the component will stop here (after the Exit), 
 and will never send anything back to the client browsers (they wait, 
 and, after a while, they fail because of a timeout).
 
 It brings 2 questions:
 - For the same link (GET) or form (POST), why does sometimes FlineMode 
 is true and sometimes false ?
 - How to force FLineMode to be true, or more generally how to solve such 
 a problem. (I tried to do a (Client as THTTPConnection).LineMode:=true 
 in the OnClientConnect event but it doesn't change a thing).
 
 PS: It is the first time I checked ICS source, so my analysis of the 
 problem is maybe totally wrong.
 PS2: I tested this on two different PCs with WindowsXP (no firewall, no 
 antivirus) on a LAN. I re-downloaded ICS today to be sure, but the 
 problem is still there.
 
 Thank you,
 Christophe
 
 -- 
 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


Re: [twsocket] 2 questions concerning cookies

2005-06-20 Thread Francois Piette
I think all answers are at http://wp.netscape.com/newsref/std/cookie_spec.html

--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

- Original Message - 
From: Julian S. [EMAIL PROTECTED]
To: twsocket@elists.org
Sent: Sunday, June 19, 2005 9:53 PM
Subject: [twsocket] 2 questions concerning cookies


 Firstly thx for your last answer - helped a lot.
 I am using an event OnCookie to grab a cookie from the site I mentioned 
 earlier
(http://blablabla.site.pl/?we=airstriker ). I am getting something like this:

 cookie_kod=773321

 The problem is that when I am using different software (webfetch) I am 
 geeting a cookie like this:

 cookie_kod=773321; domain=blablabla.site.pl; path=/

 The problem is that when I am using the first cookie I get no result.
 So my question is: should the cookie look like the second one? And if so what 
 is the way (in ICS)
to get it all look like this?
 And the second question: Should I change something in the cookie I want to 
 pass later to the
server? For example should I change path=/ to 
path=http://blablabla.site.pl/?we=airstriker or maybe
to something else?
 And the third question: Should I change cookie_kod to kod ? Because when 
 clicking the URL (I
mentioned about it in the earlier post) using IE it opens
http://blablabla.site.pl/?we=airstrikerkod=773321 and not:
http://blablabla.site.pl/?we=airstrikercookie_kod=773321

 Thx for any help!
 Regards,
 Airstriker

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


Re: [twsocket] No response problem [THttpServer - TCustomLineWSocket]

2005-06-20 Thread Christophe

Bjørnar Nielsen wrote:
When users clicks links or post forms in their browsers, 
sometimes they don't get any answer. By debugging the server 
I realized that in such a case the OnPostDocument event is 
never triggered.



Are you sure the request you don't get an answer from is received on the
server?

Yes, as I explained in my last mail, when a user makes a request (GET or 
POST or HEAD or whatever), the server get it, and start to analyze it 
but stops inside TCustomLineWSocket.TriggerDataAvailable.



When you run a server on a non-server-platform you might miss some requests
when many requests arrive at the same time. On a non-server-platform (w2000,
XP etc) there is a listen backlog set to 5. That means that 5 connects is
queued by the os if your server is not ready to accept the connection yet.
The sixth connection will be lost. On a server-platform (w2000 server, w2003
server etc), this backlog is set to 200.


Well I can understand that, except that this problem occurs even when I 
do debugging (which means only one client, on the local machine). Also, 
I checked in the MS event manager (I guess if windows drops some 
connections it would place an entry here), but I found nothing.




Regards
Bjørnar






--
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] No response problem [THttpServer - TCustomLineWSocket]

2005-06-20 Thread Christophe

Francois Piette wrote:

The first important thing is: Are you using the very latest ICS version 
downloaded from my website ?


Yes, I re-installed the last version this morning.



When users clicks links or post forms in their browsers, sometimes they 
don't get any answer. By debugging the server I realized that in such a 
case the OnPostDocument event is never triggered.



Do you have a reproductible case ?


No and that's my main problem. I tested this morning, it was awful (like 
25% of connections lost, on two different PCs. But now I'm trying 
again and it works better (I didn't change anything to the program since 
this morning, but now I only get very few connections loss).
Also, this morning I talked about the OnPostDocument event because at 
that time, nearly only POST commands had a problem. Now the post 
commands work totally fine, and the few errors concern basic GET commands.



Does it occurs with the sample WebServ delivered with ICS ?
Well it seems it doesn't (at least I didn't experienced the problem 
yet), which is surprising because my program is quite identical to the 
demo (I mean, I implemented some functions but nothing that directly 
change the way THttpServer works).




--
[EMAIL PROTECTED]
http://www.overbyte.be


- Original Message - 
From: Christophe [EMAIL PROTECTED]

To: twsocket@elists.org
Sent: Monday, June 20, 2005 4:01 AM
Subject: [twsocket] No response problem [THttpServer - TCustomLineWSocket]




Hi,

First of all, I'd like to apologize if my question is inapropriate, it 
is the first time I am using a mailing list (I usually use php based 
forums for development issues).


I searched a lot about the following problem, but I still don't have a 
clue of what's happening:


I have been developping few applications that use the THttpServer 
component. I noticed that sometimes (randomly), the server gives no 
answer to clients.
When users clicks links or post forms in their browsers, sometimes they 
don't get any answer. By debugging the server I realized that in such a 
case the OnPostDocument event is never triggered.


I checked the call stack at that time, and it seems the problem is in 
TCustomLineWSocket.TriggerDataAvailable (Unit WSocket). At the beginning 
of this function there is the following test:

if (not FLineMode) or (Length(FLineEnd) = 0) or (FSocksState  socksData)
then begin
  Result := inherited TriggerDataAvailable(Error);
  Exit;
end;

I placed breakpoints and I am pretty sure that if FLineMode is false, 
then there is no problem (the component will continue and send back data 
to the client).
If FLineMode is false, the component will stop here (after the Exit), 
and will never send anything back to the client browsers (they wait, 
and, after a while, they fail because of a timeout).


It brings 2 questions:
- For the same link (GET) or form (POST), why does sometimes FlineMode 
is true and sometimes false ?
- How to force FLineMode to be true, or more generally how to solve such 
a problem. (I tried to do a (Client as THTTPConnection).LineMode:=true 
in the OnClientConnect event but it doesn't change a thing).


PS: It is the first time I checked ICS source, so my analysis of the 
problem is maybe totally wrong.
PS2: I tested this on two different PCs with WindowsXP (no firewall, no 
antivirus) on a LAN. I re-downloaded ICS today to be sure, but the 
problem is still there.


Thank you,
Christophe

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


Re: [twsocket] No response problem [THttpServer - TCustomLineWSocket]

2005-06-20 Thread Francois Piette
  Does it occurs with the sample WebServ delivered with ICS ?

 Well it seems it doesn't (at least I didn't experienced the problem
 yet), which is surprising because my program is quite identical to the
 demo (I mean, I implemented some functions but nothing that directly
 change the way THttpServer works).

It is likely that you introduced something wrong. Or failed to follow some 
programming rule.

One important thing: never call the message pump, directly or indirectly from 
one of the ICS
component event. You would get all kind of strange results. Be aware that some 
VCL internally call
the message pump, like ShowMessage.

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


RE: [twsocket] No response problem [THttpServer - TCustomLineWSocket]

2005-06-20 Thread Bjørnar Nielsen

 Yes, as I explained in my last mail, when a user makes a 
 request (GET or 
 POST or HEAD or whatever), the server get it, and start to analyze it 
 but stops inside TCustomLineWSocket.TriggerDataAvailable.

Ok, I missed that part, my previos message does not explain your problem.

In PostedData-event, be sure to call PostedDataReceived on the
client-connection (linemode is set to true and FState is set to hcRequest).
This will enable the client to receive more requests on same connection (if
http1.1 and keepalive).

It would be interesting to se if the lost requests is happening on newly
created connections, or maybe only on connections that are used a second
time (many requests on same connection, http1.1 and keepalive).


Regards Bjørnar



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


[twsocket] Is a 'reference' property used to change a referer header?

2005-06-20 Thread Julian S.
Is a 'reference' property in ICS used to change a referer header?

If not is there a way to do it using ICS?



--
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] Is a 'reference' property used to change a refererheader?

2005-06-20 Thread Francois Piette
 Is a 'reference' property in ICS used to change a referer header?
 If not is there a way to do it using ICS?

THttpCli.Reference is what you are looking for.

--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
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


[twsocket] 2 questions concerning cookies

2005-06-20 Thread Julian S.
I found an interesting thing. (the case referes to the page where the link was: 
http://blablabla.site.pl/?we=airstriker )
When I choose 'show page source' in IE I find the following url which the link 
refers to:

?we=airstrikerkod=962463

But whenever I save a page on the drive and then edit this page I see that the 
link refers to:

http://blablabla.site.pl/?we=airstrikeramp;kod=361152

What is amp doing here? What is it for? And what is semi-colon doing here? I 
think it's something with php but I searched google and found nothing about it;]



--
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] 2 questions concerning cookies

2005-06-20 Thread Francois PIETTE
This is a HTML entity encoding. In HTML, you can replace the ampersand 
character by amp;. You can do that for a lot of other characters. For 
example gt; is the greather-than sign.


--
[EMAIL PROTECTED]
http://www.overbyte.be


- Original Message - 
From: Julian S. [EMAIL PROTECTED]

To: twsocket@elists.org
Sent: Monday, June 20, 2005 7:31 PM
Subject: [twsocket] 2 questions concerning cookies


I found an interesting thing. (the case referes to the page where the link 
was: http://blablabla.site.pl/?we=airstriker )
When I choose 'show page source' in IE I find the following url which the 
link refers to:


?we=airstrikerkod=962463

But whenever I save a page on the drive and then edit this page I see that 
the link refers to:


http://blablabla.site.pl/?we=airstrikeramp;kod=361152

What is amp doing here? What is it for? And what is semi-colon doing here? 
I think it's something with php but I searched google and found nothing 
about it;]




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