[IOT-2631] Increase message buffer size 91/22291/2
authorAlex Kelley <alexke@microsoft.com>
Fri, 1 Sep 2017 00:24:36 +0000 (17:24 -0700)
committerRandeep Singh <randeep.s@samsung.com>
Thu, 7 Sep 2017 05:12:21 +0000 (05:12 +0000)
Increase the size of the receive message buffer in CAReceiveMessage.

Change-Id: I4793631d88a99bb1e60c6a286b0edfcc2b2be837
Signed-off-by: Alex Kelley <alexke@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22291
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Steven Saunders <s.saunders-contractor@cablelabs.com>
Reviewed-by: Aleksey Volkov <a.volkov@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/connectivity/src/caprotocolmessage.c
resource/csdk/connectivity/src/ip_adapter/caipserver.c
resource/csdk/connectivity/src/tcp_adapter/catcpserver.c

index 9ab4609..3ac0015 100644 (file)
@@ -204,6 +204,7 @@ coap_pdu_t *CAParsePDU(const char *data, size_t length, uint32_t *outCode,
     if (NULL == outpdu)
     {
         OIC_LOG(ERROR, TAG, "outpdu is null");
+        OIC_LOG_V(DEBUG, TAG, "data length: %" PRIuPTR, length);
         return NULL;
     }
 
index d5d8f2e..565d888 100644 (file)
@@ -103,6 +103,11 @@ static struct in6_addr IPv6MulticastAddressOrg;
 #define IPv6_MULTICAST_GLB "ff0e::158"
 static struct in6_addr IPv6MulticastAddressGlb;
 
+/*
+ * Buffer size for the receive message buffer
+ */
+#define RECV_MSG_BUF_LEN 16384
+
 static char *ipv6mcnames[IPv6_DOMAINS] = {
     NULL,
     IPv6_MULTICAST_INT,
@@ -535,7 +540,7 @@ void CADeInitializeIPGlobals()
 
 static CAResult_t CAReceiveMessage(CASocketFd_t fd, CATransportFlags_t flags)
 {
-    char recvBuffer[COAP_MAX_PDU_SIZE] = {0};
+    char recvBuffer[RECV_MSG_BUF_LEN] = {0};
     int level = 0;
     int type = 0;
     int namelen = 0;
index 4e01680..5ee30c5 100644 (file)
@@ -1208,6 +1208,7 @@ size_t CACheckPayloadLengthFromHeader(const void *data, size_t dlen)
     if (!pdu)
     {
         OIC_LOG(ERROR, TAG, "outpdu is null");
+        OIC_LOG_V(DEBUG, TAG, "data length: %" PRIuPTR, dlen);
         return 0;
     }