- my $async = delete $self->{async};
- if (scalar(@$r) == 3) { # error
- if ($async) {
- # calls rpipe->close && ->event_step
- $async->close;
- } else {
- $self->{rpipe}->close;
+ my $async = delete $self->{async}; # PublicInbox::HTTPD::Async
+ if (ref($r) ne 'ARRAY' || scalar(@$r) == 3) { # error
+ if ($async) { # calls rpipe->close && ->event_step
+ $async->close; # PublicInbox::HTTPD::Async::close
+ } else { # generic PSGI:
+ delete($self->{rpipe})->close;