]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/PktOp.pm
www_stream: extra link to mirroring information in the footer
[public-inbox.git] / lib / PublicInbox / PktOp.pm
index ca098d3cb53993734dc7398843022bc032e9a9a1..10942dd19b6880335fb465d9de4e3f3113755597 100644 (file)
@@ -56,17 +56,14 @@ sub event_step {
                        ($cmd, @pargs) = split(/ /, $msg);
                }
                my $op = $self->{ops}->{$cmd //= $msg};
-               die "BUG: unknown message: `$cmd'" unless $op;
-               my ($sub, @args) = @$op;
-               $sub->(@args, @pargs);
+               if ($op) {
+                       my ($sub, @args) = @$op;
+                       $sub->(@args, @pargs);
+               } elsif ($msg ne '') {
+                       die "BUG: unknown message: `$cmd'";
+               }
                return $self->close if $msg eq ''; # close on EOF
        }
 }
 
-# call this when we're ready to wait on events
-sub op_wait_event {
-       my ($self, $ops) = @_;
-       $self->{ops} = $ops;
-}
-
 1;