]> git.saurik.com Git - apt.git/blobdiff - methods/server.cc
prevent C++ locale number formatting in text APIs (try 2)
[apt.git] / methods / server.cc
index d606f26aa0408fb38ed52420eee19fbdd8d66f8d..6d147fe129ccc61ed0e51fa8841de5dd62eca15a 100644 (file)
@@ -10,7 +10,6 @@
 // Include Files                                                       /*{{{*/
 #include <config.h>
 
-#include <apt-pkg/acquire-method.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/fileutl.h>
@@ -428,6 +427,8 @@ bool ServerMethod::Fetch(FetchItem *)
    decltype(PipelineDepth) CurrentDepth = 0;
    for (FetchItem const *I = Queue; I != QueueBack; I = I->Next)
       ++CurrentDepth;
+   if (CurrentDepth > AllowedDepth)
+      return true;
 
    do {
       // Make sure we stick with the same server
@@ -557,6 +558,7 @@ int ServerMethod::Loop()
         {
            _error->Error(_("Bad header data"));
            Fail(true);
+           Server->Close();
            RotateDNS();
            continue;
         }
@@ -637,10 +639,7 @@ int ServerMethod::Loop()
                        // yes, he did! Disable pipelining and rewrite queue
                        if (Server->Pipeline == true)
                        {
-                          // FIXME: fake a warning message as we have no proper way of communicating here
-                          std::string out;
-                          strprintf(out, _("Automatically disabled %s due to incorrect response from server/proxy. (man 5 apt.conf)"), "Acquire::http::PipelineDepth");
-                          std::cerr << "W: " << out << std::endl;
+                          Warning(_("Automatically disabled %s due to incorrect response from server/proxy. (man 5 apt.conf)"), "Acquire::http::Pipeline-Depth");
                           Server->Pipeline = false;
                           Server->PipelineAllowed = false;
                           // we keep the PipelineDepth value so that the rest of the queue can be fixed up as well