Suppress RST when the processing of a non-empty ACK fails

This commit is contained in:
kkrentz authored and Jon Shallow committed 2023-10-19 15:00:24 +01:00
1 parent bb1a635707
commit 6addbef1b1
2 files changed
+4 -3

No files matched your search

+1 -1
View File
@@ -57,7 +57,7 @@ typedef enum coap_response_t {
* @param mid CoAP transaction ID.
* @return @c COAP_RESPONSE_OK if successful, else @c COAP_RESPONSE_FAIL which
* triggers sending a RST packet.
* triggers sending a RST packet if the received PDU is a CON or NON.
*/
typedef coap_response_t (*coap_response_handler_t)(coap_session_t *session,
const coap_pdu_t *sent,
+3 -2
View File
@@ -3406,8 +3406,9 @@ handle_response(coap_context_t *context, coap_session_t *session,
/* Call application-specific response handler when available. */
if (context->response_handler) {
if (context->response_handler(session, sent, rcvd,
rcvd->mid) == COAP_RESPONSE_FAIL)
if ((context->response_handler(session, sent, rcvd,
rcvd->mid) == COAP_RESPONSE_FAIL) &&
(rcvd->type != COAP_MESSAGE_ACK))
coap_send_rst(session, rcvd);
else
coap_send_ack(session, rcvd);