projects
/
public-inbox.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c972f3
)
httpd/async: do not attempt future writes on closed sockets
author
Eric Wong <e@80x24.org>
Sat, 9 Jul 2016 04:51:36 +0000 (
04:51
+0000)
committer
Eric Wong <e@80x24.org>
Sat, 9 Jul 2016 04:52:11 +0000 (
04:52
+0000)
Danga::Socket::close does not clear the write_buf_size field,
so it's conceivable we could attempt to queue up data and
callbacks we can never flush out.
lib/PublicInbox/HTTPD/Async.pm
patch
|
blob
|
history
diff --git
a/lib/PublicInbox/HTTPD/Async.pm
b/lib/PublicInbox/HTTPD/Async.pm
index a936d9b5a0c6fc5e3988c88085437a1322b13333..880cf021cef763a97ea9add08cea295d4c9789fa 100644
(file)
--- a/
lib/PublicInbox/HTTPD/Async.pm
+++ b/
lib/PublicInbox/HTTPD/Async.pm
@@
-41,6
+41,7
@@
sub async_pass {
my $r = sysread($self->{sock}, $$bref, 8192);
if ($r) {
$fh->write($$bref);
+ return if $io->{closed};
if ($io->{write_buf_size}) {
$self->watch_read(0);
$io->write($restart_read); # D::S::write