From: David Kalnischkies Date: Fri, 11 Nov 2016 09:32:31 +0000 (+0100) Subject: http: skip connection cleanup if we close it anyhow X-Git-Tag: 1.4_beta1~33 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/11c96d7618faecc8fab9edfd83b2b2e0afefda3b http: skip connection cleanup if we close it anyhow Suggested in #529794 --- diff --git a/methods/http.cc b/methods/http.cc index d5a00211f..8d3c569c1 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -648,6 +648,9 @@ bool HttpServerState::RunData(FileFd * const File) /*}}}*/ bool HttpServerState::RunDataToDevNull() /*{{{*/ { + // no need to clean up if we discard the connection anyhow + if (Persistent == false) + return true; FileFd DevNull("/dev/null", FileFd::WriteOnly); return RunData(&DevNull); }