]> Sergey Matveev's repositories - public-inbox.git/commitdiff
httpd/async: improve variable naming
authorEric Wong <e@80x24.org>
Sun, 25 Dec 2016 08:09:48 +0000 (08:09 +0000)
committerEric Wong <e@80x24.org>
Sun, 25 Dec 2016 10:31:59 +0000 (10:31 +0000)
We only refer to PublicInbox::HTTP objects here, so '$io'
was a bad name.

lib/PublicInbox/HTTPD/Async.pm

index 68514f5a5a2123b377da389a527280fa19706c25..79951ca6292d44c7909966af033424be31184f6d 100644 (file)
@@ -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;
        }
 }