Update snapshot(2017-10-04) 27/154427/1
authorHongkuk, Son <hongkuk.son@samsung.com>
Tue, 10 Oct 2017 07:47:00 +0000 (16:47 +0900)
committerHongkuk, Son <hongkuk.son@samsung.com>
Tue, 10 Oct 2017 07:47:22 +0000 (16:47 +0900)
Signed-off-by: Hongkuk, Son <hongkuk.son@samsung.com>
Change-Id: Idf480dc4361b14c8902e15f74ca253a55b2f3e1e

packaging/snapshot_history.txt
resource/csdk/connectivity/api/cacommon.h
resource/csdk/connectivity/common/src/caremotehandler.c
resource/csdk/connectivity/inc/caretransmission.h
resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c
resource/csdk/connectivity/src/cablockwisetransfer.c [changed mode: 0644->0755]
resource/csdk/connectivity/src/camessagehandler.c
resource/csdk/connectivity/src/caretransmission.c

index 32b684b..baf3b59 100755 (executable)
@@ -1,3 +1,9 @@
+http://suprem.sec.samsung.net/jira/browse/CONPRO-1102
+
+commit_info_2017-10-04-rev1.txt
+
+commit_id: 43892977769486782b5b0475cc0343c875a4dca1
+----------------------------------------------------------------------------------------------------------------------------------
 http://suprem.sec.samsung.net/jira/browse/CONPRO-1098
 
 commit_info_2017-09-27-rev1.txt
index fc47ed1..e10669e 100755 (executable)
@@ -59,11 +59,11 @@ extern "C"
 /**
  * TAG of Analyzer log.
  */
-#define ANALYZER_TAG       "OIC_CA_ANALYZER_071801"
-#define BLE_CLIENT_TAG     "OIC_CA_LE_CLIENT_0718"
-#define BLE_SERVER_MCD_TAG "OIC_CA_LE_SER_MC_0718"
-#define IP_SERVER_TAG      "OIC_CA_IP_SERVER_0718"
-#define TCP_SERVER_TAG     "OIC_CA_TCP_SERVER_0718"
+#define ANALYZER_TAG       "OIC_CA_ANALYZER_092601"
+#define BLE_CLIENT_TAG     "OIC_CA_LE_CLIENT_0926"
+#define BLE_SERVER_MCD_TAG "OIC_CA_LE_SER_MC_0926"
+#define IP_SERVER_TAG      "OIC_CA_IP_SERVER_0926"
+#define TCP_SERVER_TAG     "OIC_CA_TCP_SERVER_0926"
 
 /**
  * IP address Length.
index deccb3d..3b99e12 100644 (file)
@@ -183,6 +183,11 @@ void CAFreeEndpoint(CAEndpoint_t *rep)
 
 static void CADestroyInfoInternal(CAInfo_t *info)
 {
+    if (NULL == info)
+    {
+        return;
+    }
+
     // free token field
     OICFree(info->token);
     info->token = NULL;
index a43ecd2..84c87a1 100644 (file)
 /** default ACK time is 2 sec(CoAP). **/
 #define DEFAULT_ACK_TIMEOUT_SEC     2
 
-/** default max retransmission trying count is 4(CoAP). **/
-#define DEFAULT_RETRANSMISSION_COUNT      4
+/** default max retransmission trying count is 4(CoAP).
+  * to allow reponse timeout greater than 60 seconds increased trying count to 5
+  */
+#define DEFAULT_RETRANSMISSION_COUNT      5
 
 /** check period is 1 sec. **/
 #define RETRANSMISSION_CHECK_PERIOD_SEC     1
index 7b8f60e..73831e4 100644 (file)
@@ -964,9 +964,7 @@ static int VerifyCertificateCallback(void *p_vrfy, mbedtls_x509_crt *crt, int de
     mbedtls_x509_crt_info(buf, sizeof(buf) - 1, "", crt);
     OIC_LOG_V(DEBUG, NET_SSL_TAG, "crt : %s", buf);
 
-    g_peerCertCallback.cb(g_peerCertCallback.ctx, crt, depth);
-
-    return 0;
+    return g_peerCertCallback.cb(g_peerCertCallback.ctx, crt, depth);
 }
 
 CAResult_t CAsetPeerCertCallback(void *ctx, PeerCertCallback peerCertCallback)
index 3176f83..6c9d09e 100755 (executable)
@@ -1243,7 +1243,10 @@ static void CALEServerSendDataThread(void *threadData)
     {
         OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                   "CAGenerateVariableForFragmentation failed, result [%d]", result);
-        g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        if (g_errorHandler)
+        {
+            g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);    
+        }        
         return;
     }
 
