proxy: Make proxy requests separate responses

As an incoming proxy request may delay its response (e.g. initiate an
ongoing connection), send back empty ACK immediately so that the
client does not timeout and re-transmit the request.

Do not process duplicated (i.e. re-transmitted) proxy requests.

Correct a couple of typos in example proxy code.
This commit is contained in:
Jon Shallow authored and obgm committed 2022-07-25 12:47:18 +02:00
1 parent 98ecf5a2a1
commit d2306569d1
2 files changed
+32 -2

No files matched your search

+2 -2
View File
@@ -1110,7 +1110,7 @@ hnd_proxy_uri(coap_resource_t *resource COAP_UNUSED,
*/
pdu = coap_pdu_init(req_type, req_code,
coap_new_message_id(ongoing),
coap_session_max_pdu_size(session));
coap_session_max_pdu_size(ongoing));
if (!pdu) {
coap_pdu_set_code(response, COAP_RESPONSE_CODE_INTERNAL_ERROR);
goto cleanup;
@@ -1208,7 +1208,7 @@ add_in:
coap_delete_optlist(optlist);
if (size) {
if (!coap_add_data_large_request(session, pdu, size, data,
if (!coap_add_data_large_request(ongoing, pdu, size, data,
release_proxy_body_data, body_data)) {
coap_log(LOG_DEBUG, "cannot add data to proxy request\n");
}