From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 160E41F4B9 for ; Sat, 29 Jun 2019 19:59:52 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 03/11] http: use requeue instead of watch_in1 Date: Sat, 29 Jun 2019 19:59:43 +0000 Message-Id: <20190629195951.32160-4-e@80x24.org> In-Reply-To: <20190629195951.32160-1-e@80x24.org> References: <20190629195951.32160-1-e@80x24.org> List-Id: 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. --- lib/PublicInbox/DS.pm | 2 -- lib/PublicInbox/HTTP.pm | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) 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; } } -- EW