Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion on metadata length field #326

Open
jpaton opened this issue Jun 7, 2022 · 0 comments
Open

Confusion on metadata length field #326

jpaton opened this issue Jun 7, 2022 · 0 comments

Comments

@jpaton
Copy link

jpaton commented Jun 7, 2022

I'm confused about the following clause in the spec:

Metadata Length MUST be equal to the Frame Length minus the sum of the length of the Frame Header and the length of the Frame Payload, if present. If Metadata Length is not equal to this value, the frame is invalid and the receiver MUST send an ERROR[CONNECTION_ERROR] frame and close the underlying transport connection on reception unless the frame's IGNORE flag is set.

I'm finding this confusing because the only way I can imagine that this clause would apply is if the metadata length is too large such that there aren't enough bytes left in the frame. In other words, if metadata length > (frame length - frame header length). When would I find that metadata length is smaller than the frame length - (frame header length + frame payload length)? The frame payload length is given by simply the frame length - frame header length - metadata length. How can I tell the difference between a malformed payload and wrong metadata length?

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

No branches or pull requests

1 participant