Skip to content

Commit 75a0381

Browse files
committed
Merge pull request #84 from wingedfox/master
Fixed connection abort when waiting for connection recovery
2 parents 876689e + 14f2d46 commit 75a0381

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/FileAPI.XHR.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@
128128
}
129129
else {
130130
// html5
131+
if (this.xhr && this.xhr.aborted) {
132+
api.log("Error: already aborted");
133+
return;
134+
}
131135
xhr = _this.xhr = api.getXHR();
132136

133137
if (data.params) {
@@ -223,7 +227,7 @@
223227
};
224228

225229
data.start = data.end + 1;
226-
data.end = Math.min(data.start + options.chunkSize, data.size ) - 1;
230+
data.end = Math.max(Math.min(data.start + options.chunkSize, data.size ) - 1, data.start);
227231

228232
var slice;
229233
(slice = 'slice') in data.file || (slice = 'mozSlice') in data.file || (slice = 'webkitSlice') in data.file;

0 commit comments

Comments
 (0)