Microsoft Azure IoTHub client HTTP transport

Dependents:   iothub_client_sample_http simplesample_http temp_sensor_anomaly

This library implements the HTTP transport for Microsoft Azure IoTHub client. The code is replicated from https://github.com/Azure/azure-iot-sdks

Revision:
8:1b71bf027eb5
Parent:
7:48f0f78cd3ef
Child:
9:0b2cab6cfc60
--- a/iothubtransporthttp.c	Mon Nov 02 19:21:17 2015 -0800
+++ b/iothubtransporthttp.c	Thu Dec 17 18:23:34 2015 -0800
@@ -817,9 +817,9 @@
     {
         bool isFirst = true;
         PDLIST_ENTRY actual;
+		bool keepGoing = true; /*keepGoing gets sometimes to false from within the loop*/
         /*either all the items enter the list or only some*/
         result = MAKE_PAYLOAD_OK; /*optimistically initializing it*/
-        bool keepGoing = true; /*keepGoing gets sometimes to false from within the loop*/
         while (keepGoing && ((actual = handleData->waitingToSend->Flink) != handleData->waitingToSend))
         {
             size_t messageSize;
@@ -1105,6 +1105,9 @@
                             {
                                 size_t i;
                                 bool goOn = true;
+                                const char* msgId;
+                                const char* corrId;
+                                
                                 for (i = 0; (i < count) && goOn; i++)
                                 {
                                     /*Codes_SRS_IOTHUBTRANSPORTTHTTP_02_123: [Every property name shall add  to the message size the length of the property name + the length of the property value + 16 bytes.] */
@@ -1149,7 +1152,7 @@
                                 }
 
                                 // Add the Message Id and the Correlation Id
-                                const char* msgId = IoTHubMessage_GetMessageId(message->messageHandle);
+                                msgId = IoTHubMessage_GetMessageId(message->messageHandle);
                                 if (goOn && msgId != NULL)
                                 {
                                     if (HTTPHeaders_ReplaceHeaderNameValuePair(clonedEventHTTPrequestHeaders, IOTHUB_MESSAGE_ID, msgId) != HTTP_HEADERS_OK)
@@ -1159,7 +1162,7 @@
                                     }
                                 }
 
-                                const char* corrId = IoTHubMessage_GetCorrelationId(message->messageHandle);
+                                corrId = IoTHubMessage_GetCorrelationId(message->messageHandle);
                                 if (goOn && corrId != NULL)
                                 {
                                     if (HTTPHeaders_ReplaceHeaderNameValuePair(clonedEventHTTPrequestHeaders, IOTHUB_CORRELATION_ID, corrId) != HTTP_HEADERS_OK)