Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64 am: 4b78a79546 am: 6d5bc9a3c2 am: 3272cf26c1 am: e18e8c4113
am: 69b6a382a3
Change-Id: I2c599bac680bda5d4dcfa4f3b9fb5f1413839da0
This commit is contained in:
@@ -135,7 +135,13 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
|
|||||||
|
|
||||||
private void teardownConnection() {
|
private void teardownConnection() {
|
||||||
if (mConnection != null) {
|
if (mConnection != null) {
|
||||||
mInputStream = null;
|
if (mInputStream != null) {
|
||||||
|
try {
|
||||||
|
mInputStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
}
|
||||||
|
mInputStream = null;
|
||||||
|
}
|
||||||
|
|
||||||
mConnection.disconnect();
|
mConnection.disconnect();
|
||||||
mConnection = null;
|
mConnection = null;
|
||||||
@@ -297,8 +303,7 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
|
|||||||
mCurrentOffset = offset;
|
mCurrentOffset = offset;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
mTotalSize = -1;
|
mTotalSize = -1;
|
||||||
mInputStream = null;
|
teardownConnection();
|
||||||
mConnection = null;
|
|
||||||
mCurrentOffset = -1;
|
mCurrentOffset = -1;
|
||||||
|
|
||||||
throw e;
|
throw e;
|
||||||
|
|||||||
Reference in New Issue
Block a user