@@ -124,10 +124,7 @@ public void complete(ResponseInfo info, JSONObject response) {
124124 if (info .isOK ()) {
125125 options .progressHandler .progress (key , 1.0 );
126126 completionHandler .complete (key , info , response );
127- } else if (options .cancellationSignal .isCancelled ()) {
128- ResponseInfo i = ResponseInfo .cancelled (token );
129- completionHandler .complete (key , i , null );
130- } else if (info .needRetry () || (info .isNotQiniu () && !token .hasReturnUrl ())) {
127+ } else if (info .needRetry ()) {
131128 final String upHostRetry = config .zone .upHost (token .token , config .useHttps , upHost );
132129 Log .d ("Qiniu.FormUploader" , "retry upload first time use up host " + upHostRetry );
133130 CompletionHandler retried = new CompletionHandler () {
@@ -136,15 +133,15 @@ public void complete(ResponseInfo info, JSONObject response) {
136133 if (info .isOK ()) {
137134 options .progressHandler .progress (key , 1.0 );
138135 completionHandler .complete (key , info , response );
139- } else if (info .needRetry () || ( info . isNotQiniu () && ! token . hasReturnUrl ()) ) {
136+ } else if (info .needRetry ()) {
140137 final String upHostRetry2 = config .zone .upHost (token .token , config .useHttps , upHostRetry );
141138 Log .d ("Qiniu.FormUploader" , "retry upload second time use up host " + upHostRetry2 );
142139 CompletionHandler retried2 = new CompletionHandler () {
143140 @ Override
144141 public void complete (ResponseInfo info2 , JSONObject response2 ) {
145142 if (info2 .isOK ()) {
146143 options .progressHandler .progress (key , 1.0 );
147- } else if (info2 .needRetry () || ( info2 . isNotQiniu () && ! token . hasReturnUrl ()) ) {
144+ } else if (info2 .needRetry ()) {
148145 config .zone .frozenDomain (upHostRetry2 );
149146 }
150147 completionHandler .complete (key , info2 , response2 );
@@ -256,7 +253,7 @@ private static ResponseInfo syncUpload0(Client client, Configuration config, byt
256253 }
257254
258255 //retry for the first time
259- if (info .needRetry () || ( info . isNotQiniu () && ! token . hasReturnUrl ()) ) {
256+ if (info .needRetry ()) {
260257 if (info .isNetworkBroken () && !AndroidNetwork .isNetWorkReady ()) {
261258 options .netReadyHandler .waitReady ();
262259 if (!AndroidNetwork .isNetWorkReady ()) {
@@ -269,7 +266,7 @@ private static ResponseInfo syncUpload0(Client client, Configuration config, byt
269266 Log .d ("Qiniu.FormUploader" , "sync upload retry first time use up host " + upHostRetry );
270267 info = client .syncMultipartPost (upHostRetry , args , token );
271268
272- if (info .needRetry () || ( info . isNotQiniu () && ! token . hasReturnUrl ()) ) {
269+ if (info .needRetry ()) {
273270 if (info .isNetworkBroken () && !AndroidNetwork .isNetWorkReady ()) {
274271 options .netReadyHandler .waitReady ();
275272 if (!AndroidNetwork .isNetWorkReady ()) {
@@ -280,7 +277,7 @@ private static ResponseInfo syncUpload0(Client client, Configuration config, byt
280277 String upHostRetry2 = config .zone .upHost (token .token , config .useHttps , upHostRetry );
281278 Log .d ("Qiniu.FormUploader" , "sync upload retry second time use up host " + upHostRetry2 );
282279 info = client .syncMultipartPost (upHostRetry2 , args , token );
283- if (info .needRetry () || ( info . isNotQiniu () && ! token . hasReturnUrl ()) ) {
280+ if (info .needRetry ()) {
284281 config .zone .frozenDomain (upHostRetry2 );
285282 }
286283 }
0 commit comments