mirror of
https://github.com/obgm/libcoap.git
synced 2026-12-05 20:02:19 +03:00
Proxy: Add in support for multiplexing Observe requests
Add in limited caching for multiple clients requesting an Observe subscription for the same upstream session resource so that only a single observation request is sent upstream and any unsolicited response is sent back to all the requesting clients. This requires a change in the recently added handler registered to coap_register_proxy_response_handler(), which no longer should no longer call coap_proxy_forward_response(), but just return a PDU for forwarding on.
This commit is contained in:
1 parent
2e8decf756
commit
daa4e05e18
15 files changed
+629
-162
No files matched your search
@@ -360,18 +360,19 @@ nack_handler(coap_session_t *session COAP_UNUSED,
|
||||
coap_bin_const_t token = coap_pdu_get_token(sent);
|
||||
|
||||
if (coap_pdu_get_code(sent) != COAP_EMPTY_CODE && !track_check_token(&token)) {
|
||||
coap_log_err("nack_handler: Unexpected token\n");
|
||||
coap_show_pdu(0, sent);
|
||||
coap_log_err("nack_handler: %d: Unexpected token\n", reason);
|
||||
}
|
||||
}
|
||||
|
||||
switch (reason) {
|
||||
case COAP_NACK_NOT_DELIVERABLE:
|
||||
case COAP_NACK_TLS_FAILED:
|
||||
case COAP_NACK_TOO_MANY_RETRIES:
|
||||
coap_log_err("cannot send CoAP pdu\n");
|
||||
if (!reconnect_secs)
|
||||
quit = 1;
|
||||
break;
|
||||
case COAP_NACK_TOO_MANY_RETRIES:
|
||||
case COAP_NACK_WS_FAILED:
|
||||
case COAP_NACK_TLS_LAYER_FAILED:
|
||||
case COAP_NACK_WS_LAYER_FAILED:
|
||||
|
||||
Reference in new issue
Block a user