diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 32c1c9691..08c2a3900 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,3 +1,18 @@ +Release 4.5.2 +------------------- + +HttpClient 4.5.2 (GA) is a maintenance release that fixes a number of minor defects found since 4.5.1. + +Please note that as of 4.4 HttpClient requires Java 1.6 or newer. + +Changelog: +------------------- + +* [HTTPCLIENT-1714] Add HttpClientBuilder.setDnsResolver(DnsResolver). + Contributed by Alexis Thaveau + + + Release 4.5.1 ------------------- diff --git a/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java b/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java index 9cf34397d..943848cb6 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java @@ -74,6 +74,7 @@ import org.apache.http.config.Lookup; import org.apache.http.config.RegistryBuilder; import org.apache.http.config.SocketConfig; import org.apache.http.conn.ConnectionKeepAliveStrategy; +import org.apache.http.conn.DnsResolver; import org.apache.http.conn.HttpClientConnectionManager; import org.apache.http.conn.SchemePortResolver; import org.apache.http.conn.routing.HttpRoutePlanner; @@ -168,6 +169,7 @@ public class HttpClientBuilder { private AuthenticationStrategy proxyAuthStrategy; private UserTokenHandler userTokenHandler; private HttpProcessor httpprocessor; + private DnsResolver dnsResolver; private LinkedList requestFirst; private LinkedList requestLast; @@ -610,6 +612,16 @@ public class HttpClientBuilder { return this; } + /** + * Assigns {@link DnsResolver} instance. + *

+ * Please note this value can be overridden by the {@link #setConnectionManager(HttpClientConnectionManager)} method. + */ + public final HttpClientBuilder setDnsResolver(final DnsResolver dnsResolver) { + this.dnsResolver = dnsResolver; + return this; + } + /** * Assigns {@link HttpRequestRetryHandler} instance. *

@@ -965,7 +977,7 @@ public class HttpClientBuilder { .build(), null, null, - null, + dnsResolver, connTimeToLive, connTimeToLiveTimeUnit != null ? connTimeToLiveTimeUnit : TimeUnit.MILLISECONDS); if (defaultSocketConfig != null) {