From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C797D20798 for ; Sun, 25 Dec 2016 10:36:56 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 4/4] httpd/async: improve variable naming Date: Sun, 25 Dec 2016 10:36:53 +0000 Message-Id: <20161225103653.8325-5-e@80x24.org> In-Reply-To: <20161225103653.8325-1-e@80x24.org> References: <20161225103653.8325-1-e@80x24.org> List-Id: We only refer to PublicInbox::HTTP objects here, so '$io' was a bad name. --- lib/PublicInbox/HTTPD/Async.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/PublicInbox/HTTPD/Async.pm b/lib/PublicInbox/HTTPD/Async.pm index 68514f5..79951ca 100644 --- a/lib/PublicInbox/HTTPD/Async.pm +++ b/lib/PublicInbox/HTTPD/Async.pm @@ -30,10 +30,10 @@ sub restart_read_cb ($) { } sub async_pass { - my ($self, $io, $fh, $bref) = @_; - # In case the client HTTP connection ($io) dies, it + my ($self, $http, $fh, $bref) = @_; + # In case the client HTTP connection ($http) dies, it # will automatically close this ($self) object. - $io->{forward} = $self; + $http->{forward} = $self; $fh->write($$bref); my $restart_read = restart_read_cb($self); weaken($self); @@ -41,10 +41,10 @@ sub async_pass { my $r = sysread($self->{sock}, $$bref, 8192); if ($r) { $fh->write($$bref); - return if $io->{closed}; - if ($io->{write_buf_size}) { + return if $http->{closed}; + if ($http->{write_buf_size}) { $self->watch_read(0); - $io->write($restart_read); # D::S::write + $http->write($restart_read); # D::S::write } # stay in watch_read, but let other clients # get some work done, too. @@ -55,7 +55,7 @@ sub async_pass { # Done! Error handling will happen in $fh->close # called by the {cleanup} handler - $io->{forward} = undef; + $http->{forward} = undef; $self->close; } } -- EW