]> Sergey Matveev's repositories - public-inbox.git/commitdiff
http: use requeue instead of watch_in1
authorEric Wong <e@80x24.org>
Thu, 27 Jun 2019 21:21:04 +0000 (21:21 +0000)
committerEric Wong <e@80x24.org>
Sat, 29 Jun 2019 19:59:00 +0000 (19:59 +0000)
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
lib/PublicInbox/HTTP.pm

index 9f24534788a4e26d9e43ad54b4547c27e253c964..8f1494f65d33411a95c156ec9b5845dcf59834e6 100644 (file)
@@ -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) = @_;
index 1153ef98779ff6390107afffd3174dacbe3da8f5..856b89598357239f7a115d3c296566a303969879 100644 (file)
@@ -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;
        }
 }