X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FDS.pm;h=586c47cdc8cef94e05509dfbf0a82136a147f870;hb=97c346050509758b5d5152f6ff1e0b0f8d871954;hp=57c420634ca42529f8b7c01a29d459723ad5933c;hpb=d20a122c48a274e224d5c1a8d0f943ae395cff2a;p=public-inbox.git 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