From 0e1c3fe09a06faf24f7bca159020f69730f1275a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 24 Jun 2019 02:52:09 +0000 Subject: ds: lazy-initialize wbuf We don't need write buffering unless we encounter slow clients requesting large responses. So don't waste a hash slot or (empty) arrayref for it. --- lib/PublicInbox/HTTPD/Async.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/HTTPD') diff --git a/lib/PublicInbox/HTTPD/Async.pm b/lib/PublicInbox/HTTPD/Async.pm index 261a01e0..46ea188c 100644 --- a/lib/PublicInbox/HTTPD/Async.pm +++ b/lib/PublicInbox/HTTPD/Async.pm @@ -46,7 +46,7 @@ sub main_cb ($$$) { if ($r) { $fh->write($$bref); if ($http->{sock}) { # !closed - if (scalar @{$http->{wbuf}}) { + if ($http->{wbuf}) { $self->watch_read(0); $http->write(restart_read_cb($self)); } -- cgit v1.2.3-24-ge0c7