From: Eric Wong Date: Mon, 29 Feb 2016 00:13:43 +0000 (+0000) Subject: http: document event_write usage X-Git-Tag: v1.0.0~679 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=f3bb7c21292cf91a203a1afd0833b84e3c1b1e20;p=public-inbox.git http: document event_write usage It may not be obvious where we are when we enter the event_write callback. Hopefully this clarifies things. --- 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) }); } }