netutils/libcoap : patch for parsing error on CoAP over TCP
authorJin-Seong Kim <jseong82.kim@samsung.com>
Mon, 7 Aug 2017 01:03:16 +0000 (10:03 +0900)
committerEunBong Song <eunb.song@samsung.com>
Wed, 30 Aug 2017 04:15:49 +0000 (21:15 -0700)
commita489d75da4626b6c80f2d8753332cc6f7db86aef
tree904d23f6d9dccfc47a8e466e708ca72217cd1c5b
parent716a50c038fcc487ee292e3f019e42021b4015db
netutils/libcoap : patch for parsing error on CoAP over TCP

This commit is patch for parsing error on CoAP over TCP
 When parse transport type of TCP header,
 coap_get_tcp_header_type_from_initbyte should be used
 The size used on coap_get_tcp_header_type_from_size means that
 option and payload length except for header and token
 (size = pdu->length - size of header - length of token)

problem 1. Token value is not parsed properly on CoAP over TCP case
 - coap_convert_to_tcp_pdu has bugs to find start potiner of token
problem 2. Code value is not parsed proplery on CoAP over TCP case
 - node->pdu is created accordingly its transport type
 - when coap_get_code called, wrong tranport type is used

Change-Id: Iddec317f797fe5934a1025acc60a3ffe9608c747
Signed-off-by: Jin-Seong Kim <jseong82.kim@samsung.com>
apps/examples/libcoap_client/libcoap-client.c
apps/examples/libcoap_server/libcoap-server.c
apps/include/netutils/libcoap/debug.h
apps/include/netutils/libcoap/net.h
apps/include/netutils/libcoap/pdu.h
apps/netutils/libcoap/async.c
apps/netutils/libcoap/debug.c
apps/netutils/libcoap/net.c
apps/netutils/libcoap/pdu.c