@ Override public void handleRequest ( HttpInboundConnection hic , HttpServletRequest request , HttpServletResponse response ) { Http2InboundConnection h2ic = ( Http2InboundConnection ) hic ; H2UpgradeHandlerWrapper h2uh = null ; try { h2uh = request . upgrade ( H2UpgradeHandlerWrapper . class ) ; } catch ( IOException e ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "returning: user configurator threw an IOException. Exception message: " + e . getMessage ( ) ) ; } response . setStatus ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR ) ; return ; } catch ( ServletException e ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "returning: user configurator threw a ServletException. Exception message: " + e . getMessage ( ) ) ; } response . setStatus ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR ) ; return ; } if ( h2uh != null ) { h2uh . init ( new H2UpgradeHandler ( ) ) ; } // create a map of the headers to pass to the transport code Map < String , String > headers = new HashMap < String , String > ( ) ; HttpServletRequest hsrt = ( HttpServletRequest ) request ; Enumeration < String > headerNames = hsrt . getHeaderNames ( ) ; while ( headerNames . hasMoreElements ( ) ) { String key = ( String ) headerNames . nextElement ( ) ; String value = hsrt . getHeader ( key ) ; headers . put ( key , value ) ; } boolean upgraded = h2ic . handleHTTP2UpgradeRequest ( headers ) ; if ( ! upgraded ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "returning: http2 connection initialization failed" ) ; } response . setStatus ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR ) ; } }
Upgrades the given request for http2