-
Notifications
You must be signed in to change notification settings - Fork 41
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
Implement request parsing #452
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9aa7fd9
Introduce RequestHeader and try_parse_request[_fd].
khuey 63308d9
Filter out request fields already parsed into the header.
khuey b065d62
Fix xproto::Gravity special casing to work with imports.
khuey 8540c4e
Generate try_parse methods for Aux structs.
khuey 733a784
Add a "conversion" from Infallible to ParseError.
khuey 71b4237
Implement parsing for request fields.
khuey 20081e3
Dispense with odd_length, which we don't care about at all.
khuey 4007467
Check padding remaining after request parsing.
khuey 4bce7d6
Add a few tests for request parsing.
khuey 8892230
When checking the final padding don't index the slice directly which …
khuey 93e38a8
Make clippy happy.
khuey 6a7a2f5
Fix request parsing tests to do endian conversion.
khuey 191e4f7
Fix odd_length handling.
khuey d4ecc46
Silence clippy warning.
khuey 52f0f6f
Fix bad opcode test to be entirely correct except for a bad opcode.
khuey 1e6fc09
Consolidate list parsing generation code.
khuey 6ae0b81
Save a line on bool parsings.
khuey 4dd8f67
Stop doing request length validation and get rid of the validate_requ…
khuey e7e1f12
More clippy fixes.
khuey 26a6d34
Tweak comment as requested.
khuey 3906f0f
Add a helper function for parsing request headers.
khuey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is it actually used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. A quick test build says "this is unused".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in xinput. It could probably be eliminated with some more special casing in the code generator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to actually enable the necessary features in my test build. 🤦
New try says:
This is inside
ChangeDevicePropertyRequest
andXIChangePropertyRequest
In both cases, aformat
u8
is converted tou8
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we could probably try harder to avoid that u8 -> u8 conversion if we wanted to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that this
try_into
comes fromemit_field_post_parse
, which would normally convert it into an enum. But here it is "converted" into anu8
because it is a deducible field.In
emit_struct_type
, this is avoided with: