A small memory footprint AMQP implimentation
Dependents: iothub_client_sample_amqp remote_monitoring simplesample_amqp
Diff: amqp_management.c
- Revision:
- 43:4c1e4e94cdd3
- Parent:
- 41:0e723f9cbd89
- Child:
- 46:01f7ca900e07
--- a/amqp_management.c Fri May 04 13:24:52 2018 -0700 +++ b/amqp_management.c Mon Jun 11 15:39:52 2018 -0700 @@ -54,8 +54,8 @@ AMQP_MANAGEMENT_STATE amqp_management_state; char* status_code_key_name; char* status_description_key_name; - int sender_connected : 1; - int receiver_connected : 1; + unsigned int sender_connected : 1; + unsigned int receiver_connected : 1; } AMQP_MANAGEMENT_INSTANCE; static AMQP_VALUE on_message_received(const void* context, MESSAGE_HANDLE message) @@ -410,7 +410,7 @@ break; case MESSAGE_SENDER_STATE_OPEN: - amqp_management_instance->sender_connected = -1; + amqp_management_instance->sender_connected = 1; /* Codes_SRS_AMQP_MANAGEMENT_01_142: [ - If `new_state` is `MESSAGE_SENDER_STATE_OPEN` and the message receiver did not yet indicate its state as `MESSAGE_RECEIVER_STATE_OPEN`, the `on_amqp_management_open_complete` callback shall not be called.]*/ if (amqp_management_instance->receiver_connected != 0) { @@ -509,7 +509,7 @@ break; case MESSAGE_RECEIVER_STATE_OPEN: - amqp_management_instance->receiver_connected = -1; + amqp_management_instance->receiver_connected = 1; /* Codes_SRS_AMQP_MANAGEMENT_01_154: [ - If `new_state` is `MESSAGE_RECEIVER_STATE_OPEN` and the message sender did not yet indicate its state as `MESSAGE_RECEIVER_STATE_OPEN`, the `on_amqp_management_open_complete` callback shall not be called. ]*/ if (amqp_management_instance->sender_connected != 0) { @@ -1062,7 +1062,7 @@ operation_message->on_execute_operation_complete(operation_message->callback_context, AMQP_MANAGEMENT_EXECUTE_OPERATION_INSTANCE_CLOSED, 0, NULL, NULL); free(operation_message); } - + if (singlylinkedlist_remove(amqp_management->pending_operations, list_item_handle) != 0) { LogError("Cannot remove item");