Skip to content

Commit

Permalink
Just code identation.
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan-iancu committed Feb 17, 2016
1 parent 23155e5 commit 330dfae
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions modules/registrar/save.c
Expand Up @@ -570,14 +570,15 @@ static inline int update_contacts(struct sip_msg* _m, urecord_t* _r,
if (_sctx->flags&REG_SAVE_FORCE_REG_FLAG) {
/* we are overflowing the number of maximum contacts,
so remove the oldest valid one to prevent this */
for( c_it=_r->contacts,c_last=NULL ; c_it ; c_it=c_it->next )
for(c_it=_r->contacts,c_last=NULL ; c_it ; c_it=c_it->next)
if (VALID_CONTACT(c_it, act_time)) c_last=c_it;
if (c_last==NULL) {
LM_CRIT("BUG - overflow detected but no valid contacts found :( \n");
LM_CRIT("BUG - overflow detected but no valid "
"contacts found :( \n");
goto error;
}
LM_DBG("overflow on inserting new contact -> removing <%.*s>\n",
c_last->c.len, c_last->c.s);
LM_DBG("overflow on inserting new contact -> "
"removing <%.*s>\n", c_last->c.len, c_last->c.s);
if (ul.delete_ucontact( _r, c_last, 0)!=0) {
LM_ERR("failed to remove contact\n");
goto error;
Expand Down Expand Up @@ -619,23 +620,27 @@ static inline int update_contacts(struct sip_msg* _m, urecord_t* _r,
}
} else {
/* do update */
/* if the contact to be updated is not valid, it will be after update, so need
* to compensate the total number of contact */
/* if the contact to be updated is not valid, it will be
* after update, so need to compensate the total number
* of contact */
if ( !VALID_CONTACT(c,act_time) )
num++;
while ( _sctx->max_contacts && num>_sctx->max_contacts ) {
if (_sctx->flags&REG_SAVE_FORCE_REG_FLAG) {
/* we are overflowing the number of maximum contacts,
so remove the first (oldest) one to prevent this (but not the one
to be updated !) */
for( c_it=_r->contacts,c_last=NULL ; c_it ; c_it=c_it->next )
if (VALID_CONTACT(c_it, act_time) && c_it!=c) c_last=c_it;
so remove the first (oldest) one to prevent this
(but not the one to be updated !) */
c_last = NULL;
for( c_it=_r->contacts ; c_it ; c_it=c_it->next )
if (VALID_CONTACT(c_it, act_time) && c_it!=c)
c_last=c_it;
if (c_last==NULL) {
LM_CRIT("BUG - overflow detected but no valid contacts found :( \n");
LM_CRIT("BUG - overflow detected but "
"no valid contacts found :( \n");
goto error;
}
LM_DBG("overflow on update -> removing contact <%.*s>\n",
c_last->c.len, c_last->c.s);
LM_DBG("overflow on update -> removing contact "
"<%.*s>\n", c_last->c.len, c_last->c.s);
if (ul.delete_ucontact( _r, c_last, 0)!=0) {
LM_ERR("failed to remove contact\n");
goto error;
Expand Down

0 comments on commit 330dfae

Please sign in to comment.