am 399792b8: am 06ac0399: am b676b73e: Merge "When http streaming and Content-Length is unknown, make sure to return all" into honeycomb-mr1

* commit '399792b83174a835840a4f47adcd34aed4e0b9ba':
  When http streaming and Content-Length is unknown, make sure to return all
This commit is contained in:
Andreas Huber
2011-03-30 16:40:43 -07:00
committed by Android Git Automerger

View File

@@ -420,7 +420,14 @@ ssize_t NuHTTPDataSource::readAt(off64_t offset, void *data, size_t size) {
internalRead((uint8_t *)data + numBytesRead, size - numBytesRead);
if (n < 0) {
return n;
if (numBytesRead == 0 || mContentLengthValid) {
return n;
}
// If there was an error we want to at least return the data
// we've already successfully read. The next call to read will
// then return the error.
n = 0;
}
int64_t delayUs = ALooper::GetNowUs() - startTimeUs;