src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java
branchhttp-client-branch
changeset 55981 907bddce488c
parent 55973 4d9b002587db
child 55982 b6ff245c0db6
equal deleted inserted replaced
55978:65bd0b92abec 55981:907bddce488c
   425     // S indicates secure "https"
   425     // S indicates secure "https"
   426     // H indicates host (direct) connection
   426     // H indicates host (direct) connection
   427     // P indicates proxy
   427     // P indicates proxy
   428     // Eg: "S:H:foo.com:80"
   428     // Eg: "S:H:foo.com:80"
   429     static String keyString(boolean secure, boolean proxy, String host, int port) {
   429     static String keyString(boolean secure, boolean proxy, String host, int port) {
       
   430         if (secure && port == -1)
       
   431             port = 443;
       
   432         else if (!secure && port == -1)
       
   433             port = 80;
   430         return (secure ? "S:" : "C:") + (proxy ? "P:" : "H:") + host + ":" + port;
   434         return (secure ? "S:" : "C:") + (proxy ? "P:" : "H:") + host + ":" + port;
   431     }
   435     }
   432 
   436 
   433     String key() {
   437     String key() {
   434         return this.key;
   438         return this.key;
   435     }
   439     }
   436 
   440 
   437     void putConnection() {
   441     boolean offerConnection() {
   438         client2.putConnection(this);
   442         return client2.offerConnection(this);
   439     }
   443     }
   440 
   444 
   441     private HttpPublisher publisher() {
   445     private HttpPublisher publisher() {
   442         return connection.publisher();
   446         return connection.publisher();
   443     }
   447     }