]> git.saurik.com Git - apt.git/commitdiff
methods/https.cc: use File->Tell() here too
authorMichael Vogt <mvo@ubuntu.com>
Tue, 7 Oct 2014 06:16:51 +0000 (08:16 +0200)
committerMichael Vogt <mvo@ubuntu.com>
Tue, 7 Oct 2014 06:16:51 +0000 (08:16 +0200)
methods/https.cc

index eec858417af0262c8496ea665f901274301515d1..f8e84a2ffd7b984a48cd1532b580f0b382768770 100644 (file)
@@ -82,8 +82,7 @@ HttpsMethod::write_data(void *buffer, size_t size, size_t nmemb, void *userp)
    if(me->File->Write(buffer, size*nmemb) != true)
       return false;
 
-   me->TotalWritten += size*nmemb;
-   if(me->TotalWritten > me->Queue->ExpectedSize)
+   if(me->Queue->ExpectedSize > 0 && me->File->Tell() > me->Queue->ExpectedSize)
       return _error->Error("Writing more data than expected (%llu > %llu)",
                            me->TotalWritten, me->Queue->ExpectedSize);