private class ProxyToServerConnection.HeadAwareHttpResponseDecoder
extends io.netty.handler.codec.http.HttpResponseDecoder
Responses to HEAD requests aren't supposed to have content, but Netty doesn't know that any given response is to a HEAD request, so it needs to be told that there's no content so that it doesn't hang waiting for it.
See the documentation for HttpResponseDecoder for information about why HEAD requests need special
handling.
Thanks to nataliakoval for pointing out that with connections being reused as they are, this needs to be sensitive to the current request.
io.netty.handler.codec.ByteToMessageDecoder.CumulatorChannelHandler.Sharable| 构造器和说明 |
|---|
HeadAwareHttpResponseDecoder(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
isContentAlwaysEmpty(io.netty.handler.codec.http.HttpMessage httpMessage) |
createInvalidMessage, createMessage, isDecodingRequestdecode, decodeLast, handleTransferEncodingChunkedWithContentLength, isSwitchingToNonHttp1Protocol, reset, userEventTriggeredactualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecodechannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtensureNotSharable, handlerAdded, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandlerAddedCopyright © 2021 Zodiac. All rights reserved.