From f3bb7c21292cf91a203a1afd0833b84e3c1b1e20 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 29 Feb 2016 00:13:43 +0000 Subject: http: document event_write usage It may not be obvious where we are when we enter the event_write callback. Hopefully this clarifies things. --- lib/PublicInbox/HTTP.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/HTTP.pm') diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 4d771f2b..a472388d 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -201,10 +201,9 @@ sub event_write { # only continue watching for readability when we are done writing: return if $self->write(undef) != 1; - if ($self->{rbuf} eq '') { + if ($self->{rbuf} eq '') { # wait for next request $self->watch_read(1); - } else { - # avoid recursion for pipelined requests + } else { # avoid recursion for pipelined requests Danga::Socket->AddTimer(0, sub { rbuf_process($self) }); } } -- cgit v1.2.3-24-ge0c7