]> git.saurik.com Git - apt.git/blobdiff - methods/http.cc
./prepare-release pre-export
[apt.git] / methods / http.cc
index e4773b0e245a924bc4440352406b0101b4472987..78b20e66d304cde4a383bf6f91143d89e4bc3e40 100644 (file)
@@ -447,7 +447,7 @@ bool HttpServerState::RunData(FileFd * const File)
       else if (JunkSize != 0)
         In.Limit(JunkSize);
       else
-        In.Limit(Size - StartPos);
+        In.Limit(DownloadSize);
       
       // Just transfer the whole block.
       do
@@ -484,16 +484,14 @@ APT_PURE bool HttpServerState::IsOpen()                                   /*{{{*/
    return (ServerFd != -1);
 }
                                                                        /*}}}*/
-bool HttpServerState::InitHashes(FileFd &File, HashStringList const &ExpectedHashes)/*{{{*/
+bool HttpServerState::InitHashes(HashStringList const &ExpectedHashes) /*{{{*/
 {
    delete In.Hash;
    In.Hash = new Hashes(ExpectedHashes);
-
-   // Set the expected size and read file for the hashes
-   File.Truncate(StartPos);
-   return In.Hash->AddFD(File, StartPos);
+   return true;
 }
                                                                        /*}}}*/
+
 APT_PURE Hashes * HttpServerState::GetHashes()                         /*{{{*/
 {
    return In.Hash;
@@ -780,9 +778,9 @@ bool HttpMethod::Configuration(string Message)
    return true;
 }
                                                                        /*}}}*/
-ServerState * HttpMethod::CreateServerState(URI uri)                   /*{{{*/
+std::unique_ptr<ServerState> HttpMethod::CreateServerState(URI const &uri)/*{{{*/
 {
-   return new HttpServerState(uri, this);
+   return std::unique_ptr<ServerState>(new HttpServerState(uri, this));
 }
                                                                        /*}}}*/
 void HttpMethod::RotateDNS()                                           /*{{{*/