-
Notifications
You must be signed in to change notification settings - Fork 258
Iothub delivery notification #392
Iothub delivery notification #392
Conversation
IoTHubMessage_Destroy(iotHubMessage); | ||
ConstMap_Destroy(properties); | ||
return; | ||
} |
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.
Do we want to return here (and in the section above) or make a best effort at sending the message to IoTHub?
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. If malloc fails how likely it is that sending message will success? If user needs a notification about delivery, and doesn't get one, wouldn't that be a huge problem too?
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.
The most likely way is if the "iotHubMessageId" string gets trashed in memory and the malloc_and_Strcpy_s fails, but even then it's unlikely that the IoTHubClient_SendEventAsync will succeed as well.
So it's pretty unlikely it worth trying to send the message. I'm OK with leaving it alone, just more curious if you had a different answer..
modules/iothub/src/iothub.c
Outdated
if (!userContextCallback) | ||
{ | ||
LogError("Context was null"); | ||
return; |
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.
return [](start = 8, length = 6)
The coding standards for our C code is to have one return call.
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.
fixed
Here is what I was talking about in #391 ('Message Delivered'-notification from IotHub). This feature is mandatory for us, so I just implemented it. If you are interested in having this kind of feature, here it is. If this is not useful to you, feel free to say no.