mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-03 00:15:49 +03:00
Suppress RST when the processing of a non-empty ACK fails
This commit is contained in:
1 parent
bb1a635707
commit
6addbef1b1
2 files changed
+4
-3
No files matched your search
@@ -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
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user