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

pack-priv final Class Http2ControlFrameLimitEncoder

extends DecoratingHttp2ConnectionEncoder
Class Inheritance
Imports
io.netty.channel.ChannelFuture, .ChannelFutureListener, .ChannelHandlerContext, .ChannelPromise, io.netty.util.internal.ObjectUtil, io.netty.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 ChannelFutureListener

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
private ChannelPromise
public void
public ChannelFuture
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
,
ChannelPromise
the promise for the write.
promise
)

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

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

Writes a PING frame to the remote endpoint.
public ChannelFuture
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
,
ChannelPromise
the promise for the write.
promise
)

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

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

Writes a RST_STREAM frame to the remote endpoint.
public ChannelFuture
writeSettingsAck(ChannelHandlerContext
the context to use for writing.
ctx
,
ChannelPromise
the promise for the write.
promise
)

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

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

Writes a SETTINGS acknowledgment to the remote endpoint.
Inherited from io.netty.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 ChannelFutureListener outstandingControlFramesListener

Constructor Detail

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

Method Detail

handleOutstandingControlFramesback to summary
private ChannelPromise handleOutstandingControlFrames(ChannelHandlerContext ctx, ChannelPromise promise)
lifecycleManagerback to summary
public void lifecycleManager(Http2LifecycleManager lifecycleManager)

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

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

Doc from io.netty.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 ChannelFuture writePing(ChannelHandlerContext ctx, boolean ack, long data, ChannelPromise promise)

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

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

Doc from io.netty.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.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write.

Annotations
@Override
writeRstStreamback to summary
public ChannelFuture writeRstStream(ChannelHandlerContext ctx, int streamId, long errorCode, ChannelPromise promise)

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

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

Doc from io.netty.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.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write.

Annotations
@Override
writeSettingsAckback to summary
public ChannelFuture writeSettingsAck(ChannelHandlerContext ctx, ChannelPromise promise)

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

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

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

Writes a SETTINGS acknowledgment to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write.

Annotations
@Override