]> git.saurik.com Git - apt.git/blobdiff - methods/http.cc
act on various suggestions from cppcheck
[apt.git] / methods / http.cc
index af3d5ccb673c8882df511ca41c86cf2141eac2bb..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
@@ -778,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()                                           /*{{{*/