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
This commit is contained in:
parent
784e8a6344
commit
fea75f2e42
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user