@Override public DefaultHttp2DataFrame replace(ByteBuf content) { return new DefaultHttp2DataFrame(content, endStream, padding); }
@Override public void close() throws IOException { ctx.write(new DefaultHttp2DataFrame(true)).addListener(NettyResponseWriter.FLUSH_FUTURE); } };
@Override public void write(byte[] b, int off, int len) throws IOException { ByteBuf buffer = ctx.alloc().buffer(len); buffer.writeBytes(b, off, len); ctx.writeAndFlush(new DefaultHttp2DataFrame(buffer, false)); }
@Override public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) { onHttp2Frame(ctx, new DefaultHttp2DataFrame(data, endOfStream, padding) .stream(requireStream(streamId)).retain()); // We return the bytes in consumeBytes() once the stream channel consumed the bytes. return 0; }
ByteBuf buf = VertxHandler.safeBuffer(content.content(), ctx.alloc()); boolean end = msg instanceof LastHttpContent; ctx.fireChannelRead(new DefaultHttp2DataFrame(buf, end, 0)); if (end) { ChannelPipeline pipeline = ctx.pipeline();
private void encodeLastContent(LastHttpContent last, List<Object> out) { boolean needFiller = !(last instanceof FullHttpMessage) && last.trailingHeaders().isEmpty(); if (last.content().isReadable() || needFiller) { out.add(new DefaultHttp2DataFrame(last.content().retain(), last.trailingHeaders().isEmpty())); } if (!last.trailingHeaders().isEmpty()) { Http2Headers headers = HttpConversionUtil.toHttp2Headers(last.trailingHeaders(), validateHeaders); out.add(new DefaultHttp2HeadersFrame(headers, true)); } }
@Override public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) { onHttp2Frame(ctx, new DefaultHttp2DataFrame(data, endOfStream, padding) .stream(requireStream(streamId)).retain()); // We return the bytes in consumeBytes() once the stream channel consumed the bytes. return 0; }
buffer.writeBytes(b, off, len); ctx.writeAndFlush(new DefaultHttp2DataFrame(buffer, false)); ctx.write(new DefaultHttp2DataFrame(true)).addListener(NettyResponseWriter.FLUSH_FUTURE); ctx.writeAndFlush(new DefaultHttp2DataFrame(true)); return null;
@Override public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) { onHttp2Frame(ctx, new DefaultHttp2DataFrame(data, endOfStream, padding) .stream(requireStream(streamId)).retain()); // We return the bytes in consumeBytes() once the stream channel consumed the bytes. return 0; }
} else if (obj instanceof HttpContent) { HttpContent cont = (HttpContent) obj; out.add(new DefaultHttp2DataFrame(cont.content().retain(), false));
ByteBuf buf = VertxHandler.safeBuffer(content.content(), ctx.alloc()); boolean end = msg instanceof LastHttpContent; ctx.fireChannelRead(new DefaultHttp2DataFrame(buf, end, 0)); if (end) { ChannelPipeline pipeline = ctx.pipeline();
@Override public DefaultHttp2DataFrame replace(ByteBuf content) { return new DefaultHttp2DataFrame(content, endStream, padding); }
@Override public DefaultHttp2DataFrame replace(ByteBuf content) { return new DefaultHttp2DataFrame(content, endStream, padding); }
@Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) { if (msg instanceof Http2Headers) { msg = new DefaultHttp2HeadersFrame((Http2Headers) msg); } boolean endOfHttp2Stream = false; if (msg instanceof Http2DataFrame) { endOfHttp2Stream = ((Http2DataFrame) msg).isEndStream(); } if (!endOfHttp2Stream && msg instanceof ByteBuf && ctx.channel() instanceof Http2StreamChannel) { msg = new DefaultHttp2DataFrame((ByteBuf) msg); } ctx.write(msg, promise); }
@Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) { if (msg instanceof Http2Headers) { msg = new DefaultHttp2HeadersFrame((Http2Headers) msg); } boolean endOfHttp2Stream = false; if (msg instanceof Http2DataFrame) { endOfHttp2Stream = ((Http2DataFrame) msg).isEndStream(); } if (!endOfHttp2Stream && msg instanceof ByteBuf && ctx.channel() instanceof Http2StreamChannel) { msg = new DefaultHttp2DataFrame((ByteBuf) msg); } ctx.write(msg, promise); }
@Override public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) { onHttp2Frame(ctx, new DefaultHttp2DataFrame(data, endOfStream, padding) .stream(requireStream(streamId)).retain()); // We return the bytes in consumeBytes() once the stream channel consumed the bytes. return 0; }
@Override public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) { onHttp2Frame(ctx, new DefaultHttp2DataFrame(data, endOfStream, padding) .stream(requireStream(streamId)).retain()); // We return the bytes in consumeBytes() once the stream channel consumed the bytes. return 0; }
@Override public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) { onHttp2Frame(ctx, new DefaultHttp2DataFrame(data, endOfStream, padding) .stream(requireStream(streamId)).retain()); // We return the bytes in consumeBytes() once the stream channel consumed the bytes. return 0; }
private void encodeLastContent(LastHttpContent last, List<Object> out) { boolean needFiller = !(last instanceof FullHttpMessage) && last.trailingHeaders().isEmpty(); if (last.content().isReadable() || needFiller) { out.add(new DefaultHttp2DataFrame(last.content().retain(), last.trailingHeaders().isEmpty())); } if (!last.trailingHeaders().isEmpty()) { Http2Headers headers = HttpConversionUtil.toHttp2Headers(last.trailingHeaders(), validateHeaders); out.add(new DefaultHttp2HeadersFrame(headers, true)); } }
private void encodeLastContent(LastHttpContent last, List<Object> out) { boolean needFiller = !(last instanceof FullHttpMessage) && last.trailingHeaders().isEmpty(); if (last.content().isReadable() || needFiller) { out.add(new DefaultHttp2DataFrame(last.content().retain(), last.trailingHeaders().isEmpty())); } if (!last.trailingHeaders().isEmpty()) { Http2Headers headers = HttpConversionUtil.toHttp2Headers(last.trailingHeaders(), validateHeaders); out.add(new DefaultHttp2HeadersFrame(headers, true)); } }