From fbdfa9e4b51f842558dca223346cdabffc7b5925 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Wed, 7 Mar 2012 21:47:38 +0100 Subject: [PATCH] bugfix Do not acknowledge responses to NON-confirmable requests, instead response is NON-confirmable as well. --- net.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net.c b/net.c index 44ff4ff2..422ae3bc 100644 --- a/net.c +++ b/net.c @@ -794,7 +794,10 @@ wellknown_response(coap_context_t *context, coap_pdu_t *request) { size_t len; unsigned char buf[2]; - resp = coap_pdu_init(COAP_MESSAGE_ACK, COAP_RESPONSE_CODE(205), + resp = coap_pdu_init(request->hdr->type == COAP_MESSAGE_CON + ? COAP_MESSAGE_ACK + : COAP_MESSAGE_NON, + COAP_RESPONSE_CODE(205), request->hdr->id, COAP_MAX_PDU_SIZE); if (!resp) return NULL;