mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-09 18:32:53 +03:00
pdu: Make sure type is set to CON if Reliable
This commit is contained in:
1 parent
cd1a7de0f2
commit
95faeac5bb
2 files changed
+6
-1
No files matched your search
+1
-1
@@ -1096,7 +1096,7 @@ coap_send(coap_session_t *session, coap_pdu_t *pdu) {
|
||||
}
|
||||
|
||||
/* A lot of the reliable code assumes type is CON */
|
||||
if (COAP_PROTO_RELIABLE(session->proto) && pdu->type == COAP_MESSAGE_NON)
|
||||
if (COAP_PROTO_RELIABLE(session->proto) && pdu->type != COAP_MESSAGE_CON)
|
||||
pdu->type = COAP_MESSAGE_CON;
|
||||
|
||||
#if COAP_OSCORE_SUPPORT
|
||||
|
||||
@@ -1435,6 +1435,11 @@ coap_pdu_encode_header(coap_pdu_t *pdu, coap_proto_t proto) {
|
||||
coap_log_warn("coap_pdu_encode_header: corrupted PDU\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* A lot of the reliable code assumes type is CON */
|
||||
if (pdu->type != COAP_MESSAGE_CON)
|
||||
pdu->type = COAP_MESSAGE_CON;
|
||||
|
||||
if (proto == COAP_PROTO_WS || proto == COAP_PROTO_WSS)
|
||||
len = 0;
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user