From 84e5f48d3a4a6cfd92ca147cc833fcf011405107 Mon Sep 17 00:00:00 2001 From: "hyuna0213.jo" Date: Tue, 15 Dec 2015 10:16:37 +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: I0bfee2be03cb22a7bbb53c4d0f419381c8306fb5 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 Signed-off-by: hyuna0213.jo Reviewed-on: https://gerrit.iotivity.org/gerrit/4583 Reviewed-by: Uze Choi Tested-by: Uze Choi --- 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 175394b..e4f40d6 100644 --- a/resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.c +++ b/resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.c @@ -330,6 +330,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