From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id CE08C63381F for ; Mon, 29 Feb 2016 01:41:11 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/8] http: document event_write usage Date: Mon, 29 Feb 2016 01:41:01 +0000 Message-Id: <20160229014107.7396-3-e@80x24.org> In-Reply-To: <20160229014107.7396-1-e@80x24.org> References: <20160229014107.7396-1-e@80x24.org> List-Id: 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(-) diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 4d771f2..a472388 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) }); } } -- EW