make https honor ExpectedSize as well

This commit is contained in:
Michael Vogt
2014-08-26 19:20:04 -07:00
parent dcd5856b11
commit ffd2dd93a6
2 changed files with 8 additions and 1 deletions
+6
View File
@@ -81,6 +81,12 @@ 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)
return _error->Error("Writing more data than expected (%llu > %llu)",
me->TotalWritten, me->Queue->ExpectedSize);
return size*nmemb;
}