@@ -1285,7 +1288,10 @@ static void CALEServerSendDataThread(void *threadData)
     {
         OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                   "CAGenerateHeader failed, result [%d]", result);
-        g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        if (g_errorHandler)
+        {
+            g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        }
         return;
     }
 
@@ -1298,7 +1304,10 @@ static void CALEServerSendDataThread(void *threadData)
     {
         OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                   "CAGenerateHeaderPayloadLength failed, result [%d]", result);
-        g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        if (g_errorHandler)
+        {
+            g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        }
         return;
     }
 
@@ -1323,7 +1332,10 @@ static void CALEServerSendDataThread(void *threadData)
     {
         OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                   "Making data segment failed, result [%d]", result);
-        g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        if (g_errorHandler)
+        {
+            g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        }
         return;
     }
 
@@ -1344,11 +1356,13 @@ static void CALEServerSendDataThread(void *threadData)
                       CALEADAPTER_TAG,
                       "Update characteristics failed, result [%d]",
                       result);
-
-            g_errorHandler(bleData->remoteEndpoint,
-                           bleData->data,
-                           bleData->dataLen,
-                           result);
+            if (g_errorHandler)
+            {
+                g_errorHandler(bleData->remoteEndpoint,
+                               bleData->data,
+                               bleData->dataLen,
+                               result);
+            }
             return;
         }
 
@@ -1367,7 +1381,10 @@ static void CALEServerSendDataThread(void *threadData)
         {
             OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                       "CAGenerateHeader failed, result [%d]", result);
-            g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+            if (g_errorHandler)
+            {
+                g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+            }
             return;
         }
 
@@ -1386,7 +1403,10 @@ static void CALEServerSendDataThread(void *threadData)
             {
                 OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                             "Making data segment failed, result [%d]", result);
-                g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                if (g_errorHandler)
+                {
+                    g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                }
                 return;
             }
 
@@ -1400,7 +1420,10 @@ static void CALEServerSendDataThread(void *threadData)
             {
                 OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                             "Update characteristics failed, result [%d]", result);
-                g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                if (g_errorHandler)
+                {
+                    g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                }
                 return;
             }
             OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "Server Sent data length [%d]",
@@ -1423,7 +1446,10 @@ static void CALEServerSendDataThread(void *threadData)
             {
                 OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                             "Making data segment failed, result [%d]", result);
-                g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                if (g_errorHandler)
+                {
+                    g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                }
                 return;
             }
 
@@ -1438,10 +1464,13 @@ static void CALEServerSendDataThread(void *threadData)
                           CALEADAPTER_TAG,
                           "Update characteristics failed, result [%d]",
                           result);
-                g_errorHandler(bleData->remoteEndpoint,
-                               bleData->data,
-                               bleData->dataLen,
-                               result);
+                if (g_errorHandler)
+                {
+                    g_errorHandler(bleData->remoteEndpoint,
+                                   bleData->data,
+                                   bleData->dataLen,
+                                   result);
+                }
                 return;
             }
             OIC_LOG_V(DEBUG,
@@ -1490,11 +1519,13 @@ static void CALEClientSendDataThread(void *threadData)
                       CALEADAPTER_TAG,
                       "CALEClientSendNegotiationMessage has failed, result [%d]",
                       res);
-
-            g_errorHandler(bleData->remoteEndpoint,
-                           bleData->data,
-                           bleData->dataLen,
-                           res);
+            if (g_errorHandler) 
+            {
+                g_errorHandler(bleData->remoteEndpoint,
+                               bleData->data,
+                               bleData->dataLen,
+                               res);
+            }
             return;
         }
     }
@@ -1517,7 +1548,10 @@ static void CALEClientSendDataThread(void *threadData)
     {
         OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                   "CAGenerateVariableForFragmentation failed, result [%d]", result);
-        g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        if (g_errorHandler)
+        {
+            g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        }
         return;
     }
 
@@ -1555,7 +1589,10 @@ static void CALEClientSendDataThread(void *threadData)
     {
         OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                   "CAGenerateHeader failed, result [%d]", result);
-        g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        if (g_errorHandler)
+        {
+            g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        }
         return;
     }
 
@@ -1568,7 +1605,10 @@ static void CALEClientSendDataThread(void *threadData)
     {
         OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                   "CAGenerateHeaderPayloadLength failed, result [%d]", result);
-        g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        if (g_errorHandler)
+        {
+            g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        }
         return;
     }
 
@@ -1593,7 +1633,10 @@ static void CALEClientSendDataThread(void *threadData)
     {
         OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                   "Making data segment failed, result [%d]", result);
