From: Eric Wong Date: Tue, 26 Oct 2021 10:35:57 +0000 (+0000) Subject: input_pipe: account for undefined {sock} X-Git-Tag: v1.7.0~45 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=2251a10158054d89868ff73784ce7af6e28949fa input_pipe: account for undefined {sock} It's possible for ->event_step to fire twice due to ->requeue with EPOLLET (but not EPOLLONESHOT). So account for that and avoid causing event loop errors as a result. --- diff --git a/lib/PublicInbox/InputPipe.pm b/lib/PublicInbox/InputPipe.pm index 00813a07..e1e26e20 100644 --- a/lib/PublicInbox/InputPipe.pm +++ b/lib/PublicInbox/InputPipe.pm @@ -18,7 +18,7 @@ sub consume { sub event_step { my ($self) = @_; - my $r = sysread($self->{sock}, my $rbuf, 65536); + my $r = sysread($self->{sock} // return, my $rbuf, 65536); if ($r) { $self->{cb}->(@{$self->{args} // []}, $rbuf); return $self->requeue; # may be regular file or pipe