From 4af7bae3e1342e5ae8015a8d8e74ba4dfb5d14f5 Mon Sep 17 00:00:00 2001 From: Ilya Lebedev Date: Wed, 6 Mar 2013 14:26:37 +0400 Subject: [PATCH 1/2] fixed range for empty slice --- lib/FileAPI.XHR.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/FileAPI.XHR.js b/lib/FileAPI.XHR.js index d08d54e4..f0bff0ed 100644 --- a/lib/FileAPI.XHR.js +++ b/lib/FileAPI.XHR.js @@ -223,7 +223,7 @@ }; data.start = data.end + 1; - data.end = Math.min(data.start + options.chunkSize, data.size ) - 1; + data.end = Math.max(Math.min(data.start + options.chunkSize, data.size ) - 1, data.start); var slice; (slice = 'slice') in data.file || (slice = 'mozSlice') in data.file || (slice = 'webkitSlice') in data.file; From 14f2d461494008d7d1da9b143c50c7b773678803 Mon Sep 17 00:00:00 2001 From: Ilya Lebedev Date: Mon, 15 Apr 2013 15:23:51 +0400 Subject: [PATCH 2/2] fixed abort handling --- lib/FileAPI.XHR.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/FileAPI.XHR.js b/lib/FileAPI.XHR.js index f0bff0ed..0787896b 100644 --- a/lib/FileAPI.XHR.js +++ b/lib/FileAPI.XHR.js @@ -128,6 +128,10 @@ } else { // html5 + if (this.xhr && this.xhr.aborted) { + api.log("Error: already aborted"); + return; + } xhr = _this.xhr = api.getXHR(); if (data.params) {