Package io.netty.handler.codec.http2
Interface InboundHttp2ToHttpAdapter.ImmediateSendDetector
- Enclosing class:
InboundHttp2ToHttpAdapter
private static interface InboundHttp2ToHttpAdapter.ImmediateSendDetector
Allows messages to be sent up the pipeline before the next phase in the
HTTP message flow is detected.
-
Method Summary
Modifier and TypeMethodDescriptioncopyIfNeeded
(ByteBufAllocator allocator, FullHttpMessage msg) Determine if a copy must be made after an immediate send happens.boolean
Determine if the response should be sent immediately, or wait for the end of the stream
-
Method Details
-
mustSendImmediately
Determine if the response should be sent immediately, or wait for the end of the stream- Parameters:
msg
- The response to test- Returns:
true
if the message should be sent immediatelyinvalid @code
{@code false) if we should wait for the end of the stream
-
copyIfNeeded
Determine if a copy must be made after an immediate send happens.An example of this use case is if a request is received with a 'Expect: 100-continue' header. The message will be sent immediately, and the data will be queued and sent at the end of the stream.
- Parameters:
allocator
- TheByteBufAllocator
that can be used to allocatemsg
- The message which has just been sent due tomustSendImmediately(FullHttpMessage)
- Returns:
- A modified copy of the
msg
ornull
if a copy is not needed.
-