A small memory footprint AMQP implimentation
Dependents: iothub_client_sample_amqp remote_monitoring simplesample_amqp
Diff: message_sender.c
- Revision:
- 18:a922a4a30a82
- Parent:
- 17:923575db8b2d
- Child:
- 19:000ab4e6a2c1
--- a/message_sender.c Tue Jan 24 15:23:52 2017 -0800 +++ b/message_sender.c Fri Feb 10 17:00:55 2017 -0800 @@ -404,11 +404,6 @@ { default: case LINK_TRANSFER_ERROR: - if (message_with_callback->on_message_send_complete != NULL) - { - message_with_callback->on_message_send_complete(message_with_callback->context, MESSAGE_SEND_ERROR); - } - result = SEND_ONE_MESSAGE_ERROR; break; @@ -457,7 +452,11 @@ void* context = message_sender_instance->messages[i]->context; remove_pending_message_by_index(message_sender_instance, i); - on_message_send_complete(context, MESSAGE_SEND_ERROR); + if (on_message_send_complete != NULL) + { + on_message_send_complete(context, MESSAGE_SEND_ERROR); + } + i = message_sender_instance->message_count; break; } @@ -722,6 +721,12 @@ { default: case SEND_ONE_MESSAGE_ERROR: + + if (message_with_callback->on_message_send_complete != NULL) + { + message_with_callback->on_message_send_complete(message_with_callback->context, MESSAGE_SEND_ERROR); + } + remove_pending_message_by_index(message_sender_instance, message_sender_instance->message_count - 1); result = __LINE__; break;