GeezerVison is showing github.com — HTTP/2 Codec decompression support · Issue #2793 · netty/netty
HTTP/2 Codec decompression support #2793
Description
The HTTP/2 codec currently does not support decompression. There should be an interface which facilitates decompression in the native HTTP/2 codec and also supported by the HTTP/1.x translation layer.
Activity
changed the title
[-]HTTP/2 Coded decompression support[/-] [+]HTTP/2 Codec decompression support[/+] on Aug 21, 2014Scottmitch commented on Aug 26, 2014
@nmittler - Thought I would pull you into this discussion. The thought is to somehow provide an interface to set a ByteToMessageDecoder (this seems to be the common base class for decompressors) per stream. When data comes in it will be passed to this ByteToMessageDecoder to inflate the data before calling onDataRead.
nmittler commented on Aug 26, 2014
Just to clarify when this will be applied: I'm assuming decompression will happen for DATA frames when a Content-Encoding header is present (e.g. gzip)?
Ideally, the interception layer that does decompression would also strip the Content-Encoding header before forwarding. Unfortunately, that would almost require that it be in the HTTP/1.1 translation layer (which merges headers/data into full messages before forwarding).
Either way, the code that will do decompression for HTTP/2 won't exactly be a Decoder (since it's not a channel handler) but maybe it's fine to use a decoder even though it's not really going to be part of any pipeline?
Scottmitch commented on Aug 26, 2014
- Yes to your first assumption.
- ** Agreed this would be the easiest conceptual way to handle it (and how the HTTP/1 translation layer will handle it at some level).
, but I don't think it is a requirement for HTTP/2. For example as long as we provide optional decompression support then the users of the codec will be aware that even though the 1 of the previous headers frames may have had a Content-Encoding they have asked for the content encoding to be stripped (with some error/boarder cases thrown in there I'm sure). The benefit being avoiding everyone rolling their own decompression logic (when most of the time it could be handled in a common fashion).
** OR (possibly a better approach)
How the HTTP codec does it is they insert a decompressor in the pipeline which deals with HttpMessage and HttpContent objects (which would be header/data frames for HTTP/2). This layer does not merge headers/data into a FullMessage but intercepts/modifies the headers to remove the Content-Encoding header...and then does the decompression on the data. This may make more sense but require an additional layer which doesn't necessarily merge headers/data together, but at least processes them before they move further up the chain. Now we don't have the same access to the pipeline, but we could replicate this type of behavior.
- I'm not sure we can do exactly what HttpContentDecompressor is doing with an
EmbeddedChannel but seems like the ByteToMessageDecoder type and the callDecode method is somehow what we need to interact with. I think @normanmaurer may be better equipped to weigh in on how to tie these together (I would need to do some experimenting).
Scottmitch commented on Sep 14, 2014
Metadata
Metadata
Development
No branches or pull requestsIssue actions