-        g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        if (g_errorHandler)
+        {
+            g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+        }
         return;
     }
 
@@ -1617,10 +1660,13 @@ static void CALEClientSendDataThread(void *threadData)
                       CALEADAPTER_TAG,
                       "Update characteristics failed, result [%d]",
                       result);
-            g_errorHandler(bleData->remoteEndpoint,
-                           bleData->data,
-                           bleData->dataLen,
-                           result);
+            if (g_errorHandler)
+            {
+                g_errorHandler(bleData->remoteEndpoint,
+                               bleData->data,
+                               bleData->dataLen,
+                               result);
+            }
             return;
         }
         OIC_LOG_V(DEBUG,
@@ -1638,7 +1684,10 @@ static void CALEClientSendDataThread(void *threadData)
         {
             OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                       "CAGenerateHeader failed, result [%d]", result);
-            g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+            if (g_errorHandler)
+            {
+                g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+            }
             return;
         }
 
@@ -1656,7 +1705,10 @@ static void CALEClientSendDataThread(void *threadData)
             {
                 OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                             "Making data segment failed, result [%d]", result);
-                g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                if (g_errorHandler)
+                {
+                    g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                }
                 return;
             }
 
@@ -1673,7 +1725,10 @@ static void CALEClientSendDataThread(void *threadData)
                           CALEADAPTER_TAG,
                           "Update characteristics failed, result [%d]",
                           result);
-                g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                if (g_errorHandler) 
+                {
+                    g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                }
                 return;
             }
             OIC_LOG_V(DEBUG,
@@ -1699,7 +1754,10 @@ static void CALEClientSendDataThread(void *threadData)
             {
                 OIC_LOG_V(ERROR, CALEADAPTER_TAG,
                             "Making data segment failed, result [%d]", result);
-                g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                if (g_errorHandler)
+                {
+                    g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                }
                 return;
             }
 
@@ -1713,7 +1771,10 @@ static void CALEClientSendDataThread(void *threadData)
             {
                 OIC_LOG_V(ERROR, CALEADAPTER_TAG, "Update characteristics failed, result [%d]",
                                                    result);
-                g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                if (g_errorHandler)
+                {
+                    g_errorHandler(bleData->remoteEndpoint, bleData->data, bleData->dataLen, result);
+                }
                 return;
             }
             OIC_LOG_V(DEBUG,
old mode 100644 (file)
new mode 100755 (executable)
index 94a642b..10efa2e
@@ -1169,6 +1169,7 @@ CAResult_t CAUpdateBlockOptionItems(CABlockData_t *currData, const coap_pdu_t *p
 {
     VERIFY_NON_NULL(currData, TAG, "currData");
     VERIFY_NON_NULL(pdu, TAG, "pdu");
+    VERIFY_NON_NULL(pdu->transport_hdr, TAG, "pdu->transport_hdr");
     VERIFY_NON_NULL(block, TAG, "block");
 
     // update block data
index dcc172e..bb9d829 100755 (executable)
@@ -1300,10 +1300,13 @@ void CAClearMessageHandler(CATransportAdapter_t transportType)
         OIC_LOG_V(ERROR, TAG, "Clear send data failed[%d]", res);
     }
 
-    res = CARetransmissionClearAdapterData(&g_retransmissionContext, transportType);
-    if (res != CA_STATUS_OK)
+    if (transportType & DEFAULT_RETRANSMISSION_TYPE)
     {
-        OIC_LOG_V(ERROR, TAG, "Clear retransmission data failed[%d]", res);
+        res = CARetransmissionClearAdapterData(&g_retransmissionContext, transportType);
+        if (res != CA_STATUS_OK)
+        {
+            OIC_LOG_V(ERROR, TAG, "Clear retransmission data failed[%d]", res);
+        }
     }
 }
 
index 611ee5d..da27bb4 100644 (file)
@@ -654,11 +654,19 @@ CAResult_t CARetransmissionClearAdapterData(CARetransmission_t *context, CATrans
 
         // free
         if (NULL != removedData && NULL != removedData->endpoint &&
-                removedData->endpoint->adapter == type)
+                (removedData->endpoint->adapter == type))
         {
-            CAFreeEndpoint(removedData->endpoint);
-            OICFree(removedData->pdu);
-            OICFree(removedData);
+            CARetransmissionData_t *remData = (CARetransmissionData_t *) u_arraylist_remove(
+                    context->dataList, i);
+            if (NULL == remData)
+            {
+                continue;
+            }
+            CAFreeEndpoint(remData->endpoint);
+            OICFree(remData->pdu);
+            OICFree(remData);
+            len = u_arraylist_length(context->dataList);
+            i--;
         }
     }