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

Send negative response when the sub-function is missing #22

Merged

Conversation

markcorbinuk
Copy link
Contributor

Services that require a sub-function do not currently return a negative response when the sub-function is missing from the request. This fix removes the length check from evaluateServiceResponse() and relies on the fact that the length checks are implemented correctly in the service callbacks.

Also re-ordered the switch statement to make it clearer which services aren't implemented. In reality these services will never be checked in the switch stattement as getServiceForSID() will return NULL and trigger an early exit.

Services that require a sub-function do not currently return a
negative response when the sub-function is missing from the request.
This fix removes the length check from evaluateServiceResponse() and
relies on the fact that the length checks are implemented correctly
in the service callbacks.

Also re-ordered the switch statement to make it clearer which services
aren't implemented. In reality these services will never be checked in
the switch stattement as getServiceForSID() will return NULL and
trigger an early exit.

Signed-off-by: Mark Corbin <mcorbin@lunarenergy.com>
@driftregion driftregion added the unit-test-wanted Behavior that is not yet covered by unit tests but should be label Nov 6, 2023
@driftregion driftregion merged commit af2533b into driftregion:main Nov 6, 2023
1 check passed
@driftregion
Copy link
Owner

Looks good to me, thanks Mark!

@markcorbinuk markcorbinuk deleted the fix-missing-sub-function-response branch November 6, 2023 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unit-test-wanted Behavior that is not yet covered by unit tests but should be
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants