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)
  • Loading branch information
liviuchircu committed Jul 8, 2020
1 parent 67c0662 commit 419f011
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions modules/dispatcher/dispatcher.c
Expand Up @@ -97,16 +97,16 @@ 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, 0},
{NULL, -1},
{NULL, -1},
{NULL, -1},
{NULL, -1},
{NULL, -1},
{NULL, -1},
NULL
};
ds_db_head_t *ds_db_heads = NULL;
Expand Down Expand Up @@ -758,7 +758,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 419f011

Please sign in to comment.