From 42bb1574bf35a18f037d4ca8b0e6696192d301df Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 10 Jun 2019 01:33:30 +0000 Subject: ds: simplify write buffer accounting Keeping track of write_buf_size was redundant and pointless when we can simply check the number of elements in the buffer array. Multiple sources of truth leads to confusion; confusion leads to bugs. Finally, rename the prefixes to 'wbuf' to ensure we loudly (instead of silently) break any external dependencies being ported over from Danga::Socket, as further changes are pending. --- lib/PublicInbox/HTTPD/Async.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/HTTPD/Async.pm') diff --git a/lib/PublicInbox/HTTPD/Async.pm b/lib/PublicInbox/HTTPD/Async.pm index dbe8a84a..60701085 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); unless ($http->{closed}) { # PublicInbox::DS sets this - if ($http->{write_buf_size}) { + if (scalar @{$http->{wbuf}}) { $self->watch_read(0); $http->write(restart_read_cb($self)); } -- cgit v1.2.3-24-ge0c7