am 83cf6d5b: Defeat connection reuse to really cancel.
Jeff Sharkey [Fri, 7 Nov 2014 22:50:35 +0000 (22:50 +0000)]
* commit '83cf6d5b7504abda93420d04efa4f96d5f86a1df':
  Defeat connection reuse to really cancel.

src/com/android/providers/downloads/DownloadThread.java

index 51e71b2..c0f5a5e 100644 (file)
@@ -792,6 +792,10 @@ public class DownloadThread implements Runnable {
         // easily resume partial downloads.
         conn.setRequestProperty("Accept-Encoding", "identity");
 
+        // Defeat connection reuse, since otherwise servers may continue
+        // streaming large downloads after cancelled.
+        conn.setRequestProperty("Connection", "close");
+
         if (resuming) {
             if (mInfoDelta.mETag != null) {
                 conn.addRequestProperty("If-Match", mInfoDelta.mETag);