Module: sip-router Branch: 3.3 Commit: 7795ef185365eab558ed2c98e8d995f47fa823bb URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7795ef18...
Author: Peter Dunkley peter.dunkley@crocodile-rcs.com Committer: Peter Dunkley peter.dunkley@crocodile-rcs.com Date: Fri Aug 3 14:38:49 2012 +0100
modules_k/dispatcher: Dispatcher reload MI command not returning errors correctly
- Fix by Hugh Waite @ Crocodile RCS (cherry picked from commit 5c83492470e8d1a706933915fcfbf6cfe2e0fd55)
---
modules_k/dispatcher/dispatch.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/modules_k/dispatcher/dispatch.c b/modules_k/dispatcher/dispatch.c index 7429e97..cc8b7bf 100644 --- a/modules_k/dispatcher/dispatch.c +++ b/modules_k/dispatcher/dispatch.c @@ -678,6 +678,11 @@ int init_ds_db(void) }
ret = ds_load_db(); + if (ret == -2) + { + LM_WARN("failure while loading one or more dispatcher entries\n"); + ret = 0; + }
ds_disconnect_db();
@@ -691,6 +696,7 @@ int ds_load_db(void) int flags; int priority; int nrcols; + int dest_errs = 0; str uri; str attrs = {0, 0}; db1_res_t * res; @@ -764,17 +770,20 @@ int ds_load_db(void) } if(add_dest2list(id, uri, flags, priority, &attrs, *next_idx, &setn) != 0) + { + dest_errs++; LM_WARN("unable to add destination %.*s to set %d -- skipping\n", uri.len, uri.s, id); + } } - ds_dbf.free_result(ds_db_handle, res); - if(reindex_dests(*next_idx, setn)!=0) { LM_ERR("error on reindex\n"); goto err2; }
+ ds_dbf.free_result(ds_db_handle, res); + /* update data - should it be sync'ed? */ _ds_list_nr = setn; *crt_idx = *next_idx; @@ -782,6 +791,8 @@ int ds_load_db(void)
ds_print_sets();
+ if (dest_errs > 0) + return -2; return 0;
err2: