"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient/src/main/java/org/apache/http/impl/client/DefaultBackoffStrategy.java" between
httpcomponents-client-4.5.9-src.tar.gz and httpcomponents-client-4.5.10-src.tar.gz

About: HttpComponents is an Apache project responsible for creating and maintaining a toolset of low level Java components focused on HTTP and associated protocols. Java sources.

DefaultBackoffStrategy.java  (httpcomponents-client-4.5.9-src):DefaultBackoffStrategy.java  (httpcomponents-client-4.5.10-src)
skipping to change at line 47 skipping to change at line 47
* This {@link ConnectionBackoffStrategy} backs off either for a raw * This {@link ConnectionBackoffStrategy} backs off either for a raw
* network socket or connection timeout or if the server explicitly * network socket or connection timeout or if the server explicitly
* sends a 503 (Service Unavailable) response. * sends a 503 (Service Unavailable) response.
* *
* @since 4.2 * @since 4.2
*/ */
public class DefaultBackoffStrategy implements ConnectionBackoffStrategy { public class DefaultBackoffStrategy implements ConnectionBackoffStrategy {
@Override @Override
public boolean shouldBackoff(final Throwable t) { public boolean shouldBackoff(final Throwable t) {
return (t instanceof SocketTimeoutException return t instanceof SocketTimeoutException || t instanceof ConnectExcept
|| t instanceof ConnectException); ion;
} }
@Override @Override
public boolean shouldBackoff(final HttpResponse resp) { public boolean shouldBackoff(final HttpResponse resp) {
return (resp.getStatusLine().getStatusCode() == HttpStatus.SC_SERVICE_UN AVAILABLE); return resp.getStatusLine().getStatusCode() == HttpStatus.SC_SERVICE_UNA VAILABLE;
} }
} }
 End of changes. 2 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)