Subject: | Infinite loop in X11::Protocol::Connection::Socket |
Date: | Sun, 16 Nov 2008 09:39:36 +0200 |
To: | bug-X11-Protocol [...] rt.cpan.org |
From: | Matthieu Weber <mweber [...] mit.jyu.fi> |
Hi,
get() in X11::Protocol::Connection::Socket goes into an infinite loop
when the X11 connection is forwarded through an SSH tunnel and the SSH
connection is closed. The reason is that in this case sysread() returns
0 forever, but this case is not handled. Here's a quick patch to fix it.
--- Socket.pm 2008-11-11 15:02:19.000000000 +0200
+++ Socket.pm 2008-11-11 15:06:02.000000000 +0200
@@ -31,6 +31,7 @@
until ($o == $len) {
$n = $sock->sysread($x, $len - $o, $o);
croak $! unless defined $n;
+ croak "Connection closed" unless $n;
$o += $n;
}
return $x;
FYI, I am using X11-Protocol-0.55 and perl v5.8.8 on Debian 4.0.
Matthieu
--
(~._.~) Matthieu Weber - Université de Jyväskylä (~._.~)
( ? ) email : mweber@mit.jyu.fi ( ? )
()- -() public key id : 452AE0AD ()- -()
(_)-(_) "Humor ist, wenn man trotzdem lacht (Otto J. Bierbaum)" (_)-(_)