Skip to content

Commit 4919059

Browse files
committed
fix resumable get up host error, old logic will get up host one by one rather than changing by encountering error
1 parent a0f6b1f commit 4919059

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/src/main/java/com/qiniu/android/storage/ResumeUploader.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,9 @@ public void complete(ResponseInfo info, JSONObject response) {
275275
return;
276276
}
277277

278-
String upHostRetry = config.zone.upHost(token.token, config.useHttps, upHost);
278+
279279
if (!isChunkOK(info, response)) {
280+
String upHostRetry = config.zone.upHost(token.token, config.useHttps, upHost);
280281
if (info.statusCode == 701 && retried < config.retryMax) {
281282
nextTask((offset / Configuration.BLOCK_SIZE) * Configuration.BLOCK_SIZE, retried + 1, upHost);
282283
return;
@@ -295,6 +296,7 @@ public void complete(ResponseInfo info, JSONObject response) {
295296
String context = null;
296297

297298
if (response == null && retried < config.retryMax) {
299+
String upHostRetry = config.zone.upHost(token.token, config.useHttps, upHost);
298300
nextTask(offset, retried + 1, upHostRetry);
299301
return;
300302
}
@@ -306,6 +308,7 @@ public void complete(ResponseInfo info, JSONObject response) {
306308
e.printStackTrace();
307309
}
308310
if ((context == null || crc != ResumeUploader.this.crc32) && retried < config.retryMax) {
311+
String upHostRetry = config.zone.upHost(token.token, config.useHttps, upHost);
309312
nextTask(offset, retried + 1, upHostRetry);
310313
return;
311314
}

0 commit comments

Comments
 (0)