user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/8] http: document event_write usage
Date: Mon, 29 Feb 2016 01:41:01 +0000	[thread overview]
Message-ID: <20160229014107.7396-3-e@80x24.org> (raw)
In-Reply-To: <20160229014107.7396-1-e@80x24.org>

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


  parent reply	other threads:[~2016-02-29  1:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29  1:40 [PATCH 0/8] another round of HTTP-related fixes Eric Wong
2016-02-29  1:41 ` [PATCH 1/8] http: error check for sysseek on input Eric Wong
2016-02-29  1:41 ` Eric Wong [this message]
2016-02-29  1:41 ` [PATCH 3/8] http: avoid needless time2str calls Eric Wong
2016-02-29  1:41 ` [PATCH 4/8] distinguish error messages intended for users vs developers Eric Wong
2016-02-29  1:41 ` [PATCH 5/8] favor procedural calls for most private functions Eric Wong
2016-02-29  1:41 ` [PATCH 6/8] git-http-backend: stricter parsing of CRLF Eric Wong
2016-02-29  1:41 ` [PATCH 7/8] spawnpp: use env(1) for mod_perl compatibility Eric Wong
2016-02-29  1:41 ` [PATCH 8/8] git-http-backend: fixes for mod_perl Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160229014107.7396-3-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).