From fb38e20b9c463b6e05171985f64fb7ecf98ca16c Mon Sep 17 00:00:00 2001 From: "jihwan.seo" Date: Fri, 2 Oct 2015 14:39:16 +0900 Subject: [PATCH] [JIRA IOT-768] fixed to parsing message length for TCP 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/3403 Reviewed-by: Ashok Babu Channa Tested-by: jenkins-iotivity Reviewed-by: Patrick Lankswert --- resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.c b/resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.c index b5dd712..32e241e 100644 --- a/resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.c +++ b/resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.c @@ -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; -- 2.7.4