diff options
author | Eric Wong <e@80x24.org> | 2021-10-26 10:35:57 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-10-26 17:43:58 +0000 |
commit | 2251a10158054d89868ff73784ce7af6e28949fa (patch) | |
tree | b37eca982806c153a3cff015f52fed5cb9834c77 | |
parent | b35c6389859f13f4f216179dac40a481c3fd7e09 (diff) | |
download | public-inbox-2251a10158054d89868ff73784ce7af6e28949fa.tar.gz |
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.
-rw-r--r-- | lib/PublicInbox/InputPipe.pm | 2 |
1 files changed, 1 insertions, 1 deletions
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 |