Skip to content

Commit

Permalink
Merge pull request #847 from mrdeep1/async_con
Browse files Browse the repository at this point in the history
net.c: Make sure separate response is CON for CON requests
  • Loading branch information
obgm authored May 11, 2022
2 parents cfbf3ab + f280443 commit 50128de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -2875,6 +2875,11 @@ handle_request(coap_context_t *context, coap_session_t *session, coap_pdu_t *pdu
? COAP_MESSAGE_ACK
: COAP_MESSAGE_NON,
0, pdu->mid, coap_session_max_pdu_size(session));
#ifndef WITHOUT_ASYNC
/* If handling a separate response, need CON, not ACK response */
if (async && pdu->type == COAP_MESSAGE_CON)
response->type = COAP_MESSAGE_CON;
#endif /* WITHOUT_ASYNC */

/* Implementation detail: coap_add_token() immediately returns 0
if response == NULL */
Expand Down

0 comments on commit 50128de

Please sign in to comment.