Module: kamailio
Branch: 5.2
Commit: 1caa08e1a3052ed08ec5dc4cf32c14f292e1a823
URL:
https://github.com/kamailio/kamailio/commit/1caa08e1a3052ed08ec5dc4cf32c14f…
Author: Alex Hermann <alex(a)hexla.nl>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2019-02-05T21:26:07+01:00
dispatcher: Stop searching if entry is found
(cherry picked from commit 7a66f44506e4897fef68b5ff927cf276678d3473)
---
Modified: src/modules/dispatcher/dispatch.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1caa08e1a3052ed08ec5dc4cf32c14f…
Patch:
https://github.com/kamailio/kamailio/commit/1caa08e1a3052ed08ec5dc4cf32c14f…
---
diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c
index 5d72f71686..621aca823a 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -2523,7 +2523,6 @@ int ds_update_latency(int group, str *address, int code)
int ds_get_state(int group, str *address)
{
int i = 0;
- int state = 0;
ds_set_t *idx = NULL;
if(_ds_list == NULL || _ds_list_nr <= 0) {
@@ -2542,11 +2541,11 @@ int ds_get_state(int group, str *address)
&& strncasecmp(idx->dlist[i].uri.s, address->s, address->len)
== 0) {
/* destination address found */
- state = idx->dlist[i].flags;
+ return idx->dlist[i].flags;
}
i++;
}
- return state;
+ return 0;
}
/**