Finally fix bogus terrasync download numbers.

(Staying a hotel with sufficiently slow wi-fi to debug this!)
This commit is contained in:
James Turner
2016-11-13 22:18:32 +01:00
parent ee02750e95
commit ab70090a0a

View File

@@ -756,7 +756,12 @@ size_t HTTPRepository::bytesToDownload() const
}
for (r = _d->activeRequests.begin(); r != _d->activeRequests.end(); ++r) {
result += (*r)->contentSize() - (*r)->responseBytesReceived();
if ((*r)->contentSize() > 0) {
// Content size for root dirindex of a repository is zero,
// and returing a negative value breaks everyting, so just ignore
// it
result += (*r)->contentSize() - (*r)->responseBytesReceived();
}
}
return result;