]> git.saurik.com Git - apt.git/blobdiff - methods/http.cc
don't sent Range requests if we know its not accepted
[apt.git] / methods / http.cc
index 8d34aa6e3b271e2f2fb7dc698a27bbd4a39bce1c..11136bb9a782a7e0e86d82d174f9d142e0ab4771 100644 (file)
@@ -906,7 +906,7 @@ void HttpMethod::SendReq(FetchItem *Itm)
 
    // Check for a partial file and send if-queries accordingly
    struct stat SBuf;
-   if (stat(Itm->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0)
+   if (Server->RangesAllowed && stat(Itm->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0)
       Req << "Range: bytes=" << std::to_string(SBuf.st_size) << "-\r\n"
         << "If-Range: " << TimeRFC1123(SBuf.st_mtime, false) << "\r\n";
    else if (Itm->LastModified != 0)