Skip to content

Commit 0a82711

Browse files
committed
refactor
1 parent 610f859 commit 0a82711

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

library/src/main/java/com/qiniu/android/http/ResponseInfo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ public boolean needRetry() {
117117
|| (statusCode == 200 && error != null));
118118
}
119119

120-
public boolean isQiniu() {
121-
return statusCode < 500 && statusCode >= 200 && reqId == null;
120+
public boolean isNotQiniu() {
121+
return statusCode < 500 && statusCode >= 200 && reqId != null;
122122
}
123123

124124
public String toString() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public void complete(ResponseInfo info, JSONObject response) {
126126
host = config.upHostBackup;
127127
}
128128
boolean forceIp = false;
129-
if (!info.isQiniu() && !token.hasReturnUrl()){
129+
if (info.isNotQiniu() && !token.hasReturnUrl()){
130130
forceIp = true;
131131
}
132132
httpManager.multipartPost(genUploadAddress(host, config.upPort), args, progress, retried, options.cancellationSignal, forceIp);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private int calcBlockSize(int offset) {
165165
}
166166

167167
private boolean isCancelled() {
168-
return options.cancellationSignal != null && options.cancellationSignal.isCancelled();
168+
return options.cancellationSignal.isCancelled();
169169
}
170170

171171
private void nextTask(final int offset, final int retried, final String host) {
@@ -221,7 +221,7 @@ public void complete(ResponseInfo info, JSONObject response) {
221221
nextTask((offset / Configuration.BLOCK_SIZE) * Configuration.BLOCK_SIZE, retried, host);
222222
return;
223223
}
224-
if (!info.isQiniu() && !token.hasReturnUrl()){
224+
if (info.isNotQiniu() && !token.hasReturnUrl()){
225225
forceIp = true;
226226
}
227227
if (retried >= config.retryMax || !info.needRetry()) {

0 commit comments

Comments
 (0)