mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
gcoap: Cleanup around empty responses
Simplify the code path and give consistent debug messages.
This commit is contained in:
parent
ff00d66d69
commit
0a2f97680f
@ -170,11 +170,9 @@ static void _on_sock_evt(sock_udp_t *sock, sock_async_flags_t type, void *arg)
|
||||
/* ping request */
|
||||
if (coap_get_type(&pdu) == COAP_TYPE_CON) {
|
||||
messagelayer_emptyresponse_type = COAP_TYPE_RST;
|
||||
} else if (coap_get_type(&pdu) == COAP_TYPE_NON) {
|
||||
DEBUG("gcoap: empty NON msg\n");
|
||||
}
|
||||
else {
|
||||
goto empty_as_response;
|
||||
DEBUG("gcoap: Answering empty CON request with RST\n");
|
||||
} else {
|
||||
DEBUG("gcoap: Ignoring empty non-CON request\n");
|
||||
}
|
||||
}
|
||||
/* normal request */
|
||||
@ -195,10 +193,6 @@ static void _on_sock_evt(sock_udp_t *sock, sock_async_flags_t type, void *arg)
|
||||
}
|
||||
break;
|
||||
|
||||
empty_as_response:
|
||||
DEBUG("gcoap: empty ack/reset not handled yet\n");
|
||||
return;
|
||||
|
||||
/* incoming response */
|
||||
case COAP_CLASS_SUCCESS:
|
||||
case COAP_CLASS_CLIENT_FAILURE:
|
||||
|
Loading…
Reference in New Issue
Block a user