diff options
author | Eric Wong <e@80x24.org> | 2016-05-27 08:20:59 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-05-27 08:24:12 +0000 |
commit | 3344815088512287243b622658dbb7fbea87beb1 (patch) | |
tree | 2a30df4fa0090eac626d429321aa189164444139 /lib/PublicInbox/GitHTTPBackend.pm | |
parent | 8080aa02383623837770ae12aba85f010442a1f6 (diff) | |
download | public-inbox-3344815088512287243b622658dbb7fbea87beb1.tar.gz |
The generic PSGI code needs to avoid resource leaks if smart cloning is disabled (due to resource contraints).
Diffstat (limited to 'lib/PublicInbox/GitHTTPBackend.pm')
-rw-r--r-- | lib/PublicInbox/GitHTTPBackend.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/PublicInbox/GitHTTPBackend.pm b/lib/PublicInbox/GitHTTPBackend.pm index 18194441..58e75cde 100644 --- a/lib/PublicInbox/GitHTTPBackend.pm +++ b/lib/PublicInbox/GitHTTPBackend.pm @@ -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) { |