ok2c commented on code in PR #502: URL: https://github.com/apache/httpcomponents-client/pull/502#discussion_r1386181346
########## httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/BasicHttpClientConnectionManager.java: ########## @@ -390,22 +391,15 @@ public void release(final ConnectionEndpoint endpoint, final Object state, final return; } try { - if (keepAlive == null) { - this.conn.close(CloseMode.GRACEFUL); + if (keepAlive == null && conn != null) { + conn.close(CloseMode.GRACEFUL); } this.updated = System.currentTimeMillis(); - if (!this.conn.isOpen() && !this.conn.isConsistent()) { - this.route = null; - this.conn = null; - this.expiry = Long.MAX_VALUE; - if (LOG.isDebugEnabled()) { - LOG.debug("{} Connection is not kept alive", id); - } - } else { + final boolean reusable = conn != null && conn.isOpen() && conn.isConsistent(); Review Comment: @arturobernalg The variable seems redundant. Looks OK otherwise. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org