retry without partial data after a 416 response
[ntk/apt.git] / methods / mirror.cc
index eb6d974..8543663 100644 (file)
@@ -150,7 +150,7 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str)
    for (std::vector<std::string>::const_iterator I = vec.begin();
         I != vec.end(); ++I)
       if (I == vec.begin())
-         fetch += "?arch" + (*I);
+         fetch += "?arch=" + (*I);
       else
          fetch += "&arch=" + (*I);
 
@@ -311,6 +311,9 @@ bool MirrorMethod::InitMirrors()
 
       AllMirrors.push_back(s);
    }
+   if (AllMirrors.empty()) {
+       return _error->Error(_("No entry found in mirror file '%s'"), MirrorFile.c_str());
+   }
    Mirror = AllMirrors[0];
    UsedMirror = Mirror;
    return true;