From 6aa40cd9fe92bcef7d7be4176724744733b7487a Mon Sep 17 00:00:00 2001 From: Joseph Morrow Date: Mon, 15 Sep 2014 17:02:17 -0400 Subject: [PATCH] Patch 1: Sending RST in response to the receipt of a notification from a server that is not a presence nor an observe notifcation AND there is not a callback associated. Patch 2: Rebase Patch 3: Changed debug print out message. Patch 4: Oops. I had too much message in my log message. Change-Id: If8f949827e9accf0dc45b69a5568960578b388f5 --- csdk/occoap/src/occoap.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/csdk/occoap/src/occoap.c b/csdk/occoap/src/occoap.c index 19dfa3f..af1fdbe 100644 --- a/csdk/occoap/src/occoap.c +++ b/csdk/occoap/src/occoap.c @@ -439,7 +439,13 @@ static void HandleCoAPResponses(struct coap_context_t *ctx, #endif else { - // TODO: we should send a RST here and.. + OC_LOG(INFO, TAG, PCF("Received a response, but I do not have callback. \ + ------------ sending RESET")); + sendPdu = GenerateCoAPPdu(COAP_MESSAGE_RST, 0, + recvPdu->hdr->id, NULL, NULL, NULL); + VERIFY_NON_NULL(sendPdu); + result = SendCoAPPdu(gCoAPCtx, (coap_address_t*) &rcvdResponse->remote, sendPdu, 0); + VERIFY_SUCCESS(result, OC_STACK_OK); } exit: OCFree(rcvObserveOption); -- 2.7.4