Skip to content

Commit

Permalink
[mid-registrar/registrar] fix setting default max_contacts
Browse files Browse the repository at this point in the history
Be sure max_contacts global limit is set even when there are no flags passed to hte save() function.

Credits go to John Burke / @john08burke
Closes #2727

(cherry picked from commit 1aa6aa2)
  • Loading branch information
bogdan-iancu committed Jan 18, 2022
1 parent 6a3cd78 commit a1a0f6d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions lib/reg/save_flags.c
Expand Up @@ -29,9 +29,6 @@ void reg_parse_save_flags(str *flags_s, struct save_ctx *sctx)
static str_list mp;
int st, max_ct;

sctx->cmatch.mode = CT_MATCH_NONE;
sctx->max_contacts = max_contacts;

for( st=0 ; st< flags_s->len ; st++ ) {
switch (flags_s->s[st]) {
case 'm': sctx->flags |= REG_SAVE_MEMORY_FLAG; break;
Expand Down
1 change: 1 addition & 0 deletions modules/mid_registrar/save.c
Expand Up @@ -2528,6 +2528,7 @@ int mid_reg_save(struct sip_msg *msg, udomain_t *d, str *flags_str,
rerrno = R_FINE;
memset(&sctx, 0, sizeof sctx);
sctx.cmatch.mode = CT_MATCH_NONE;
sctx.max_contacts = max_contacts;

LM_DBG("saving to %.*s...\n", d->name->len, d->name->s);

Expand Down
1 change: 1 addition & 0 deletions modules/registrar/save.c
Expand Up @@ -627,6 +627,7 @@ int save_aux(struct sip_msg* _m, str* forced_binding, void* _d, str* flags_s,
sctx.cmatch.mode = CT_MATCH_NONE;
sctx.min_expires = min_expires;
sctx.max_expires = max_expires;
sctx.max_contacts = max_contacts;
if ( flags_s )
reg_parse_save_flags( flags_s, &sctx);

Expand Down

0 comments on commit a1a0f6d

Please sign in to comment.