* [PATCH] wwwstream: improve documentation and variable naming
@ 2016-12-03 0:29 7% Eric Wong
0 siblings, 0 replies; 1+ results
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 related [relevance 7%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-12-03 0:29 7% [PATCH] wwwstream: improve documentation and variable naming Eric Wong
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).