Top Description Fields Constructors Methods
io.netty5.handler.codec.http2

pack-priv final Class Http2ControlFrameLimitEncoder

extends DecoratingHttp2ConnectionEncoder
Class Inheritance
Imports
io.netty5.channel.ChannelHandlerContext, io.netty5.util.concurrent.Future, .FutureListener, io.netty5.util.internal.ObjectUtil, io.netty5.util.internal.logging.InternalLogger, .InternalLoggerFactory

DecoratingHttp2ConnectionEncoder which guards against a remote peer that will trigger a massive amount of control frames but will not consume our responses to these. This encoder will tear-down the connection once we reached the configured limit to reduce the risk of DDOS.

Field Summary

Modifier and TypeField and Description
private Http2LifecycleManager
private boolean
private static final InternalLogger
private final int
private int
private final FutureListener<Void>

Constructor Summary

AccessConstructor and Description
pack-priv
Http2ControlFrameLimitEncoder(Http2ConnectionEncoder delegate, int maxOutstandingControlFrames)

Method Summary

Modifier and TypeMethod and Description
private FutureListener<Void>
public void
public Future<Void>
writePing(ChannelHandlerContext
the context to use for writing.
ctx
,
boolean
indicates whether this is an ack of a PING frame previously received from the remote endpoint.
ack
,
long
the payload of the frame.
data
)

Overrides io.netty5.handler.codec.http2.DecoratingHttp2FrameWriter.writePing.

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writePing.

Writes a PING frame to the remote endpoint.
public Future<Void>
writeRstStream(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
long
the error code indicating the nature of the failure.
errorCode
)

Overrides io.netty5.handler.codec.http2.DecoratingHttp2FrameWriter.writeRstStream.

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writeRstStream.

Writes a RST_STREAM frame to the remote endpoint.
public Future<Void>
writeSettingsAck(ChannelHandlerContext
the context to use for writing.
ctx
)

Overrides io.netty5.handler.codec.http2.DecoratingHttp2FrameWriter.writeSettingsAck.

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writeSettingsAck.

Writes a SETTINGS acknowledgment to the remote endpoint.
Inherited from io.netty5.handler.codec.http2.DecoratingHttp2ConnectionEncoder:
connectionconsumeReceivedSettingsflowControllerframeWriterpollSentSettingsremoteSettings

Field Detail

lifecycleManagerback to summary
private Http2LifecycleManager lifecycleManager
limitReachedback to summary
private boolean limitReached
loggerback to summary
private static final InternalLogger logger
maxOutstandingControlFramesback to summary
private final int maxOutstandingControlFrames
outstandingControlFramesback to summary
private int outstandingControlFrames
outstandingControlFramesListenerback to summary
private final FutureListener<Void> outstandingControlFramesListener

Constructor Detail

Http2ControlFrameLimitEncoderback to summary
pack-priv Http2ControlFrameLimitEncoder(Http2ConnectionEncoder delegate, int maxOutstandingControlFrames)

Method Detail

handleOutstandingControlFramesback to summary
private FutureListener<Void> handleOutstandingControlFrames(ChannelHandlerContext ctx)
lifecycleManagerback to summary
public void lifecycleManager(Http2LifecycleManager lifecycleManager)

Overrides io.netty5.handler.codec.http2.DecoratingHttp2ConnectionEncoder.lifecycleManager.

Implements io.netty5.handler.codec.http2.Http2ConnectionEncoder.lifecycleManager.

Doc from io.netty5.handler.codec.http2.Http2ConnectionEncoder.lifecycleManager.

Sets the lifecycle manager. Must be called as part of initialization before the encoder is used.

Annotations
@Override
writePingback to summary
public Future<Void> writePing(ChannelHandlerContext ctx, boolean ack, long data)

Overrides io.netty5.handler.codec.http2.DecoratingHttp2FrameWriter.writePing.

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writePing.

Doc from io.netty5.handler.codec.http2.Http2FrameWriter.writePing.

Writes a PING frame to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

ack:boolean

indicates whether this is an ack of a PING frame previously received from the remote endpoint.

data:long

the payload of the frame.

Returns:Future<Void>

the future for the write.

Annotations
@Override
writeRstStreamback to summary
public Future<Void> writeRstStream(ChannelHandlerContext ctx, int streamId, long errorCode)

Overrides io.netty5.handler.codec.http2.DecoratingHttp2FrameWriter.writeRstStream.

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writeRstStream.

Doc from io.netty5.handler.codec.http2.Http2FrameWriter.writeRstStream.

Writes a RST_STREAM frame to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

streamId:int

the stream for which to send the frame.

errorCode:long

the error code indicating the nature of the failure.

Returns:Future<Void>

the future for the write.

Annotations
@Override
writeSettingsAckback to summary
public Future<Void> writeSettingsAck(ChannelHandlerContext ctx)

Overrides io.netty5.handler.codec.http2.DecoratingHttp2FrameWriter.writeSettingsAck.

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writeSettingsAck.

Doc from io.netty5.handler.codec.http2.Http2FrameWriter.writeSettingsAck.

Writes a SETTINGS acknowledgment to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

Returns:Future<Void>

the future for the write.

Annotations
@Override