src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java
changeset 58055 734f7711f87c
parent 50681 4254bed3c09d
equal deleted inserted replaced
58054:ee230ad8cfef 58055:734f7711f87c
   136 
   136 
   137     synchronized HttpConnection getConnection(boolean secure,
   137     synchronized HttpConnection getConnection(boolean secure,
   138                                               InetSocketAddress addr,
   138                                               InetSocketAddress addr,
   139                                               InetSocketAddress proxy) {
   139                                               InetSocketAddress proxy) {
   140         if (stopped) return null;
   140         if (stopped) return null;
       
   141         // for plain (unsecure) proxy connection the destination address is irrelevant.
       
   142         addr = secure || proxy == null ? addr : null;
   141         CacheKey key = new CacheKey(addr, proxy);
   143         CacheKey key = new CacheKey(addr, proxy);
   142         HttpConnection c = secure ? findConnection(key, sslPool)
   144         HttpConnection c = secure ? findConnection(key, sslPool)
   143                                   : findConnection(key, plainPool);
   145                                   : findConnection(key, plainPool);
   144         //System.out.println ("getConnection returning: " + c);
   146         //System.out.println ("getConnection returning: " + c);
   145         return c;
   147         return c;