From 1844539d01f2e879be4966dc76a444d2a06e575c Mon Sep 17 00:00:00 2001 From: Ionut Ionita Date: Thu, 9 Oct 2014 17:22:06 +0300 Subject: [PATCH] fixed dispatcher failover when max results not specified --- modules/dispatcher/ds_fixups.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/dispatcher/ds_fixups.c b/modules/dispatcher/ds_fixups.c index 7cbf2006041..bd6514c010f 100644 --- a/modules/dispatcher/ds_fixups.c +++ b/modules/dispatcher/ds_fixups.c @@ -683,6 +683,11 @@ int ds_select_fixup(void** param, int param_no) LM_ERR("Cannot fixup flags\n"); return -1; } + + /* Trim whitespaces if exist */ + while (((char*)(*param))[0] == ' ') + (*param)++; + /*Fixing max_results list*/ if (((char *)(*param))[0] != '\0') { rc = fixup_int_list(param); @@ -690,11 +695,14 @@ int ds_select_fixup(void** param, int param_no) LM_ERR("Cannot fixup list\n"); return -1; } + result->list = (int_list_t*)(*param); + } else { + result->list = NULL; } result->flags = flags; - result->list = (int_list_t*)(*param); *param = result; + return 0; }