Merge "Close connection before retrying" into lmp-dev
am: a8648ecebb
Change-Id: I744fdb979aa2803b53d3ff6f4e3e72f6f1160d74
This commit is contained in:
@@ -131,7 +131,13 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
|
||||
|
||||
private void teardownConnection() {
|
||||
if (mConnection != null) {
|
||||
mInputStream = null;
|
||||
if (mInputStream != null) {
|
||||
try {
|
||||
mInputStream.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
mInputStream = null;
|
||||
}
|
||||
|
||||
mConnection.disconnect();
|
||||
mConnection = null;
|
||||
@@ -292,8 +298,7 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
|
||||
mCurrentOffset = offset;
|
||||
} catch (IOException e) {
|
||||
mTotalSize = -1;
|
||||
mInputStream = null;
|
||||
mConnection = null;
|
||||
teardownConnection();
|
||||
mCurrentOffset = -1;
|
||||
|
||||
throw e;
|
||||
|
||||
Reference in New Issue
Block a user