提交 51fe9628 authored 作者: Rupa Schomaker's avatar Rupa Schomaker

FS-3676 --resolve mod_lcr - convert assert to log and fix check condition

上级 5ffcb8ac
...@@ -626,6 +626,8 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa ...@@ -626,6 +626,8 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa
if (!argv[i] || zstr(argv[i])) { if (!argv[i] || zstr(argv[i])) {
/* maybe we want to consider saying which carriers have null rate fields... maybe they can run the query and find out */ /* maybe we want to consider saying which carriers have null rate fields... maybe they can run the query and find out */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "rate field is null, skipping\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "rate field is null, skipping\n");
/* kill prev/next pointers */
/* additional->prev = NULL; */
goto end; goto end;
} }
additional->rate = (float)atof(switch_str_nil(argv[i])); additional->rate = (float)atof(switch_str_nil(argv[i]));
...@@ -750,8 +752,16 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa ...@@ -750,8 +752,16 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa
/* lcr was not added to any lists, so destroy lcr object here */ /* lcr was not added to any lists, so destroy lcr object here */
if (lcr_skipped == SWITCH_TRUE) { if (lcr_skipped == SWITCH_TRUE) {
/* ensure we didn't accidentally add additional to the list */ /* complain loudly if we're asked to destroy a route that is
switch_assert(additional->prev == NULL && current->next != additional); added to the route list */
if (additional && additional->prev != NULL) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
"additional->prev != NULL\n");
}
if (current && current->next == additional) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
"current->next == additional\n");
}
lcr_destroy(additional); lcr_destroy(additional);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论