Skip to content

Commit

Permalink
dispatcher: Fix a bug with the 'default' partition
Browse files Browse the repository at this point in the history
This commit allows the "default" partition to be populated just like the
other ones:

modparam("dispatcher", "partition",
    "default:
            db_url = mysql://opensips:opensipsrw@127.0.0.1/opensips_3_2;
            table_name = v1_dispatcher")

(cherry picked from commit cc2f4a8)
(cherry picked from commit 419f011)
(cherry picked from commit 1f14390)
  • Loading branch information
liviuchircu committed Nov 4, 2020
1 parent 37abcc3 commit 53bec0c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/dispatcher/dispatcher.c
Expand Up @@ -109,15 +109,15 @@ typedef struct _ds_db_head

ds_db_head_t default_db_head = {
str_init(DS_DEFAULT_PARTITION_NAME),
{NULL, 0},
{NULL, 0},
{NULL, -1},
{NULL, -1},


{NULL, 0},
{NULL, 0},
{NULL, 0},
{NULL, 0},
{NULL, 0},
{NULL, -1},
{NULL, -1},
{NULL, -1},
{NULL, -1},
{NULL, -1},
NULL
};
ds_db_head_t *ds_db_heads = NULL;
Expand Down Expand Up @@ -708,7 +708,7 @@ void set_default_head_values(ds_db_head_t *head)
str *p_val = partition_params[i].getter_func(head);
if (p_val->s == NULL)
*p_val = partition_params[i].default_value;
else
else if (p_val->len == -1)
p_val->len = strlen(p_val -> s);
}
}
Expand Down

0 comments on commit 53bec0c

Please sign in to comment.