* @return A new {@link HttpClient}
*/
public static HttpClient newHttpClient(RiakConfig config) {
HttpClient http = config.getHttpClient();
HttpConnectionManager m;
if (http == null) {
m = new MultiThreadedHttpConnectionManager();
http = new HttpClient(m);
} else {
m = http.getHttpConnectionManager();
}
HttpConnectionManagerParams mp = m.getParams();
if (config.getMaxConnections() != null) {
mp.setMaxTotalConnections(config.getMaxConnections());
mp.setMaxConnectionsPerHost(HostConfiguration.ANY_HOST_CONFIGURATION, config.getMaxConnections());
}