Minor optimization
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1483735 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
013d53a64f
commit
3665ee0d37
|
@ -113,13 +113,17 @@ public class DefaultHttpRequestRetryHandler implements HttpRequestRetryHandler {
|
|||
// Do not retry if over max retry count
|
||||
return false;
|
||||
}
|
||||
for (final Class<? extends IOException> rejectException : this.nonRetriableClasses) {
|
||||
if (rejectException.isInstance(exception)) {
|
||||
return false;
|
||||
if (this.nonRetriableClasses.contains(exception.getClass())) {
|
||||
return false;
|
||||
} else {
|
||||
for (final Class<? extends IOException> rejectException : this.nonRetriableClasses) {
|
||||
if (rejectException.isInstance(exception)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
final HttpClientContext localcontext = HttpClientContext.adapt(context);
|
||||
final HttpRequest request = localcontext.getRequest();
|
||||
final HttpClientContext clientContext = HttpClientContext.adapt(context);
|
||||
final HttpRequest request = clientContext.getRequest();
|
||||
|
||||
if(requestIsAborted(request)){
|
||||
return false;
|
||||
|
@ -130,7 +134,7 @@ public class DefaultHttpRequestRetryHandler implements HttpRequestRetryHandler {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!localcontext.isRequestSent() || this.requestSentRetryEnabled) {
|
||||
if (!clientContext.isRequestSent() || this.requestSentRetryEnabled) {
|
||||
// Retry if the request has not been sent fully or
|
||||
// if it's OK to retry methods that have been sent
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue