am 5b5df6e7: am 83cf6d5b: Defeat connection reuse to really cancel.
Jeff Sharkey [Fri, 7 Nov 2014 22:55:33 +0000 (22:55 +0000)]
* commit '5b5df6e7e71528cc046410746b529bc5243e74a0':
  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);