about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiAuth.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/LeiAuth.pm')
-rw-r--r--lib/PublicInbox/LeiAuth.pm17
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/PublicInbox/LeiAuth.pm b/lib/PublicInbox/LeiAuth.pm
index 6593ba51..7acb9900 100644
--- a/lib/PublicInbox/LeiAuth.pm
+++ b/lib/PublicInbox/LeiAuth.pm
@@ -43,24 +43,13 @@ sub auth_eof {
 sub auth_start {
         my ($self, $lei, $post_auth_cb, @args) = @_;
         $lei->_lei_cfg(1); # workers may need to read config
-        my $ops = {
-                '!' => [ $lei->can('fail_handler'), $lei ],
-                '|' => [ $lei->can('sigpipe_handler'), $lei ],
-                'x_it' => [ $lei->can('x_it'), $lei ],
-                'child_error' => [ $lei->can('child_error'), $lei ],
+        my $op = $lei->workers_start($self, 'auth', 1, {
                 'nrd_merge' => [ \&nrd_merge, $lei ],
                 '' => [ \&auth_eof, $lei, $post_auth_cb, @args ],
-        };
-        ($lei->{pkt_op_c}, $lei->{pkt_op_p}) = PublicInbox::PktOp->pair($ops);
-        $self->wq_workers_start('lei_auth', 1, $lei->oldset, {lei => $lei});
-        my $op = delete $lei->{pkt_op_c};
-        delete $lei->{pkt_op_p};
+        });
         $self->wq_io_do('do_auth', []);
         $self->wq_close(1);
-        $lei->event_step_init; # wait for shutdowns
-        if ($lei->{oneshot}) {
-                while ($op->{sock}) { $op->event_step }
-        }
+        while ($op && $op->{sock}) { $op->event_step }
 }
 
 sub ipc_atfork_child {