Mismatch between C++ and Python for callback index type#111
Merged
MichalPrincNXP merged 1 commit intoEmbeddedRPC:developfrom Aug 5, 2020
Merged
Mismatch between C++ and Python for callback index type#111MichalPrincNXP merged 1 commit intoEmbeddedRPC:developfrom
MichalPrincNXP merged 1 commit intoEmbeddedRPC:developfrom
Conversation
Contributor
Author
|
Looks like the build failed because the build server is missing the file /usr/local/opt/bison/bin/bison. How can this be resolved? Thanks. |
Member
|
Hi @RamseyTI , thanks for providing this bugfix. I am going to integrate it. As for the Travis build issue, it has just been solved on the develop branch. Could you please rebase your PR to trigger the Travis again with correct/updated config? Thank you. |
When multiple callbacks are defined, callbacks are stored in an array on both the client and server. When a callback is registered, only the index of the callback in this array is sent over the transport. In C++, the array index is encoded as a uint8, where as in Python it is encoded as a uint32. So, a Python client will not be aligned with a C++ server, leading to wrong information being decoded by the server. This fix aligns both to be a uint8 type for the callback index.
Contributor
Author
|
Looks like the build passed. Thanks. |
MichalPrincNXP
approved these changes
Aug 5, 2020
Member
MichalPrincNXP
left a comment
There was a problem hiding this comment.
Thank you @RamseyTI for the effort!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In eRPC, when multiple callbacks are defined, callbacks are stored
in an array on both the client and server. When a callback is register,
only the index of the callback in this array is sent over the transport.
In C++, the array index is encoded as a unit8, where as in Python it is
encoded as a uint32. So, a Python client will not be aligned with a C++
server, leading to wrong information being decoded by the server. This
fix aligns both to be a uint8 type for the callback index.