diff options
author | Eric Wong <e@80x24.org> | 2019-06-30 05:15:56 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-06-30 05:16:15 +0000 |
commit | 97c346050509758b5d5152f6ff1e0b0f8d871954 (patch) | |
tree | 5b5b62c340ad08514d0ac58f4308e61fb749f3a8 | |
parent | d20a122c48a274e224d5c1a8d0f943ae395cff2a (diff) | |
download | public-inbox-97c346050509758b5d5152f6ff1e0b0f8d871954.tar.gz |
We need to ensure all these subroutines return false on incomplete.
-rw-r--r-- | lib/PublicInbox/DS.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index 57c42063..586c47cd 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -440,6 +440,7 @@ sub do_read ($$$;$) { if ($! == EAGAIN) { epwait($sock, epbit($sock, EPOLLIN) | EPOLLONESHOT); rbuf_idle($self, $rbuf); + 0; } else { $self->close; } @@ -559,7 +560,6 @@ sub epwait ($$) { my ($sock, $ev) = @_; epoll_ctl($Epoll, EPOLL_CTL_MOD, fileno($sock), $ev) and confess("EPOLL_CTL_MOD $!"); - 0; } # return true if complete, false if incomplete (or failure) @@ -570,8 +570,10 @@ sub accept_tls_step ($) { return $self->close if $! != EAGAIN; epwait($sock, PublicInbox::TLS::epollbit() | EPOLLONESHOT); unshift @{$self->{wbuf} ||= []}, \&accept_tls_step; + 0; } +# return true if complete, false if incomplete (or failure) sub shutdn_tls_step ($) { my ($self) = @_; my $sock = $self->{sock} or return; @@ -579,6 +581,7 @@ sub shutdn_tls_step ($) { return $self->close if $! != EAGAIN; epwait($sock, PublicInbox::TLS::epollbit() | EPOLLONESHOT); unshift @{$self->{wbuf} ||= []}, \&shutdn_tls_step; + 0; } # don't bother with shutdown($sock, 2), we don't fork+exec w/o CLOEXEC |