]> Sergey Matveev's repositories - public-inbox.git/commitdiff
nntp: simplify update_idle_time
authorEric Wong <e@80x24.org>
Sat, 2 Jul 2016 21:50:29 +0000 (21:50 +0000)
committerEric Wong <e@80x24.org>
Sat, 2 Jul 2016 21:52:30 +0000 (21:52 +0000)
This ought to make things easier when we add TLS support.

lib/PublicInbox/NNTP.pm

index 4b116a7d5b786af92daa95c2e4843aecfd46566f..b07e1845c2321962bb7962a926cc04032ce10aff 100644 (file)
@@ -60,9 +60,8 @@ sub next_tick () {
 
 sub update_idle_time ($) {
        my ($self) = @_;
-       my $tmp = $self->{sock} or return;
-       $tmp = fileno($tmp);
-       defined $tmp and $EXPMAP->{$tmp} = [ now(), $self ];
+       my $fd = $self->{fd};
+       defined $fd and $EXPMAP->{$fd} = [ now(), $self ];
 }
 
 # reduce FD pressure by closing some "git cat-file --batch" processes