Commit fea75f2e by aquilescanta Committed by Oliver Woodman

Prevent "unexpected read attempt" illegal state exception

When using cronet data source, calling read after the end of input has
been read will trigger this.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184667794
parent 784e8a63
......@@ -369,6 +369,7 @@ public class CronetDataSource extends UrlRequest.Callback implements HttpDataSou
throw new HttpDataSourceException(exception, currentDataSpec,
HttpDataSourceException.TYPE_READ);
} else if (finished) {
bytesRemaining = 0;
return C.RESULT_END_OF_INPUT;
} else {
// The operation didn't time out, fail or finish, and therefore data must have been read.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment