public boolean handleHTTP2UpgradeRequest(Map<String, String> headers, HttpInboundLink link) {

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "handleHTTP2UpgradeRequest entry");
        }

        //1) Send the 101 response
        //2) Setup the new streams and Links
        //3) Place the new stream into the existing links

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "handleHTTP2UpgradeRequest, sending 101 response");
        }
        link.getHTTPContext().send101SwitchingProtocol("h2c");
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "handleHTTP2UpgradeRequest, sent 101 response");
        }

        // if the above call goes async, not sure if we will then have a race condition, need to check further.System.out.println("H2InboundLink.handleHTTP2UpgradeRequest sent out 101");

        Integer streamID = new Integer(1);
        H2VirtualConnectionImpl h2VC = new H2VirtualConnectionImpl(initialVC);
        // remove the HttpDispatcherLink from the map, so a new one will be created and used by this new H2 stream
        h2VC.getStateMap().remove(HttpDispatcherLink.LINK_ID);
        H2HttpInboundLinkWrap wrap = new H2HttpInboundLinkWrap(httpInboundChannel, h2VC, streamID, this);

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "handleHTTP2UpgradeRequest, creating stream processor");
        }
        H2StreamProcessor streamProcessor = new H2StreamProcessor(streamID, wrap, this, StreamState.HALF_CLOSED_REMOTE);
        incrementActiveClientStreams();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "handleHTTP2UpgradeRequest, created stream processor : " + streamProcessor);
        }

        // first stream on this connection will have the root as parent, exclusive isn't an option
        // not sure yet if priority can be anything other than the default for setting up the first stream on a connection
        writeQ.addNewNodeToQ(streamID, Node.ROOT_STREAM_ID, Node.DEFAULT_NODE_PRIORITY, false);

        streamTable.put(streamID, streamProcessor);
        highestClientStreamId = streamID;

        // add stream 0 to the table, in case we need to write out any control frames prior to initialization completion
        streamID = 0;
        streamProcessor = new H2StreamProcessor(streamID, wrap, this, StreamState.OPEN);
        streamTable.put(streamID, streamProcessor);

        // pull the settings header out of the request;
        // process it and apply it to the stream
        String settings = headers.get("HTTP2-Settings");
        try {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "handleHTTP2UpgradeRequest, processing upgrade header settings : " + settings);
            }
            getRemoteConnectionSettings().processUpgradeHeaderSettings(settings);
        } catch (Http2Exception e1) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "handleHTTP2UpgradeRequest an error occurred processing the settings during connection initialization");
            }
            return false;
        }

        initialHttpInboundLink = link;

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "handleHTTP2UpgradeRequest, reinit the link : " + link);
        }
        link.reinit(wrap.getConnectionContext(), wrap.getVirtualConnection(), wrap);

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "handleHTTP2UpgradeRequest, exit");
        }
        return true;
    }
public boolean handleHTTP2UpgradeRequest ( Map < String , String > headers , HttpInboundLink link ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest entry" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, sending 101 response" ) ; } link . getHTTPContext ( ) . send101SwitchingProtocol ( "h2c" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, sent 101 response" ) ; } Integer streamID = new Integer ( 1 ) ; H2VirtualConnectionImpl h2VC = new H2VirtualConnectionImpl ( initialVC ) ; h2VC . getStateMap ( ) . remove ( HttpDispatcherLink . LINK_ID ) ; H2HttpInboundLinkWrap wrap = new H2HttpInboundLinkWrap ( httpInboundChannel , h2VC , streamID , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, creating stream processor" ) ; } H2StreamProcessor streamProcessor = new H2StreamProcessor ( streamID , wrap , this , StreamState . HALF_CLOSED_REMOTE ) ; incrementActiveClientStreams ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, created stream processor : " + streamProcessor ) ; } writeQ . addNewNodeToQ ( streamID , Node . ROOT_STREAM_ID , Node . DEFAULT_NODE_PRIORITY , false ) ; streamTable . put ( streamID , streamProcessor ) ; highestClientStreamId = streamID ; streamID = 0 ; streamProcessor = new H2StreamProcessor ( streamID , wrap , this , StreamState . OPEN ) ; streamTable . put ( streamID , streamProcessor ) ; String settings = headers . get ( "HTTP2-Settings" ) ; try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, processing upgrade header settings : " + settings ) ; } getRemoteConnectionSettings ( ) . processUpgradeHeaderSettings ( settings ) ; } catch ( Http2Exception e1 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest an error occurred processing the settings during connection initialization" ) ; } return false ; } initialHttpInboundLink = link ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, reinit the link : " + link ) ; } link . reinit ( wrap . getConnectionContext ( ) , wrap . getVirtualConnection ( ) , wrap ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, exit" ) ; } return true ; }
Handle an h2c upgrade request

@param headers a map of the headers for this request
@param link the initial inbound link
@return true if the http2 upgrade was successful