From: Eric Wong Date: Thu, 27 Jun 2019 21:21:04 +0000 (+0000) Subject: http: use requeue instead of watch_in1 X-Git-Tag: v1.2.0~149 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=63eeb22554eb844cee274f71d3541446c28b328f;hp=6306663a3b4167edfd5b1fd640233da96fe9e32f;p=public-inbox.git http: use requeue instead of watch_in1 Don't use epoll or kqueue to watch for anything unless we hit EAGAIN, since we don't know if a socket is SSL or not. --- diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index 9f245347..8f1494f6 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -557,8 +557,6 @@ sub watch ($$) { 0; } -sub watch_in1 ($) { watch($_[0], EPOLLIN | EPOLLONESHOT) } - # return true if complete, false if incomplete (or failure) sub accept_tls_step ($) { my ($self) = @_; diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 1153ef98..856b8959 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -95,7 +95,7 @@ sub rbuf_process { } if ($r < 0) { # incomplete $self->rbuf_idle($rbuf); - return $self->watch_in1; + return $self->requeue; } $$rbuf = substr($$rbuf, $r); my $len = input_prepare($self, \%env); @@ -241,7 +241,7 @@ sub next_request ($) { push @$pipelineq, $self; $pipet ||= PublicInbox::EvCleanup::asap(*process_pipelineq); } else { # wait for next request - $self->watch_in1; + $self->requeue; } }