]> git.saurik.com Git - apt.git/blobdiff - methods/http.cc
Japanese manpages translation update
[apt.git] / methods / http.cc
index 1ed2e362969a57d58bd3f42a653209c245a28a97..11136bb9a782a7e0e86d82d174f9d142e0ab4771 100644 (file)
@@ -357,6 +357,9 @@ bool HttpServerState::Open()
         Proxy = "";
    }
 
+   if (Proxy.empty() == false)
+      Owner->AddProxyAuth(Proxy, ServerName);
+
    if (Proxy.Access == "socks5h")
    {
       if (Connect(Proxy.Host, Proxy.Port, "socks", 1080, ServerFd, TimeOut, Owner) == false)
@@ -644,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()                         /*{{{*/
 {
@@ -896,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)