chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] http-client doesn't handle closed persistent connect


From: Daishi Kato
Subject: Re: [Chicken-users] http-client doesn't handle closed persistent connections
Date: Sun, 30 Jan 2011 21:57:47 +0900
User-agent: Wanderlust/2.14.0 (Africa) Emacs/21.4 Mule/5.0 (SAKAKI)

At Sat, 29 Jan 2011 16:04:26 +0100,
Peter Bex wrote:
> 
> On Sat, Jan 29, 2011 at 11:57:27PM +0900, Daishi Kato wrote:
> > After a quick look in the code, one suspect is that port-closed?
> > can't check a closed port, but not really sure.
> 
> If that's the case, it's a bug in Chicken because http-client simply
> used the definition from library.scm, and provides its own copy if we're
> on an older Chicken that doesn't provide this procedure.
> 
> > Or, it doesn't raise an exception when it detects closed connection.
> > I'll work more tomorrow and try to make a test case,
> > but let me know if you already know this issue.
> 
> I have observed "weird' behaviours on closed connections before,
> but always in error cases only, and I wasn't able to debug that,
> so I'm not sure if that's the same issue you're reporting.
> 
> A test case would be welcome.

Here is how to reproduce the problem.

CHICKEN
(c)2008-2010 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.6.0
linux-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2011-01-11 on spirits (Linux)

#;1> (use http-client)
#;2> (string-length (with-input-from-request "http://www.apache.org/"; #f 
read-string))
44138
#;3> (thread-sleep! 5)                                                          
#;4> (string-length (with-input-from-request "http://www.apache.org/"; #f 
read-string))
2
#;5> (string-length (with-input-from-request "http://www.apache.org/"; #f 
read-string))
44138


This apache server is probably configured to keep connections for 5sec.
The unofficial keep-alive header says so.
I could confirm that the connection is closed after 5sec by netstat.

Best,
Daishi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]