Spdy: Add UnknownFrame parsing support for SpdyFrameCodec.#14561
Conversation
Motivation: To make our codec more flexible we should add support for unknown frames in SPDY. Modifications: - Add SpdyFrameDecoderExtendedDelegate that supports unknown frames - Add new constructor and protected method to SpdyFrameCodec that makes it easy to support it Result: More flexible SPDY implementation. Co-authored-by: Norman Maurer <norman_maurer@apple.com>
|
/cc @He-Pin PTAL |
|
@He-Pin I think this is ready to go... PTAL |
| public void readUnknownFrame(int frameType, byte flags, ByteBuf payload) { | ||
| read = true; | ||
| SpdyUnknownFrame spdyUnknownFrame = new DefaultSpdyUnknownFrame(frameType, flags, payload); | ||
| ctx.fireChannelRead(spdyUnknownFrame); |
There was a problem hiding this comment.
how about adding a protected method: createSpdyUnknownFrame, then I can override it.
There was a problem hiding this comment.
Sure I can do this if you need it.
|
@He-Pin PTAL again |
| } | ||
|
|
||
| protected SpdyUnknownFrame newSpdyUnknownFrame(int frameType, byte flags, ByteBuf payload) { | ||
| return new DefaultSpdyUnknownFrame(frameType, flags, payload); |
There was a problem hiding this comment.
Thanks, but I think this can better be a SpdyFrame , which only is a maker interface, otherwise users will have to implement the ByteBufHolder, and In our implementation, CustFrame extends SpdyFrame.
|
LGTM |
|
The milestone should be 4.1.116.Final now. |
| return false; | ||
| } | ||
| if (delegate instanceof SpdyFrameDecoderExtendedDelegate) { | ||
| ByteBuf data = buffer.alloc().buffer(length); |
There was a problem hiding this comment.
what about using buffer.readSlice here?
There was a problem hiding this comment.
Yes we could use readRetainedSlice(...). But let's do this in a followup as its true for other methods as well.
|
Thanks |
Motivation: To make our codec more flexible we should add support for unknown frames in SPDY. Modifications: - Add default method to SpdyFrameDecoderDelegate to support unknown frames - Add new constructor and protected method to SpdyFrameCodec that makes it easy to support it Result: More flexible SPDY implementation. --------- Co-authored-by: 虎鸣 <hepin.p@alibaba-inc.com>
…14569) Motivation: To make our codec more flexible we should add support for unknown frames in SPDY. Modifications: - Add default method to SpdyFrameDecoderDelegate to support unknown frames - Add new constructor and protected method to SpdyFrameCodec that makes it easy to support it Result: More flexible SPDY implementation. Co-authored-by: 虎鸣 <hepin.p@alibaba-inc.com>
Motivation:
To make our codec more flexible we should add support for unknown frames in SPDY.
Modifications:
Result:
More flexible SPDY implementation.