From 00beb7f1f770f599524dc5967cc9ebd6608a8a8c Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 16 Jan 2015 09:19:58 +0100 Subject: [PATCH] (regroup coap_handle_message code to have pdu handling in one place) --- net.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net.c b/net.c index 1d0c28ea..758d0374 100644 --- a/net.c +++ b/net.c @@ -869,16 +869,16 @@ coap_handle_message(coap_context_t *ctx, goto error; } - coap_ticks(&node->t); - - coap_packet_populate_endpoint(packet, &node->local_if); - coap_packet_copy_source(packet, &node->remote); - if (!coap_pdu_parse(msg, msg_len, node->pdu)) { warn("discard malformed PDU"); goto error; } + coap_ticks(&node->t); + + coap_packet_populate_endpoint(packet, &node->local_if); + coap_packet_copy_source(packet, &node->remote); + /* and add new node to receive queue */ coap_transaction_id(&node->remote, node->pdu, &node->id);