@Override public void run() { Object next; HttpRequest nextRequest = null; while ((next = pipelined.peek()) != null) { if (next instanceof HttpRequest) { if (nextRequest != null) { return; } if (!persistentConnection) { discard(); return; } nextRequest = (HttpRequest)next; HttpServerOperations ops = new HttpServerOperations(Connection.from(ctx.channel()), listener, compress, nextRequest, ConnectionInfo.from(ctx.channel(), readForwardHeaders, nextRequest), cookieEncoder, cookieDecoder) .chunkedTransfer(true); ops.bind(); listener.onStateChange(ops, ConnectionObserver.State.CONFIGURED); } ctx.fireChannelRead(pipelined.poll()); } overflow = false; }
@Override public void run() { Object next; HttpRequest nextRequest = null; while ((next = pipelined.peek()) != null) { if (next instanceof HttpRequest) { if (nextRequest != null) { return; } if (!persistentConnection) { discard(); return; } nextRequest = (HttpRequest)next; HttpServerOperations ops = new HttpServerOperations(Connection.from(ctx.channel()), listener, compress, nextRequest, ConnectionInfo.from(ctx.channel(), readForwardHeaders, nextRequest), cookieEncoder, cookieDecoder) .chunkedTransfer(true); ops.bind(); listener.onStateChange(ops, ConnectionObserver.State.CONFIGURED); } ctx.fireChannelRead(pipelined.poll()); } overflow = false; }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof Http2HeadersFrame) { Http2HeadersFrame headersFrame = (Http2HeadersFrame)msg; HttpRequest request; if (headersFrame.isEndStream()) { request = HttpConversionUtil.toFullHttpRequest(-1, headersFrame.headers(), ctx.channel().alloc(), false); } else { request = HttpConversionUtil.toHttpRequest(-1, headersFrame.headers(), false); } HttpToH2Operations ops = new HttpToH2Operations(Connection.from(ctx.channel()), listener, request, headersFrame.headers(), ConnectionInfo.from(ctx.channel() .parent(), readForwardHeaders, request), cookieEncoder, cookieDecoder); ops.bind(); listener.onStateChange(ops, ConnectionObserver.State.CONFIGURED); } ctx.fireChannelRead(msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof Http2HeadersFrame) { Http2HeadersFrame headersFrame = (Http2HeadersFrame)msg; HttpRequest request; if (headersFrame.isEndStream()) { request = HttpConversionUtil.toFullHttpRequest(-1, headersFrame.headers(), ctx.channel().alloc(), false); } else { request = HttpConversionUtil.toHttpRequest(-1, headersFrame.headers(), false); } HttpToH2Operations ops = new HttpToH2Operations(Connection.from(ctx.channel()), listener, request, headersFrame.headers(), ConnectionInfo.from(ctx.channel() .parent(), readForwardHeaders, request), cookieEncoder, cookieDecoder); ops.bind(); listener.onStateChange(ops, ConnectionObserver.State.CONFIGURED); } ctx.fireChannelRead(msg); }
listener, compress, request, ConnectionInfo.from(ctx.channel(), readForwardHeaders, request), cookieEncoder, cookieDecoder) .chunkedTransfer(true);
listener, compress, request, ConnectionInfo.from(ctx.channel(), readForwardHeaders, request), cookieEncoder, cookieDecoder) .chunkedTransfer(true);