[JIRA IOT-768] fixed to parsing message length for TCP
authorjihwan.seo <jihwan.seo@samsung.com>
Fri, 2 Oct 2015 05:39:16 +0000 (14:39 +0900)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Mon, 5 Oct 2015 02:07:03 +0000 (02:07 +0000)
when message length of TCP has short size (0~12 size)
Parser of Receiver is working as wrong size.

Change-Id: Ib8075913389ef28315623edfe8ae053238bb3663
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3403
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.c

index b5dd712..32e241e 100644 (file)
@@ -331,6 +331,9 @@ unsigned int coap_get_length_from_header(const unsigned char *header, coap_trans
     unsigned int length_field_data = 0;
     switch(transport)
     {
+        case coap_tcp:
+            length = header[0] >> 4;
+            break;
         case coap_tcp_8bit:
             length = header[1] + COAP_TCP_LENGTH_FIELD_8_BIT;
             break;