Re: [Filterproxy-devel] Re: FilterProxy BUG
Brought to you by:
mcelrath
From: Guillaume M. <gui...@mo...> - 2002-05-07 16:44:22
|
Dans un message du 07 May à 11:09, Bob McElrath écrivait : > > It is Linux 2.2.14 (tried too with .19) and glibc 2.1.3. Getpeername can > > return undef, if the syscall fails (here with ENOTCONN). If the peer has > > shutdown the connection, it looks logical to me. > > The peer cannot shut down the connection. This is a "listen" socket, > and should stay open when there are no connections. I do not see how the listen socket is concerned. You call getpeername on connected socket which are not listen anymore. Shutting down the connection would trigger ENOTCONN, I do not see what is surprising. > The syscalls getpeername and accept are part of glibc. I do not know what is your point. Sure, the glibc contains hooks for the syscalls but the syscalls code is definitely in the kernel. > > Yes, but accept(2) can't fail for other reasons that you should test > > such as ECONNRESET. After the getpeername error, I get EPIPE, I tried to > > launch accept again, it seems to trigger endless EPIPE errors. > > This should not be possible. I thought so, but it just happens here :-( > > I do not know if you should ignore that one ... But there is surely a > > list of accept(2) errors that you want to ignore. > > Hmmm good point. I don't see how to get the linux error in perl. All > the perl man pages just say it returns undef. > > Do you know where to get this error code? Maybe try printing out '$!'? yes if you use $! and compare it to the constants define in POSIX qw/:errno_h/ I think you should restart after at least ECONNRESET, EAGAIN, EINTR. > The accept(2) man pages says to retry when it gives odd errors. Maybe > rearrange that main loop: > while(1) { > my $client = $daemon->accept; > next unless(defined $client); > ... > } > > Maybe throw a sleep() in there so it doesn't consume 100% of the cpu if > the network goes down (or something). I've basically done this. But after the first EPIPE error, all sucessive calls were EPIPE (I tried this during one minute or so). -- Guillaume Morin <gui...@mo...> Why critize what you don't understand ? (Sepultura) |