diff options
author | Eric Wong <e@80x24.org> | 2016-03-12 00:20:12 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-03-12 00:20:51 +0000 |
commit | a45891b9734bb428dd749e4a2b87f7fc28e6eb9d (patch) | |
tree | 78738eba03d7cef4a26438e41d90d8cbfa341006 /lib | |
parent | d5fce291ff67459ccf2939afea0ea6a1157869d8 (diff) | |
download | public-inbox-a45891b9734bb428dd749e4a2b87f7fc28e6eb9d.tar.gz |
Plack::Middleware::Deflater (and perhaps other middleware) triggers zero-byte writes which wastes syscalls when they get passed to Danga::Socket. This may also trigger problems when we introduce TLS support in the future.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/HTTP.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 0675f6a6..28883114 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -371,6 +371,13 @@ sub quit { sub event_hup { $_[0]->close } sub event_err { $_[0]->close } +sub write ($$) : method { + my PublicInbox::HTTP $self = $_[0]; + return 1 if (defined($_[1]) && ref($_[1]) eq '' && $_[1] eq ''); + + $self->SUPER::write($_[1]); +} + # for graceful shutdown in PublicInbox::Daemon: sub busy () { my ($self) = @_; |