From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id BFCC31F744 for ; Sat, 9 Jul 2016 00:02:00 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] nntp: return if a client drops on us Date: Sat, 9 Jul 2016 00:02:00 +0000 Message-Id: <20160709000200.20984-1-e@80x24.org> List-Id: 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 0b30d43..5b055bc 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -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 -- EW