Marco Balieiro created HTTPCLIENT-2190:
------------------------------------------

             Summary: HttpClientBuilder does not configure correctly the 
HttpClientConnectionManager
                 Key: HTTPCLIENT-2190
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2190
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient (classic)
    Affects Versions: 4.5.13
            Reporter: Marco Balieiro


The class HttpClientBuilder does not configure correctly the 
HttpClientConnectionManager properties "maxTotal" and "defaultMaxPerRoute" if I 
already provided a ConnectionManager.

I sugest that the code on line 1000 should be put out of the "if" that tests if 
the "connManagerCopy" is null. Some think like this:

      if (connManagerCopy instanceof ConnPoolControl) {
            ConnPoolControl<?> connPoolControl = (ConnPoolControl<?>) 
connManagerCopy;
            if (systemProperties) {
                String s = System.getProperty("http.keepAlive", "true");
                if ("true".equalsIgnoreCase(s)) {
                    s = System.getProperty("http.maxConnections", "5");
                    final int max = Integer.parseInt(s);
                    connPoolControl.setDefaultMaxPerRoute(max);
                    connPoolControl.setMaxTotal(2 * max);
                }
            }
            if (maxConnTotal > 0) {
                connPoolControl.setMaxTotal(maxConnTotal);
            }
            if (maxConnPerRoute > 0) {
                connPoolControl.setDefaultMaxPerRoute(maxConnPerRoute);
            }
        }



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to