A small memory footprint AMQP implimentation
Dependents: iothub_client_sample_amqp remote_monitoring simplesample_amqp
Diff: connection.c
- Revision:
- 25:1101516ee67d
- Parent:
- 24:2c59c2d43ebf
- Child:
- 28:add19eb7defa
--- a/connection.c Mon May 08 10:50:45 2017 -0700 +++ b/connection.c Mon May 22 10:35:21 2017 -0700 @@ -195,9 +195,10 @@ } else { + char* performative_as_string; LOG(AZ_LOG_TRACE, 0, "<- "); LOG(AZ_LOG_TRACE, 0, (char*)get_frame_type_as_string(descriptor)); - char* performative_as_string = NULL; + performative_as_string = NULL; LOG(AZ_LOG_TRACE, LOG_LINE, (performative_as_string = amqpvalue_to_string(performative))); if (performative_as_string != NULL) { @@ -219,9 +220,10 @@ } else { + char* performative_as_string; LOG(AZ_LOG_TRACE, 0, "-> "); LOG(AZ_LOG_TRACE, 0, (char*)get_frame_type_as_string(descriptor)); - char* performative_as_string = NULL; + performative_as_string = NULL; LOG(AZ_LOG_TRACE, LOG_LINE, (performative_as_string = amqpvalue_to_string(performative))); if (performative_as_string != NULL) { @@ -1784,9 +1786,10 @@ /* Codes_SRS_CONNECTION_01_131: [Any incoming channel number associated with the endpoint shall be released.] */ if ((i < connection->endpoint_count) && (i > 0)) { + ENDPOINT_HANDLE* new_endpoints; (void)memmove(connection->endpoints + i, connection->endpoints + i + 1, sizeof(ENDPOINT_HANDLE) * (connection->endpoint_count - i - 1)); - ENDPOINT_HANDLE* new_endpoints = (ENDPOINT_HANDLE*)realloc(connection->endpoints, (connection->endpoint_count - 1) * sizeof(ENDPOINT_HANDLE)); + new_endpoints = (ENDPOINT_HANDLE*)realloc(connection->endpoints, (connection->endpoint_count - 1) * sizeof(ENDPOINT_HANDLE)); if (new_endpoints != NULL) { connection->endpoints = new_endpoints;