Toggle navigation
Home
io.vertx.core.http.HttpServerRequest to io.vertx.core.http.impl.HttpServerImpl.HttpHandler
No. of Instances - 5
No. of Commits - 1
No. of Projects - {'vert.x'}
Hierarchy/Composition: -
Primitive Info: -
NameSpace: Internal -> Internal
Mapping:
Cascading Type Change (Different)
HandlerHolder<HttpServerRequest>
to
HandlerHolder<HttpHandler>
HandlerHolder<HttpServerRequest>
to
HandlerHolder<HttpHandler>
Update Anonymous class
{ @Override protected void configurePipeline( ChannelHandlerContext ctx, String protocol) throws Exception { if (protocol.equals("http/1.1")) { configureHttp1(pipeline); } else { HandlerHolder<HttpServerRequest> holder=reqHandlerManager.chooseHandler(ch.eventLoop()); pipeline.addLast("handler",new VertxHttp2HandlerBuilder(ch,ctx,holder.context,serverOrigin,options,holder.handler).build()); } } }
to
{ @Override protected void configurePipeline( ChannelHandlerContext ctx, String protocol) throws Exception { if (protocol.equals("http/1.1")) { configureHttp1(pipeline); } else { HandlerHolder<HttpHandler> holder=reqHandlerManager.chooseHandler(ch.eventLoop()); VertxHttp2ServerHandler handler=new VertxHttp2HandlerBuilder(ch,ctx,holder.context,serverOrigin,options,holder.handler.requesthHandler).build(); pipeline.addLast("handler",handler); if (holder.handler.connectionHandler != null) { holder.context.executeFromIO(() -> { holder.handler.connectionHandler.handle(handler); } ); } } } }
{ @Override protected void initChannel( Channel ch) throws Exception { if (requestStream.isPaused() || wsStream.isPaused()) { ch.close(); return; } ChannelPipeline pipeline=ch.pipeline(); if (sslHelper.isSSL()) { pipeline.addLast("ssl",sslHelper.createSslHandler(vertx,false)); if (sslHelper.isUseALPN()) { pipeline.addLast("alpn",new ApplicationProtocolNegotiationHandler("http/1.1"){ @Override protected void configurePipeline( ChannelHandlerContext ctx, String protocol) throws Exception { if (protocol.equals("http/1.1")) { configureHttp1(pipeline); } else { HandlerHolder<HttpServerRequest> holder=reqHandlerManager.chooseHandler(ch.eventLoop()); pipeline.addLast("handler",new VertxHttp2HandlerBuilder(ch,ctx,holder.context,serverOrigin,options,holder.handler).build()); } } } ); } else { configureHttp1(pipeline); } } else { configureHttp1(pipeline); } } public void configureHttp1( ChannelPipeline pipeline){ if (USE_FLASH_POLICY_HANDLER) { pipeline.addLast("flashpolicy",new FlashPolicyHandler()); } pipeline.addLast("httpDecoder",new HttpRequestDecoder(options.getMaxInitialLineLength(),options.getMaxHeaderSize(),options.getMaxChunkSize(),false)); pipeline.addLast("httpEncoder",new VertxHttpResponseEncoder()); if (options.isCompressionSupported()) { pipeline.addLast("deflater",new HttpChunkContentCompressor()); } if (sslHelper.isSSL() || options.isCompressionSupported()) { pipeline.addLast("chunkedWriter",new ChunkedWriteHandler()); } if (options.getIdleTimeout() > 0) { pipeline.addLast("idle",new IdleStateHandler(0,0,options.getIdleTimeout())); } pipeline.addLast("handler",new ServerHandler()); } }
to
{ @Override protected void initChannel( Channel ch) throws Exception { if (requestStream.isPaused() || wsStream.isPaused()) { ch.close(); return; } ChannelPipeline pipeline=ch.pipeline(); if (sslHelper.isSSL()) { pipeline.addLast("ssl",sslHelper.createSslHandler(vertx,false)); if (sslHelper.isUseALPN()) { pipeline.addLast("alpn",new ApplicationProtocolNegotiationHandler("http/1.1"){ @Override protected void configurePipeline( ChannelHandlerContext ctx, String protocol) throws Exception { if (protocol.equals("http/1.1")) { configureHttp1(pipeline); } else { HandlerHolder<HttpHandler> holder=reqHandlerManager.chooseHandler(ch.eventLoop()); VertxHttp2ServerHandler handler=new VertxHttp2HandlerBuilder(ch,ctx,holder.context,serverOrigin,options,holder.handler.requesthHandler).build(); pipeline.addLast("handler",handler); if (holder.handler.connectionHandler != null) { holder.context.executeFromIO(() -> { holder.handler.connectionHandler.handle(handler); } ); } } } } ); } else { configureHttp1(pipeline); } } else { configureHttp1(pipeline); } } public void configureHttp1( ChannelPipeline pipeline){ if (USE_FLASH_POLICY_HANDLER) { pipeline.addLast("flashpolicy",new FlashPolicyHandler()); } pipeline.addLast("httpDecoder",new HttpRequestDecoder(options.getMaxInitialLineLength(),options.getMaxHeaderSize(),options.getMaxChunkSize(),false)); pipeline.addLast("httpEncoder",new VertxHttpResponseEncoder()); if (options.isCompressionSupported()) { pipeline.addLast("deflater",new HttpChunkContentCompressor()); } if (sslHelper.isSSL() || options.isCompressionSupported()) { pipeline.addLast("chunkedWriter",new ChunkedWriteHandler()); } if (options.getIdleTimeout() > 0) { pipeline.addLast("idle",new IdleStateHandler(0,0,options.getIdleTimeout())); } pipeline.addLast("handler",new ServerHandler()); } }