]> git.saurik.com Git - apt.git/commitdiff
http: skip connection cleanup if we close it anyhow
authorDavid Kalnischkies <david@kalnischkies.de>
Fri, 11 Nov 2016 09:32:31 +0000 (10:32 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Fri, 11 Nov 2016 22:40:37 +0000 (23:40 +0100)
Suggested in #529794

methods/http.cc

index d5a00211fff5a0f8c8ef8f788e266c850f5895e1..8d3c569c1750946b0a42d358f3825b06436d9b17 100644 (file)
@@ -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);
 }