]> Sergey Matveev's repositories - public-inbox.git/commitdiff
nntp: return if a client drops on us
authorEric Wong <e@80x24.org>
Sat, 9 Jul 2016 00:00:11 +0000 (00:00 +0000)
committerEric Wong <e@80x24.org>
Sat, 9 Jul 2016 00:00:11 +0000 (00:00 +0000)
Danga::Socket::write will set the closed flag on a socket,
automatically, and we do not need to bring down an entire
server when one client breaks the connection :P

lib/PublicInbox/NNTP.pm

index 0b30d43a174562328df2a78d767c6c3d6b18f0d1..5b055bca0c9c9ef859e85fc7da4cef162668da67 100644 (file)
@@ -894,7 +894,7 @@ sub more ($$) {
 sub do_write ($$) {
        my ($self, $data) = @_;
        my $done = $self->write($data);
-       die if $self->{closed};
+       return if $self->{closed};
 
        # Do not watch for readability if we have data in the queue,
        # instead re-enable watching for readability when we can