private void _writeReset(int streamId, long code) { encoder().writeRstStream(chctx, streamId, code, chctx.newPromise()); chctx.flush(); }
@Override protected ChannelFuture doWriteReset(int id, int streamId, Http2Error error) { final Http2Stream stream = encoder.connection().stream(streamId); // Send a RST_STREAM frame only for an active stream which did not send a RST_STREAM frame already. if (stream != null && !stream.isResetSent()) { return encoder.writeRstStream(ctx, streamId, error.code(), ctx.newPromise()); } return ctx.writeAndFlush(Unpooled.EMPTY_BUFFER); }
encoder.writeRstStream(ctx, streamId, Http2Error.CANCEL.code(), ctx.newPromise()); ctx.flush(); } else {
if (isWritable(stream)) { writeErrorResponse(ctx, streamId, HttpResponseStatus.REQUEST_ENTITY_TOO_LARGE); writer.writeRstStream(ctx, streamId, Http2Error.CANCEL.code(), ctx.voidPromise()); if (req.isOpen()) { req.close(ContentTooLargeException.get());
encoder().writeRstStream(ctx, rstFrame.stream().id(), rstFrame.errorCode(), promise); } else if (msg instanceof Http2PingFrame) { Http2PingFrame frame = (Http2PingFrame) msg;
private void _writeReset(int streamId, long code) { encoder().writeRstStream(chctx, streamId, code, chctx.newPromise()); chctx.flush(); }
encoder().writeRstStream(ctx, rstFrame.stream().id(), rstFrame.errorCode(), promise); } else if (msg instanceof Http2PingFrame) { Http2PingFrame frame = (Http2PingFrame) msg;
encoder().writeRstStream(ctx, rstFrame.stream().id(), rstFrame.errorCode(), promise); } else if (msg instanceof Http2PingFrame) { Http2PingFrame frame = (Http2PingFrame) msg;
@Override public CompletableFuture<Connection> writeRst(int streamId, int errorCode) { return doInEventLoop((cf, channelPromise) -> { log.info("write data on connection {}, stream id: {}, error code: {}", ctx.channel().id(), streamId, errorCode); cf.setResult(this); encoder.writeRstStream(ctx, streamId, errorCode, channelPromise); ctx.pipeline().flush(); }); }
/** * Terminates a stream. * * @param streamId stream to be terminated * @param http2Error cause for the termination */ void resetStream(ChannelHandlerContext ctx, int streamId, Http2Error http2Error) { encoder.writeRstStream(ctx, streamId, http2Error.code(), ctx.newPromise()); http2ClientChannel.getDataEventListeners() .forEach(dataEventListener -> dataEventListener.onStreamReset(streamId)); ctx.flush(); }
/** * Sends {@link org.wso2.transport.http.netty.message.Http2Reset} frame with `NO_ERROR` error code. * * @param ctx the channel handler context * @param encoder the HTTP2 connection encoder * @param streamId id of the stream need to be send RST_FRAME * @throws Http2Exception if a protocol-related error occurred */ public static void sendRstFrame(ChannelHandlerContext ctx, Http2ConnectionEncoder encoder, int streamId) throws Http2Exception { encoder.writeRstStream(ctx, streamId, Http2Error.NO_ERROR.code(), ctx.newPromise()); encoder.flowController().writePendingBytes(); ctx.flush(); }
encoder().writeRstStream(ctx, rstFrame.stream().id(), rstFrame.errorCode(), promise); } else if (msg instanceof Http2PingFrame) { Http2PingFrame frame = (Http2PingFrame) msg;
encoder().writeRstStream(ctx, rstFrame.stream().id(), rstFrame.errorCode(), promise); } else if (msg instanceof Http2PingFrame) { Http2PingFrame frame = (Http2PingFrame) msg;
encoder().writeRstStream(ctx, rstFrame.stream().id(), rstFrame.errorCode(), promise); } else if (msg instanceof Http2PingFrame) { Http2PingFrame frame = (Http2PingFrame) msg;