Skip to content

Commit

Permalink
modules/dispatcher: fixed ds_print_mi_list when a gateway doesn't hav…
Browse files Browse the repository at this point in the history
…e attrs defined

- reported by Luis Azedo
  • Loading branch information
grumvalski committed Feb 18, 2015
1 parent a6510bb commit 848394f
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions modules/dispatcher/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ int add_dest2list(int id, str uri, int flags, int priority, str *attrs,
hostent2ip_addr(&dp->ip_address, he, 0);

/* Copy the port out of the URI */
dp->port = puri.port_no;
dp->port = puri.port_no;
/* Copy the proto out of the URI */
dp->proto = puri.proto;

Expand Down Expand Up @@ -1899,7 +1899,7 @@ int ds_select_dst_limit(sip_msg_t *msg, int set, int alg, unsigned int limit, in
/* add to avp */

for(i=hash-1; i>=0 && cnt<limit; i--)
{
{
if(ds_skip_dst(idx->dlist[i].flags)
|| (ds_use_default!=0 && i==(idx->nr-1)))
continue;
Expand Down Expand Up @@ -1947,7 +1947,7 @@ int ds_select_dst_limit(sip_msg_t *msg, int set, int alg, unsigned int limit, in
}

for(i=idx->nr-1; i>hash && cnt<limit; i--)
{
{
if(ds_skip_dst(idx->dlist[i].flags)
|| (ds_use_default!=0 && i==(idx->nr-1)))
continue;
Expand Down Expand Up @@ -2238,10 +2238,10 @@ int ds_update_state(sip_msg_t *msg, int group, str *address, int state)

/* reset the bits used for states */
idx->dlist[i].flags &= ~(DS_STATES_ALL);

/* we need the initial state for inactive counter */
init_state = state;

if((state & DS_TRYING_DST) && (old_state & DS_INACTIVE_DST))
{
/* old state is inactive, new state is trying => keep it inactive
Expand All @@ -2257,7 +2257,7 @@ int ds_update_state(sip_msg_t *msg, int group, str *address, int state)
} else {
idx->dlist[i].flags |= state;
}

if(state & DS_TRYING_DST)
{
idx->dlist[i].message_count++;
Expand All @@ -2281,7 +2281,7 @@ int ds_update_state(sip_msg_t *msg, int group, str *address, int state)
/* Destination has enough replied messages.. Bringing it to active state */
idx->dlist[i].message_count = 0;
}
}else{
}else{
idx->dlist[i].message_count = 0;
}
}
Expand Down Expand Up @@ -2563,9 +2563,6 @@ int ds_print_mi_list(struct mi_node* rpl)
if(node == NULL)
return -1;

if(attr == 0)
return -1;

memset(&c, 0, sizeof(c));
if (list->dlist[j].flags & DS_INACTIVE_DST)
c[0] = 'I';
Expand Down

0 comments on commit 848394f

Please sign in to comment.