mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-30 22:45:49 +03:00
coap_net.c: For NON responses, use server generated message id
This commit is contained in:
1 parent
0121c25f63
commit
f52fadaa9a
1 file changed
+7
-3
+7
-3
@@ -4017,9 +4017,13 @@ handle_request(coap_context_t *context, coap_session_t *session, coap_pdu_t *pdu
|
||||
goto fail_response;
|
||||
}
|
||||
|
||||
response = coap_pdu_init(pdu->type == COAP_MESSAGE_CON ?
|
||||
COAP_MESSAGE_ACK : COAP_MESSAGE_NON,
|
||||
0, pdu->mid, coap_session_max_pdu_size_lkd(session));
|
||||
if (pdu->type == COAP_MESSAGE_CON) {
|
||||
response = coap_pdu_init(COAP_MESSAGE_ACK, 0, pdu->mid,
|
||||
coap_session_max_pdu_size_lkd(session));
|
||||
} else {
|
||||
response = coap_pdu_init(COAP_MESSAGE_NON, 0, coap_new_message_id_lkd(session),
|
||||
coap_session_max_pdu_size_lkd(session));
|
||||
}
|
||||
if (!response) {
|
||||
coap_log_err("could not create response PDU\n");
|
||||
resp = 500;
|
||||
|
||||
Reference in new issue
Block a user