mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-02 16:05:50 +03:00
In handle_response() the ACK is sent before calling ctx->response_handler() so if the response_handler() wants to send RST the server ignores it as the ACK has already been received. By updating coap_response_handler_t to return a value, this can be used to send the ACK (return of COAP_RESPONSE_OK) or a RST (return of COAP_RESPONSE_FAIL) after ctx->response_handler() is called. include/coap2/net.h: man/coap_handler.txt.in: Create a new enum coap_response_t for use as the return value for coap_response_handler_t. Update coap_response_handler_t and associated documentation. src/net.c: Send CoAP ACK or RST depending on return value of ctx->response_handler(). examples/client.c: Update message_handler() to use the new coap_response_handler_t return values (coap_response_t).