]> git.saurik.com Git - apt.git/blobdiff - methods/http.cc
don't try pipelining if server closes connections
[apt.git] / methods / http.cc
index 0358b50cd25bc37e0031e30f93e82eeb1e2aaa1d..11136bb9a782a7e0e86d82d174f9d142e0ab4771 100644 (file)
@@ -647,6 +647,13 @@ bool HttpServerState::InitHashes(HashStringList const &ExpectedHashes)     /*{{{*/
    return true;
 }
                                                                        /*}}}*/
+void HttpServerState::Reset(bool const Everything)                     /*{{{*/
+{
+   ServerState::Reset(Everything);
+   if (Everything)
+      ServerFd = -1;
+}
+                                                                       /*}}}*/
 
 APT_PURE Hashes * HttpServerState::GetHashes()                         /*{{{*/
 {
@@ -899,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)