From 2251a10158054d89868ff73784ce7af6e28949fa Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 26 Oct 2021 10:35:57 +0000 Subject: 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. --- lib/PublicInbox/InputPipe.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox') 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 -- cgit v1.2.3-24-ge0c7