unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] nntp: return if a client drops on us
@ 2016-07-09  0:02 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2016-07-09  0:02 UTC (permalink / raw)
  To: meta

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-09  0:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-09  0:02 [PATCH] nntp: return if a client drops on us Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).