Merge "Close connection before retrying" into lmp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a8648ecebb
@@ -130,7 +130,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;
|
||||||
@@ -291,8 +297,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