Package org.mockserver.netty.http3
Class Http3StreamWriteStallHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
org.mockserver.netty.http3.Http3StreamWriteStallHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelOutboundHandler
public final class Http3StreamWriteStallHandler
extends io.netty.channel.ChannelOutboundHandlerAdapter
Resets an HTTP/3 request stream (
RESET_STREAM H3_INTERNAL_ERROR) when writes have been waiting on it for
responseWriteStallTimeoutMillis and QUIC has taken none of them, so a client that stops reading a response
cannot hold it, or a streamed response's upstream, indefinitely.
QUIC completes a write only once it has taken all of it, and reports nothing of a part. So every write, whichever
handler made it, is passed on in parts of at most MAX_WRITE_BYTES, and a slow reader of one large frame
shows progress; the bytes on the wire are unchanged. QUIC can complete an earlier write while it is given a later
one, so a write made from a listener of that completion is held until the write being passed on has been, whole.
Installed first in each request stream's pipeline, below the HTTP/3 frame codec. A connection's streams are timed
together by its Http3ConnectionWriteStallWatcher, with the timeout its first stream was given.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
ConstructorsConstructorDescriptionHttp3StreamWriteStallHandler(long timeoutMillis, org.mockserver.logging.MockServerLogger mockServerLogger) -
Method Summary
Modifier and TypeMethodDescriptionvoidflush(io.netty.channel.ChannelHandlerContext ctx) voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) voidhandlerRemoved(io.netty.channel.ChannelHandlerContext ctx) voidwrite(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) Methods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, readMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
exceptionCaught
-
Constructor Details
-
Http3StreamWriteStallHandler
public Http3StreamWriteStallHandler(long timeoutMillis, org.mockserver.logging.MockServerLogger mockServerLogger)
-
-
Method Details
-
handlerAdded
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classio.netty.channel.ChannelHandlerAdapter
-
handlerRemoved
public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
handlerRemovedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerRemovedin classio.netty.channel.ChannelHandlerAdapter
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) - Specified by:
writein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
writein classio.netty.channel.ChannelOutboundHandlerAdapter
-
flush
public void flush(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
flushin interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
flushin classio.netty.channel.ChannelOutboundHandlerAdapter
-