+http://suprem.sec.samsung.net/jira/browse/CONPRO-1155
+
+commit_info_2017-12-06.txt
+
+commit_id: f182c56ebbd24b61b710a016c8e7bec4a7fc00fb
+----------------------------------------------------------------------------------------------------------------------------------
http://suprem.sec.samsung.net/jira/browse/CONPRO-1147
commit_info_2017-11-29.txt
OICFree(info);
return CA_STATUS_FAILED;
}
- OIC_LOG_V(DEBUG, TAG, "created taskId: %u", threadInfo->taskId);
+ OIC_LOG_V(INFO, TAG, "created thread: %p, taskId: %u", threadInfo->thread, threadInfo->taskId);
oc_mutex_unlock(thread_pool->details->list_lock);
OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
{
if (threadInfo->taskId == taskId)
{
- OIC_LOG_V(INFO, TAG, "waiting.. taskId: %u", threadInfo->taskId);
+ OIC_LOG_V(INFO, TAG, "waiting.. thread: %p, taskId: %u", threadInfo->thread,
+ threadInfo->taskId);
oc_thread_wait(threadInfo->thread);
- OIC_LOG_V(DEBUG, TAG, "removed taskId: %u", threadInfo->taskId);
+ OIC_LOG_V(INFO, TAG, "removed.. thread: %p, taskId: %u", threadInfo->thread,
+ threadInfo->taskId);
u_arraylist_remove(thread_pool->details->threads_list, i);
oc_thread_free(threadInfo->thread);
OICFree(threadInfo);
if (threadInfo->thread)
{
#ifdef __TIZEN__
- OIC_LOG_V(INFO, TAG, "canceling.. thread: %p", threadInfo->thread);
+ OIC_LOG_V(INFO, TAG, "canceling.. thread: %p, taskId: %u", threadInfo->thread,
+ threadInfo->taskId);
oc_thread_cancel(threadInfo->thread);
#endif
- OIC_LOG_V(INFO, TAG, "waiting.. thread: %p", threadInfo->thread);
+ OIC_LOG_V(INFO, TAG, "waiting.. thread: %p, taskId: %u", threadInfo->thread,
+ threadInfo->taskId);
oc_thread_wait(threadInfo->thread);
oc_thread_free(threadInfo->thread);
}
char *value,
int valueLen, void *userData)
{
+ (void)characteristic;
+
OIC_LOG(DEBUG, TAG, "IN");
OIC_LOG_V(DEBUG, TAG, "Changed characteristic value length [%d]", valueLen);
void CALEGattCharacteristicWriteCb(int result, bt_gatt_h reqHandle, void *userData)
{
+ (void)reqHandle;
+ (void)userData;
+
OIC_LOG(DEBUG, TAG, "IN ");
if (BT_ERROR_NONE != result)
void CALEAdapterScanResultCb(int result, bt_adapter_le_device_scan_result_info_s *scanInfo,
void *userData)
{
+ (void)userData;
+
OIC_LOG(DEBUG, TAG, "IN");
VERIFY_NON_NULL_VOID(scanInfo, TAG, "scanInfo");
void CAStartTimerThread(void *data)
{
+ (void)data;
+
OIC_LOG(DEBUG, TAG, "IN");
while (g_isLEGattClientStarted)
{
bool CALEClientIsConnected(const char* address)
{
+ (void)address;
//@Todo
return true;
}
CAResult_t CALEClientSetMtuSize(const char* address, uint16_t mtuSize)
{
+ (void)mtuSize;
+
VERIFY_NON_NULL(address, TAG, "address is null");
//@Todo
//it should be implemented after update Tizen 3.0
void CALEAdapterStateChangedCb(int result, bt_adapter_state_e adapter_state,
void *user_data)
{
+ (void)result;
+ (void)user_data;
+
OIC_LOG(DEBUG, TAG, "IN");
oc_mutex_lock(g_bleDeviceStateChangedCbMutex);
void CALENWConnectionStateChangedCb(int result, bool connected,
const char *remoteAddress, void *userData)
{
+ (void)result;
+ (void)userData;
+
OIC_LOG(DEBUG, TAG, "IN");
VERIFY_NON_NULL_VOID(remoteAddress, TAG, "remote address is NULL");
bt_gatt_h characteristic, bool completed, void *user_data)
#endif
{
+ (void)server;
+ (void)characteristic;
+ (void)completed;
+ (void)user_data;
+
OIC_LOG_V(DEBUG, TAG, "Notification to the device[%s] result[%d]", remote_address, result);
}
void CALENotificationCb(bool notify, bt_gatt_server_h server, bt_gatt_h gatt_handle,
void *user_data)
{
+ (void)server;
+ (void)gatt_handle;
+ (void)user_data;
+
OIC_LOG(DEBUG, TAG, "IN");
if (notify)
{
int charLen, void *userData)
#endif
{
+ (void)server;
+ (void)gatt_handle;
+ (void)userData;
+
OIC_LOG(INFO, TAG, "IN - WriteCharCB");
if (NULL == charValue || NULL == remoteAddress)
bool CALEServerIsConnected(const char* address)
{
+ (void)address;
//@Todo
return true;
}
static bool CAClearQueueEndpointDataContext(void *data, uint32_t size, void *ctx)
{
+ (void)size;
+
if (NULL == data || NULL == ctx)
{
return false;
static bool CAClearQueueAdapterDataContext(void *data, uint32_t size, void *ctx)
{
+ (void)size;
+
if (NULL == data || NULL == ctx)
{
return false;
static void CAIPCleanupHandler(void *arg)
{
+ (void)arg;
+
OIC_LOG(DEBUG, TAG, "Called clean-up handler");
if (caglobals.ip.shutdownFds[0] != OC_INVALID_SOCKET)
void CAIPConnectionStateChangedCb(connection_type_e type, void* userData)
{
+ (void)userData;
+
switch (type)
{
case CONNECTION_TYPE_DISCONNECTED:
static bool CAClearQueueEndpointDataContext(void *data, uint32_t size, void *ctx)
{
+ (void)size;
+
if (NULL == data || NULL == ctx)
{
return false;
void CASetLENetworkMonitorCallbacks(CAAdapterStateChangedCB adapterStateCB,
CAConnectionStateChangedCB connStateCB)
{
+ (void)adapterStateCB;
+ (void)connStateCB;
OIC_LOG(DEBUG, TAG, "CASetLENetworkMonitorCallbacks");
-
}
CAResult_t CAManagerLEStartAdvertising()
#include "OCPlatform.h"
#include "OCException.h"
#include "ocpayload.h"
+#include "oic_malloc.h"
using namespace OC;
char *uri = NULL;
OCRepPayloadGetPropString(links[i], OC_RSRVD_HREF, &uri);
OCResourceHandle handle = OCGetResourceHandleAtUri(uri);
+
int64_t ins = 0;
OCRepPayloadGetPropInt(links[i], OC_RSRVD_INS, &ins);
OCBindResourceInsToResource(handle, ins);
+
+ OICFree(uri);
+ }
+
+ // Free links
+ size_t count = calcDimTotal(dimensions);
+ for (size_t k = 0; k < count; k++)
+ {
+ OCRepPayloadDestroy(links[k]);
}
+ OICFree(links);
}
OCRepresentation rep = parseRDResponseCallback(clientResponse);
std::thread exec(context->callback, rep, clientResponse->result);
char **itf = NULL;
OCRepPayloadGetStringArray(link, OC_RSRVD_INTERFACE, &itf, itfDim);
- if (SQLITE_DONE != sqlite3_step(stmt))
+ int sqlRet = sqlite3_step(stmt);
+ if (SQLITE_DONE != sqlRet)
{
sqlite3_finalize(stmt);
- return res;
}
- VERIFY_SQLITE(sqlite3_exec(gRDDB, "COMMIT", NULL, NULL, NULL));
+ else
+ {
+ VERIFY_SQLITE(sqlite3_exec(gRDDB, "COMMIT", NULL, NULL, NULL));
+
+ int64_t ins = sqlite3_last_insert_rowid(gRDDB);
+ VERIFY_SQLITE(storeResourceType(rt, rtDim[0], ins));
+ VERIFY_SQLITE(storeInterfaceType(itf, itfDim[0], ins));
+ }
- int64_t ins = sqlite3_last_insert_rowid(gRDDB);
- VERIFY_SQLITE(storeResourceType(rt, rtDim[0], ins));
- VERIFY_SQLITE(storeInterfaceType(itf, itfDim[0], ins));
OICFree(uri);
OCPayloadDestroy((OCPayload *)p);
for (j = 0; j < mtDim[0]; j++)
}
OICFree(itf);
+ if (SQLITE_DONE != sqlRet)
+ {
+ // Free links
+ size_t count = calcDimTotal(dimensions);
+ for (size_t k = 0; k < count; k++)
+ {
+ OCRepPayloadDestroy(links[k]);
+ }
+ OICFree(links);
+
+ return res;
+ }
}
VERIFY_SQLITE(sqlite3_finalize(stmt));
res = SQLITE_OK;
+
+ // Free links
+ size_t count = calcDimTotal(dimensions);
+ for (size_t k = 0; k < count; k++)
+ {
+ OCRepPayloadDestroy(links[k]);
+ }
+ OICFree(links);
}
return res;
}
if (SQLITE_DONE != sqlite3_step(stmt))
{
sqlite3_finalize(stmt);
+ OICFree(deviceid);
return OC_STACK_ERROR;
}
VERIFY_SQLITE(sqlite3_finalize(stmt));
return OC_STACK_OK;
}
- OCRepPayload **responsePayload[len];
-
+ OCRepPayload **responsePayload = NULL;
size_t dimensions[MAX_REP_ARRAY_DEPTH];
- OCRepPayloadGetPropObjectArray(payload, TABLE, responsePayload, dimensions);
-
- if (NULL == *responsePayload)
+ OCRepPayloadGetPropObjectArray(payload, TABLE, &responsePayload, dimensions);
+ if (NULL == responsePayload)
{
OIC_LOG(DEBUG, TAG, "RMPParsePayload OUT");
return OC_STACK_OK;
if (NULL == *gatewayTable)
{
OIC_LOG(DEBUG, TAG, "Gateway table create failed");
- return OC_STACK_ERROR;
+ goto error_exit;
}
+ size_t resPayloadSize = calcDimTotal(dimensions);
for (int i = 0; i < len; i++)
{
RTMGatewayEntry_t *entry = (RTMGatewayEntry_t *)OICCalloc(1, sizeof(RTMGatewayEntry_t));
-
if (NULL == entry)
{
OIC_LOG(DEBUG, TAG, "RTMGatewayEntry_t Calloc failed");
- return OC_STACK_ERROR;
+ goto error_exit;
}
// Filling new Entry
entry->destination = (RTMGatewayId_t*)OICCalloc(1, sizeof(RTMGatewayId_t));
{
OIC_LOG(DEBUG, TAG, "Destination Calloc failed");
OICFree(entry);
- return OC_STACK_ERROR;
+ goto error_exit;
}
entry->nextHop = (RTMGatewayId_t*)OICCalloc(1, sizeof(RTMGatewayId_t));
if (NULL == entry->nextHop)
OIC_LOG(DEBUG, TAG, "nextHop Calloc failed");
OICFree(entry->destination);
OICFree(entry);
- return OC_STACK_ERROR;
+ goto error_exit;
}
entry->nextHop->gatewayId = *gatewayId;
int64_t gatewayBuf;
int64_t routeCost;
- OCRepPayloadGetPropInt(*((*responsePayload) + i), GATEWAY, &gatewayBuf);
- OCRepPayloadGetPropInt(*((*responsePayload) + i), ROUTE_COST, &routeCost);
+ OCRepPayloadGetPropInt(responsePayload[i], GATEWAY, &gatewayBuf);
+ OCRepPayloadGetPropInt(responsePayload[i], ROUTE_COST, &routeCost);
entry->destination->gatewayId = gatewayBuf;
entry->routeCost = routeCost;
u_linklist_add(*gatewayTable, (void *)entry);
}
+
+ for (size_t k = 0; k < resPayloadSize; k++)
+ {
+ OCRepPayloadDestroy(responsePayload[k]);
+ }
+ OICFree(responsePayload);
+
OIC_LOG(DEBUG, TAG, "RMPParsePayload OUT");
return OC_STACK_OK;
+
+error_exit:
+ for (size_t k = 0; k < resPayloadSize; k++)
+ {
+ OCRepPayloadDestroy(responsePayload[k]);
+ }
+ OICFree(responsePayload);
+ return OC_STACK_ERROR;
}
void RMPFreePayload(OCRepPayload *payload)
* favor of destination.)
* @param destination Complete description of destination.
* @param payload Encoded request payload,
- OCDoResource will free given payload when return OC_STATUS_OK.
+ * OCDoResource will free given payload.
* @param connectivityType Modifier flags when destination is not given.
* @param qos Quality of service. Note that if this API is called on a uri with the
* well-known multicast IP address, the qos will be forced to ::OC_LOW_QOS
* favor of destination.)
* @param destination Complete description of destination.
* @param payload Encoded request payload.
- OCDoRequest does not free given payload.
+ * OCDoRequest does not free given payload.
* @param connectivityType Modifier flags when destination is not given.
* @param qos Quality of service. Note that if this API is called on a uri with the
* well-known multicast IP address, the qos will be forced to ::OC_LOW_QOS
}
}
- OIC_LOG(INFO, TAG, "Callback for presence");
-
+ OIC_LOG(INFO, TAG, "Before calling into application address space for presence");
cbResult = cbNode->callBack(cbNode->context, cbNode->handle, &response);
+ OIC_LOG(INFO, TAG, "After calling into application address space for presence");
if (cbResult == OC_STACK_DELETE_TRANSACTION)
{
else if(responseInfo->result == CA_RETRANSMIT_TIMEOUT)
{
OIC_LOG(INFO, TAG, "Receiving A Timeout for this token");
- OIC_LOG(INFO, TAG, "Calling into application address space");
OCClientResponse response =
{.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
response.identity.id_length = responseInfo->info.identity.id_length;
response.result = CAResponseToOCStackResult(responseInfo->result);
+ OIC_LOG(INFO, TAG, "Before calling into application address space for reTrans timeout");
cbNode->callBack(cbNode->context,
cbNode->handle, &response);
+ OIC_LOG(INFO, TAG, "After calling into application address space for reTrans timeout");
FindAndDeleteClientCB(cbNode);
- OICFree(response.resourceUri);
+ OICFree((void *)response.resourceUri);
}
#ifdef __TIZENRT__
else if ((cbNode->method == OC_REST_OBSERVE || cbNode->method == OC_REST_OBSERVE_ALL)
response.identity.id_length = responseInfo->info.identity.id_length;
response.result = OC_STACK_UNAUTHORIZED_REQ;
+ OIC_LOG(INFO, TAG, "Before calling into application address space for observe resp");
cbNode->callBack(cbNode->context,
cbNode->handle,
&response);
+ OIC_LOG(INFO, TAG, "After calling into application address space for observe resp");
+
FindAndDeleteClientCB(cbNode);
OICFree(response.resourceUri);
}
else
{
OIC_LOG(INFO, TAG, "This is a regular response, A client call back is found");
- OIC_LOG(INFO, TAG, "Calling into application address space");
OCClientResponse response;
memset(&response, 0, sizeof(OCClientResponse));
{
OIC_LOG_V(ERROR, TAG, "Unknown Payload type in Discovery: %d %s",
cbNode->method, cbNode->requestUri);
- OICFree(response.resourceUri);
+ OICFree((void *)response.resourceUri);
return;
}
}
{
OIC_LOG_V(ERROR, TAG, "Unknown Payload type: %d %s",
cbNode->method, cbNode->requestUri);
- OICFree(response.resourceUri);
+ OICFree((void *)response.resourceUri);
return;
}
{
OIC_LOG(ERROR, TAG, "Error converting payload");
OCPayloadDestroy(response.payload);
- OICFree(response.resourceUri);
+ OICFree((void *)response.resourceUri);
return;
}
}
{
OIC_LOG(ERROR, TAG, "#header options are more than MAX_HEADER_OPTIONS");
OCPayloadDestroy(response.payload);
- OICFree(response.resourceUri);
+ OICFree((void *)response.resourceUri);
return;
}
HandleBatchResponse(cbNode->requestUri, (OCRepPayload **)&response.payload);
}
+ OIC_LOG(INFO, TAG, "Before calling into application address space for handleResponse");
OCStackApplicationResult appFeedback = cbNode->callBack(cbNode->context,
cbNode->handle,
&response);
+ OIC_LOG(INFO, TAG, "After calling into application address space for handleResponse");
+
cbNode->sequenceNumber = response.sequenceNumber;
if (appFeedback == OC_STACK_DELETE_TRANSACTION)
}
}
- OICFree(response.resourceUri);
+ OICFree((void *)response.resourceUri);
OCPayloadDestroy(response.payload);
}
return;
response.identity.id_length = errorInfo->info.identity.id_length;
response.result = CAResultToOCResult(errorInfo->result);
+ OIC_LOG(INFO, TAG, "Before calling into application address space for error response");
cbNode->callBack(cbNode->context, cbNode->handle, &response);
+ OIC_LOG(INFO, TAG, "After calling into application address space for error response");
}
ResourceObserver *observer = GetObserverUsingToken(errorInfo->info.token,
OCStackResult OCInit1(OCMode mode, OCTransportFlags serverFlags, OCTransportFlags clientFlags)
{
+ OC_UNUSED(serverFlags);
+ OC_UNUSED(clientFlags);
+
OIC_LOG(DEBUG, TAG, "call OCInit1");
return OCInit2(mode, OC_DEFAULT_FLAGS, OC_DEFAULT_FLAGS, OC_DEFAULT_ADAPTER);
}
OIC_LOG_V(DEBUG, TAG, "moving to TTL level %d",
cbNode->presence->TTLlevel);
+ OIC_LOG(INFO, TAG, "Before calling into application address space for presence timeout");
cbResult = cbNode->callBack(cbNode->context, cbNode->handle, &clientResponse);
+ OIC_LOG(INFO, TAG, "After calling into application address space for presence timeout");
+
if (cbResult == OC_STACK_DELETE_TRANSACTION)
{
FindAndDeleteClientCB(cbNode);
{
OCBindResourceInsToResource(handle, ins);
}
+
+ OICFree(uri);
+ uri = NULL;
}
}
+
+ // Free links
+ size_t count = calcDimTotal(dimensions);
+ for (size_t k = 0; k < count; k++)
+ {
+ OCRepPayloadDestroy(links[k]);
+ }
+ OICFree(links);
}
}
}
{return OC_STACK_NOTIMPL;}
#endif
#ifdef TCP_ADAPTER
- virtual OCStackResult findKeepAliveResource(std::string host,
- KeepAliveCallback resultCallback)
+ virtual OCStackResult findKeepAliveResource(std::string /*host*/,
+ KeepAliveCallback /*resultCallback*/)
{return OC_STACK_NOTIMPL;}
- virtual OCStackResult sendKeepAliveRequest(std::string host, const OCRepresentation& rep,
- KeepAliveCallback resultCallback)
+ virtual OCStackResult sendKeepAliveRequest(std::string /*host*/, const OCRepresentation& /*rep*/,
+ KeepAliveCallback /*resultCallback*/)
{return OC_STACK_NOTIMPL;}
#endif
};
{
if (g_adapterHandler)
{
+ OIC_LOG(INFO, TAG, "Before calling into application address space for adapterStateChanged");
g_adapterHandler((OCTransportAdapter) adapter, enabled);
+ OIC_LOG(INFO, TAG, "After calling into application address space for adapterStateChanged");
}
}
OCConnectivityType connType = (OCConnectivityType)
((adapter << CT_ADAPTER_SHIFT) | (flags & CT_MASK_FLAGS));
+ OIC_LOG(INFO, TAG, "Before calling into application address space for connectionStateChanged");
g_connectionHandler(ss.str(), connType, isConnected);
+ OIC_LOG(INFO, TAG, "After calling into application address space for connectionStateChanged");
}
}
OIC_LOG(DEBUG, ES_RH_TAG, "Enrollee doesn't have any observer.");
}
+ OICFree(ssid);
+ OICFree(cred);
OICFree(wiFiData);
}
OIC_LOG(DEBUG, ES_RH_TAG, "CoapCloudConf resource doesn't have any observer.");
}
+ OICFree(authCode);
+ OICFree(accessToken);
+ OICFree(authProvider);
+ OICFree(ciServer);
OICFree(cloudData);
}
void RegisterWifiRsrcEventCallBack(ESWiFiConfCB);
void RegisterCloudRsrcEventCallBack(ESCoapCloudConfCB);
void RegisterDevConfRsrcEventCallBack(ESDevConfCB);
+void RegisterConnectRequestEventCallBack(ESConnectRequestCB);
void UnRegisterResourceEventCallBack(void);
ESResult SetCallbackForUserData(ESReadUserdataCb readCb, ESWriteUserdataCb writeCb);
if( *userdata == NULL )
{
OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCDevConfProperties is failed");
- return ;
+ OICFree(account);
+ return;
}
}
OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
SC_RSRVD_ES_VENDOR_ACCOUNT, pDevConfProp->account);
+ OICFree(account);
}
OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadAccountData OUT");
}
}
+ // Free topicList
+ size_t count = calcDimTotal(dimensions);
+ for (size_t k = 0; k < count; k++)
+ {
+ OICFree(topicList[k]);
+ }
+ OICFree(topicList);
return OC_STACK_KEEP_TRANSACTION;
}
}\r
}\r
\r
+ // Free topic list\r
+ size_t count = calcDimTotal(dimensions);\r
+ for (size_t k = 0; k < count; k++)\r
+ {\r
+ OICFree(topicList[k]);\r
+ }\r
+ OICFree(topicList);\r
+\r
NS_LOG(DEBUG, "NSProviderGetMQResponseCB - OUT");\r
return OC_STACK_KEEP_TRANSACTION;\r
}\r
NSOICFree(topicSubData->topicName);
NSOICFree(topicSubData);
NSOICFree(consumerId);
+
+ // Free topic list
+ for (size_t k = 0; k < dimensionSize; k++)
+ {
+ OCRepPayloadDestroy(topicListPayload[k]);
+ }
+ OICFree(topicListPayload);
+
return NS_FAIL;
}
}
}
NSSendTopicUpdationToConsumer(consumerId);
+
+ // Free topic list
+ for (size_t k = 0; k < dimensionSize; k++)
+ {
+ OCRepPayloadDestroy(topicListPayload[k]);
+ }
+ OICFree(topicListPayload);
+
NSOICFree(consumerId);
NS_LOG(DEBUG, "NSPostConsumerTopics() - OUT");
return NS_OK;