coap_send: Do not block on first send when testing for additional support

The first coap_send(pdu) is held back until after the optional tests for
Extended Token or Q-Block support are complete with the return from coap_send()
containing the held back pdu's mid.

If there are any errors with this PDU when subsequentially sent, the
event COAP_EVENT_FIRST_PDU_FAIL gets raised.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2025-12-19 17:03:33 +00:00
1 parent bcee6f7149
commit 19f1d78848
12 files changed
+228 -57

No files matched your search

+4
View File
@@ -373,6 +373,10 @@ event_handler(coap_session_t *session COAP_UNUSED,
case COAP_EVENT_BAD_PACKET:
quit = 1;
break;
case COAP_EVENT_FIRST_PDU_FAIL:
quit = 1;
coap_log_err("cannot send CoAP pdu\n");
break;
case COAP_EVENT_SERVER_SESSION_CONNECTED:
#if COAP_SERVER_SUPPORT
call_home_session = session;
+1
View File
@@ -1047,6 +1047,7 @@ proxy_event_handler(coap_session_t *session COAP_UNUSED,
case COAP_EVENT_SERVER_SESSION_CONNECTED:
case COAP_EVENT_BAD_PACKET:
case COAP_EVENT_MSG_RETRANSMITTED:
case COAP_EVENT_FIRST_PDU_FAIL:
case COAP_EVENT_WS_CONNECTED:
case COAP_EVENT_KEEPALIVE_FAILURE:
case COAP_EVENT_RECONNECT_FAILED: