[Model] IoTivity
[BinType] AP
[Customer] IoT-Core
[Issue#] CONPRO-1398
[Request] Robert Chudek / r.chudek
[Occurrence Version] n/a
[Problem] IoT-Core needs some additional server request handling.
[Cause & Measure] n/a
[Checking Method] n/a
[Team] IoT Connection
[Developer] Robert Chudek / r.chudek
[Solution company] Samsung
[Change Type] adjustment
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/
735a165c3239cfc5e0b01cd2ef1b5843321d3edb
(cherry picked from
735a165c3239cfc5e0b01cd2ef1b5843321d3edb)
Change-Id: If183e682dd165c64830d71f70d74eb15a5bb82ab
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
{
if(serverRequest)
{
+ OIC_LOG_V(WARNING, TAG, "Server request ID = [%u]", serverRequest->requestId);
LL_DELETE(serverRequestList, serverRequest);
OICFree(serverRequest->requestToken);
OICFree(serverRequest->rcvdVendorSpecificHeaderOptions);
serverRequest->numResponses = 1;
serverRequest->requestId = OCGetRandom();
+ // checking same id exist
+ while(serverRequest->requestId == 0 || GetServerRequestUsingHandle(serverRequest->requestId) != NULL)
+ {
+ serverRequest->requestId = OCGetRandom();
+ }
+
if(query)
{
OICStrcpy(serverRequest->query, sizeof(serverRequest->query), query);
#include "ocpayload.h"
#include "ocpayloadcbor.h"
#include "cautilinterface.h"
+#include "camessagehandler.h"
#include "oicgroup.h"
#if defined (ROUTING_GATEWAY) || defined (ROUTING_EP)
{
request->requestComplete = 1;
}
+
+ OIC_LOG_V(WARNING, TAG, "Server request ID = [%u]", request->requestId);
}
else
{
{
OIC_LOG(DEBUG, TAG, "Client does not receive the response within 1 minutes.");
- // Send message to disconnect session.
- OCSendDisconnectMessage(entry);
+ /* TCPDisconnectSession should be invoked depending on the result from client callback */
+ if (OCSendDisconnectMessage(entry) == OC_STACK_CONTINUE)
+ {
+ // Set sentPingMsg values with false.
+ entry->sentPingMsg = false;
+ entry->handle = NULL;
+ }
}
#ifdef WITH_PROCESS_EVENT
else
response.resourceUri = cbNode->requestUri;
response.result = OC_STACK_TIMEOUT;
- cbNode->callBack(cbNode->context, cbNode->handle, &response);
+ /* TCPDisconnectSession should be invoked depending on the result from client callback */
+ if (cbNode->callBack(cbNode->context, cbNode->handle, &response) == OC_STACK_KEEP_TRANSACTION)
+ {
+ return OC_STACK_CONTINUE;
+ }
+
FindAndDeleteClientCB(cbNode);
}