src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLTunnelConnection.java
branchhttp-client-branch
changeset 56041 b4b5e09ef3cc
parent 55973 4d9b002587db
equal deleted inserted replaced
56040:f8eabb9a5c0f 56041:b4b5e09ef3cc
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    43     volatile SSLTube flow;
    43     volatile SSLTube flow;
    44 
    44 
    45     AsyncSSLTunnelConnection(InetSocketAddress addr,
    45     AsyncSSLTunnelConnection(InetSocketAddress addr,
    46                              HttpClientImpl client,
    46                              HttpClientImpl client,
    47                              String[] alpn,
    47                              String[] alpn,
    48                              InetSocketAddress proxy)
    48                              InetSocketAddress proxy,
       
    49                              HttpHeaders proxyHeaders)
    49     {
    50     {
    50         super(addr, client, Utils.getServerName(addr), alpn);
    51         super(addr, client, Utils.getServerName(addr), alpn);
    51         this.plainConnection = new PlainTunnelingConnection(addr, proxy, client);
    52         this.plainConnection = new PlainTunnelingConnection(addr, proxy, client, proxyHeaders);
    52         this.writePublisher = new PlainHttpPublisher();
    53         this.writePublisher = new PlainHttpPublisher();
    53     }
    54     }
    54 
    55 
    55     @Override
    56     @Override
    56     public CompletableFuture<Void> connectAsync() {
    57     public CompletableFuture<Void> connectAsync() {
    66                     flow = new SSLTube(engine,
    67                     flow = new SSLTube(engine,
    67                                        client().theExecutor(),
    68                                        client().theExecutor(),
    68                                        plainConnection.getConnectionFlow());
    69                                        plainConnection.getConnectionFlow());
    69                     return null;} );
    70                     return null;} );
    70     }
    71     }
       
    72 
       
    73     @Override
       
    74     boolean isTunnel() { return true; }
    71 
    75 
    72     @Override
    76     @Override
    73     boolean connected() {
    77     boolean connected() {
    74         return plainConnection.connected(); // && sslDelegate.connected();
    78         return plainConnection.connected(); // && sslDelegate.connected();
    75     }
    79     }