Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: iothub_client_sample_http simplesample_http temp_sensor_anomaly
Revision 22:e0add922c564, committed 2016-08-12
- Comitter:
- AzureIoTClient
- Date:
- Fri Aug 12 10:03:39 2016 -0700
- Parent:
- 21:b601705c82a8
- Child:
- 23:44d825a1cd09
- Commit message:
- 1.0.10
Changed in this revision
| iothubtransporthttp.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/iothubtransporthttp.c Fri Jul 29 15:52:52 2016 -0700
+++ b/iothubtransporthttp.c Fri Aug 12 10:03:39 2016 -0700
@@ -8,6 +8,7 @@
#include "azure_c_shared_utility/gballoc.h"
#include <time.h>
+#include "iothub_client_options.h"
#include "iothub_client_version.h"
#include "iothub_client_private.h"
#include "iothub_transport_ll.h"
@@ -514,7 +515,7 @@
bool was_x509_ok = false; /*there's nothing "created" in the case of x509, it is a flag indicating that x509 is used*/
/*Codes_SRS_TRANSPORTMULTITHTTP_17_038: [ Otherwise, IoTHubTransportHttp_Register shall allocate the IOTHUB_DEVICE_HANDLE structure. ]*/
- bool was_resultCreated_ok = ((result = (HTTPTRANSPORT_PERDEVICE_DATA *) malloc(sizeof(HTTPTRANSPORT_PERDEVICE_DATA))) != NULL);
+ bool was_resultCreated_ok = ((result = (HTTPTRANSPORT_PERDEVICE_DATA *) malloc(sizeof(HTTPTRANSPORT_PERDEVICE_DATA))) != NULL);
bool was_create_deviceId_ok = was_resultCreated_ok && create_deviceId(result, device->deviceId);
if (was_create_deviceId_ok)
@@ -575,7 +576,7 @@
result->iotHubClientHandle = iotHubClientHandle;
result->waitingToSend = waitingToSend;
DList_InitializeListHead(&(result->eventConfirmations));
- result->transportHandle = (HTTPTRANSPORT_HANDLE_DATA *) handle;
+ result->transportHandle = (HTTPTRANSPORT_HANDLE_DATA *) handle;
}
else
{
@@ -620,7 +621,7 @@
HTTPTRANSPORT_HANDLE_DATA* handleData = deviceHandleData->transportHandle;
- listItem = (IOTHUB_DEVICE_HANDLE *) VECTOR_find_if(handleData->perDeviceList, findDeviceHandle, deviceHandle);
+ listItem = (IOTHUB_DEVICE_HANDLE *) VECTOR_find_if(handleData->perDeviceList, findDeviceHandle, deviceHandle);
if (listItem == NULL)
{
LogError("device handle not found in transport device list");
@@ -831,15 +832,15 @@
/*Codes_SRS_TRANSPORTMULTITHTTP_17_013: [ Otherwise, IoTHubTransportHttp_Destroy shall free all the resources currently in use. ]*/
for (size_t i = 0; i < deviceListSize; i++)
{
- listItem = (IOTHUB_DEVICE_HANDLE *) VECTOR_element(handleData->perDeviceList, i);
+ listItem = (IOTHUB_DEVICE_HANDLE *) VECTOR_element(handleData->perDeviceList, i);
HTTPTRANSPORT_PERDEVICE_DATA* perDeviceItem = (HTTPTRANSPORT_PERDEVICE_DATA*)(*listItem);
destroy_perDeviceData(perDeviceItem);
free(perDeviceItem);
}
- destroy_hostName((HTTPTRANSPORT_HANDLE_DATA *) handle);
- destroy_httpApiExHandle((HTTPTRANSPORT_HANDLE_DATA *) handle);
- destroy_perDeviceList((HTTPTRANSPORT_HANDLE_DATA *)handle);
+ destroy_hostName((HTTPTRANSPORT_HANDLE_DATA *) handle);
+ destroy_httpApiExHandle((HTTPTRANSPORT_HANDLE_DATA *) handle);
+ destroy_perDeviceList((HTTPTRANSPORT_HANDLE_DATA *)handle);
free(handle);
}
}
@@ -2028,8 +2029,8 @@
/*Codes_SRS_TRANSPORTMULTITHTTP_17_051: [ IF the list is empty, then IoTHubTransportHttp_DoWork shall do nothing. ]*/
for (size_t i = 0; i < deviceListSize; i++)
{
- listItem = (IOTHUB_DEVICE_HANDLE *) VECTOR_element(handleData->perDeviceList, i);
- HTTPTRANSPORT_PERDEVICE_DATA* perDeviceItem = *(HTTPTRANSPORT_PERDEVICE_DATA**)(listItem);
+ listItem = (IOTHUB_DEVICE_HANDLE *) VECTOR_element(handleData->perDeviceList, i);
+ HTTPTRANSPORT_PERDEVICE_DATA* perDeviceItem = *(HTTPTRANSPORT_PERDEVICE_DATA**)(listItem);
DoEvent(handleData, perDeviceItem, perDeviceItem->iotHubClientHandle);
DoMessages(handleData, perDeviceItem, perDeviceItem->iotHubClientHandle);
@@ -2105,14 +2106,14 @@
{
HTTPTRANSPORT_HANDLE_DATA* handleData = (HTTPTRANSPORT_HANDLE_DATA*)handle;
/*Codes_SRS_TRANSPORTMULTITHTTP_17_120: ["Batching"] */
- if (strcmp("Batching", option) == 0)
+ if (strcmp(OPTION_BATCHING, option) == 0)
{
/*Codes_SRS_TRANSPORTMULTITHTTP_17_117: [If optionName is an option handled by IoTHubTransportHttp then it shall be set.] */
handleData->doBatchedTransfers = *(bool*)value;
result = IOTHUB_CLIENT_OK;
}
/*Codes_SRS_TRANSPORTMULTITHTTP_17_121: ["MinimumPollingTime"] */
- else if (strcmp("MinimumPollingTime", option) == 0)
+ else if (strcmp(OPTION_MIN_POLLING_TIME, option) == 0)
{
handleData->getMinimumPollingTime = *(unsigned int*)value;
result = IOTHUB_CLIENT_OK;
