user/dev discussion of public-inbox itself
 help / Atom feed
* [PATCH] wwwstream: improve documentation and variable naming
@ 2016-12-03  0:29 Eric Wong
  0 siblings, 0 replies; 1+ messages in thread
From: Eric Wong @ 2016-12-03  0:29 UTC (permalink / raw)
  To: meta

Hopefully this makes the code more readable for newbies.
---
 lib/PublicInbox/WwwStream.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm
index 12f5fa5..01f7b31 100644
--- a/lib/PublicInbox/WwwStream.pm
+++ b/lib/PublicInbox/WwwStream.pm
@@ -12,6 +12,7 @@ our $TOR2WEB_URL = 'https://www.tor2web.org/';
 our $CODE_URL = 'https://public-inbox.org/';
 our $PROJECT = 'public-inbox';
 
+# noop for HTTP.pm (and any other PSGI servers)
 sub close {}
 
 sub new {
@@ -111,14 +112,15 @@ sub _html_end {
 	).'</pre></body></html>';
 }
 
+# callback for HTTP.pm (and any other PSGI servers)
 sub getline {
 	my ($self) = @_;
 	my $nr = $self->{nr}++;
 
 	return _html_top($self) if $nr == 0;
 
-	if (my $mid = $self->{cb}) { # middle
-		$mid = $mid->($nr, $self->{ctx}) and return $mid;
+	if (my $middle = $self->{cb}) {
+		$middle = $middle->($nr, $self->{ctx}) and return $middle;
 	}
 
 	delete $self->{cb} ? _html_end($self) : undef;
-- 
EW


^ permalink raw reply	[flat|threaded] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-03  0:29 [PATCH] wwwstream: improve documentation and variable naming Eric Wong

user/dev discussion of public-inbox itself

Archives are clonable:
	git clone --mirror http://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.org/gmane.mail.public-inbox.general

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox