Fix enums in pxd files because macro creates enums that are _1_ base… #308
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.
…d instead of 0 based.
I haven't witnessed any bad behavior because of this except for confusing logs, and maybe some unnecessary state transitions.
I found this while investigating a CBS auth failure that turned out to be a problem with our service. I had some momentary confusion because, at one point, the C code called
on_cbs_open_complete
passingCBS_OPEN_OK
, which the C code has defined as1
. Then, insidecbs.pyx
, the code assumed that1
wasCBS_OPEN_ERROR
, so it setself.state
toAUTH_STATE_FAILURE
.Fortunately, our service finishes the put_token quickly enough that the CBS operation can complete successfully, so no harm was actually done.
I have mixed feelings about this change. On the one hand, the code is very clearly incorrect, but, on the other hand, the code appears to work just fine with the incorrect values. I can't say if this change would break code that was tuned to work around these invalid values. I can say that our limited testing (focused on sending IoTHub cloud-to-device messages) passes with this change.