]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/GitHTTPBackend.pm
git-http-backend: close pipe for generic PSGI on errors
[public-inbox.git] / lib / PublicInbox / GitHTTPBackend.pm
index 18194441e888da321250b5ab3609cce544e515ac..58e75cde50e20cd35d8ecd7ae1beb7b1aacf1009 100644 (file)
@@ -210,7 +210,12 @@ sub serve_smart {
                my $r = $rd_hdr->() or return;
                $rd_hdr = undef;
                if (scalar(@$r) == 3) { # error:
-                       $async->close if $async;
+                       if ($async) {
+                               $async->close; # calls rpipe->close
+                       } else {
+                               $rpipe->close;
+                               $end->();
+                       }
                        return $res->($r);
                }
                if ($async) {