summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVasu Nori <vnori@google.com>2011-02-10 11:13:09 -0800
committerVasu Nori <vnori@google.com>2011-02-10 11:13:09 -0800
commit43e3f0d1295d43f763b65b3140f6cf98e2562dbd (patch)
treefbc9304d3e4c5dc58ae237712a4e249ab85e3ecb /src
parent0b7d5ff671cec08960e85de9e79231191c606d70 (diff)
downloadandroid_packages_providers_DownloadProvider-43e3f0d1295d43f763b65b3140f6cf98e2562dbd.tar.gz
android_packages_providers_DownloadProvider-43e3f0d1295d43f763b65b3140f6cf98e2562dbd.tar.bz2
android_packages_providers_DownloadProvider-43e3f0d1295d43f763b65b3140f6cf98e2562dbd.zip
bug:3422868 collect additional info to debug this problem
this bug is not so easy to reproduce. so, this CL will produce some additional logging info for better insight Change-Id: I0d53c647f1b98a49eb93b937c8e7203723c33dbe
Diffstat (limited to 'src')
-rw-r--r--src/com/android/providers/downloads/DownloadThread.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java
index de570ff5..100ebcab 100644
--- a/src/com/android/providers/downloads/DownloadThread.java
+++ b/src/com/android/providers/downloads/DownloadThread.java
@@ -111,6 +111,7 @@ public class DownloadThread extends Thread {
public String mHeaderContentLocation;
public int mBytesNotified = 0;
public long mTimeLastNotification = 0;
+ public long mTotalBytes = -1;
}
/**
@@ -600,7 +601,8 @@ public class DownloadThread extends Thread {
header = response.getFirstHeader("Content-Length");
if (header != null) {
innerState.mHeaderContentLength = header.getValue();
- mInfo.mTotalBytes = Long.parseLong(innerState.mHeaderContentLength);
+ innerState.mTotalBytes = mInfo.mTotalBytes =
+ Long.parseLong(innerState.mHeaderContentLength);
}
} else {
// Ignore content-length with transfer-encoding - 2616 4.4 3
@@ -656,6 +658,13 @@ public class DownloadThread extends Thread {
*/
private void handleOtherStatus(State state, InnerState innerState, int statusCode)
throws StopRequestException {
+ // STOPSHIP remove this. should help in debugging http://b/issue?id=3422868
+ if (statusCode == 416) {
+ // range request failed. it should never fail.
+ throw new IllegalStateException("Http Range request failure: totalBytes = " +
+ innerState.mTotalBytes + ", bytes recvd so far: " + innerState.mBytesSoFar);
+ }
+ // END STOPSHIP
int finalStatus;
if (Downloads.Impl.isStatusError(statusCode)) {
finalStatus = statusCode;