mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-05 17:32:54 +03:00
coap_proxy.c: Correct returning responses match
Correctly match proxy_entry against session when checking unpstream response when there are multiple proxy entries.
This commit is contained in:
1 parent
742eeff3ce
commit
6f4c8b68de
1 file changed
+9
-6
+9
-6
@@ -810,15 +810,18 @@ coap_proxy_forward_response_lkd(coap_session_t *session,
|
||||
|
||||
for (i = 0; i < proxy_list_count; i++) {
|
||||
proxy_entry = &proxy_list[i];
|
||||
for (j = 0; j < proxy_entry->req_count; j++) {
|
||||
if (coap_binary_equal(&rcv_token, proxy_entry->req_list[j].token_used)) {
|
||||
proxy_req = &proxy_entry->req_list[j];
|
||||
if (proxy_entry->ongoing == session) {
|
||||
for (j = 0; j < proxy_entry->req_count; j++) {
|
||||
if (coap_binary_equal(&rcv_token, proxy_entry->req_list[j].token_used)) {
|
||||
proxy_req = &proxy_entry->req_list[j];
|
||||
coap_ticks(&proxy_entry->last_used);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j != proxy_entry->req_count) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j != proxy_entry->req_count) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == proxy_list_count) {
|
||||
coap_log_warn("Unknown proxy ongoing session response received\n");
|
||||
|
||||
Reference in new issue
Block a user