]> Sergey Matveev's repositories - public-inbox.git/commitdiff
http: document event_write usage
authorEric Wong <e@80x24.org>
Mon, 29 Feb 2016 00:13:43 +0000 (00:13 +0000)
committerEric Wong <e@80x24.org>
Mon, 29 Feb 2016 00:27:44 +0000 (00:27 +0000)
It may not be obvious where we are when we enter the event_write
callback.  Hopefully this clarifies things.

lib/PublicInbox/HTTP.pm

index 4d771f2bfcdcee160c17e2743e85c58a96a04c2e..a472388d72e87949dae98535b49aa36979b8dc19 100644 (file)
@@ -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) });
        }
 }