Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba7d7874 authored by Andreas Huber's avatar Andreas Huber Committed by Android Git Automerger
Browse files

am b676b73e: Merge "When http streaming and Content-Length is unknown, make...

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

* commit 'b676b73e391b10a4ec5fbd6a1a02054fb3d8aa4b':
  When http streaming and Content-Length is unknown, make sure to return all
parents 62302d34 cbd2ba4e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -410,9 +410,16 @@ ssize_t NuHTTPDataSource::readAt(off64_t offset, void *data, size_t size) {
            internalRead((uint8_t *)data + numBytesRead, size - numBytesRead);

        if (n < 0) {
            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;
        addBandwidthMeasurement_l(n, delayUs);