Skip to content

Fix NETTY-452, add an option for whether to count length field into packet length or not - #45

Merged
normanmaurer merged 2 commits into
netty:masterfrom
sunng87:master
Nov 9, 2011
Merged

normanmaurer merged 2 commits into
netty:masterfrom
sunng87:master

Conversation

@sunng87

@sunng87 sunng87 commented Nov 7, 2011

Copy link
Copy Markdown
Contributor

For some protocols (such as Diameter Protocol), the value of length field means the whole packet size. LengthFieldOffset and LengthFieldLength are counted into that. It conflicts with current LengthFieldBasedFrameDecoder impl. And also I find it difficult to subclass it to add this modification (fields are private, no accessors, decode is rather big). So I think it's better to provide the new option to LengthFieldBasedFrameDecoder.

@normanmaurer

Copy link
Copy Markdown
Member

I will review later and if everything is ok pull itin. So stay tuned....

normanmaurer added a commit that referenced this pull request Nov 9, 2011
Fix NETTY-452, add an option for whether to count length field into packet length or not
@normanmaurer
normanmaurer merged commit b3b0968 into netty:master Nov 9, 2011
@normanmaurer

Copy link
Copy Markdown
Member

Also merged to 3.2

@trustin

trustin commented Nov 10, 2011

Copy link
Copy Markdown
Member

sunng87,

You can easily extract the Diameter protocol message frame with the following parameters:

  • lengthFieldOffset = 1
  • lengthFieldLength = 3
  • lengthAdjustment = -4
  • initialBytesToStrip = 0

Therefore, there's no need to patch LengthFieldBasedFrameDecoder. If this is not correct, please let me know.

@sunng87

sunng87 commented Nov 11, 2011

Copy link
Copy Markdown
Contributor Author

Trustin, you are right, it works. Thank you.
Please revert my changes. Sorry to be annoying...

@trustin

trustin commented Nov 11, 2011

Copy link
Copy Markdown
Member

No problem. :-)

normanmaurer added a commit that referenced this pull request Nov 11, 2011
@normanmaurer

Copy link
Copy Markdown
Member

Reverted in master and 3.2

chrisvest pushed a commit to chrisvest/netty that referenced this pull request Apr 2, 2025
Motivation:

Or implementation that we used before to handle writable streams was very wasteful as we basically had to iterate over all the streams all the time even tho most of the time streams should not have any pending writes which need to be handled here.

Modifications:

Keep track of streams that have pending writes by ourselves and only process these when QuicheQuicChannel.writable() is called.

Result:

Less overhead, fixes netty/netty-incubator-codec-quic#42.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants