ThisaraWeerakoon commented on code in PR #113:
URL: https://github.com/apache/synapse/pull/113#discussion_r4293533511
##########
modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/ConnectionPool.java:
##########
@@ -32,15 +32,41 @@ public class ConnectionPool {
private static final Log log = LogFactory.getLog(ConnectionPool.class);
- /** A map of available connections for reuse. The key selects the
host+port of the
- * connection and the value contains a List of available connections to
destination
+ /** A map of available connections for reuse, keyed by the request scheme
together
+ * with the host and port actually dialled.
*/
private static Map<String,List<NHttpClientConnection>> connMap =
Collections.synchronizedMap(new
HashMap<String,List<NHttpClientConnection>>());
+ /**
+ * Compute the pool key for a connection. The scheme is a mandatory part
of the key:
+ * pooled connections may only be reused for requests with identical
transport
+ * security characteristics.
+ *
+ * @param scheme the URI scheme of the request (http or https); a null
scheme is
+ * treated as http
+ * @param host the host actually dialled (the proxy host when proxying)
+ * @param port the port actually dialled
+ * @return the pool key
+ */
+ static String poolKey(String scheme, String host, int port) {
Review Comment:
Addressed. Changed name into derivePoolKey.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]