Skip to content

Commit

Permalink
qrouting: Clean up mod_init code
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu authored and razvancrainea committed Feb 11, 2020
1 parent ddda4c6 commit a073d5f
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 133 deletions.
2 changes: 1 addition & 1 deletion modules/qrouting/qr_sort.c
Expand Up @@ -230,7 +230,7 @@ void qr_sort(void *param)
dst_id = srp->dst_id;


if(*n_sampled < *qr_n) { /* we don't have enough statistics to sort */
if(*n_sampled < qr_n) { /* we don't have enough statistics to sort */
if(dst_id == (unsigned short)-1) {
for(i = 0; i < rule->n ; i++)
us_sorted_dst[i] = i; /* unordered list for destinations
Expand Down
4 changes: 2 additions & 2 deletions modules/qrouting/qr_stats.c
Expand Up @@ -36,7 +36,7 @@
#include "qr_acc.h"


qr_rule_t ** qr_rules_start = NULL;
qr_rule_t **qr_rules_start;


/* create the samples for a gateway's history */
Expand All @@ -49,7 +49,7 @@ qr_sample_t * create_history(void) {
LM_ERR("no more shm_memory\n");
return NULL;
}
for(tmp = history, i = 0; i < *qr_n-1; tmp = tmp->next, ++i) {
for(tmp = history, i = 0; i < qr_n-1; tmp = tmp->next, ++i) {
tmp->next = (qr_sample_t*)shm_malloc(sizeof(qr_sample_t));
if(tmp->next == NULL)
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion modules/qrouting/qr_stats.h
Expand Up @@ -41,7 +41,7 @@
#define MIN_DEST 4


extern int* qr_n; /* number of intervals in history */
extern int qr_n; /* number of intervals in history */
extern int* n_sampled;

/* number of calls accounted for each statistic */
Expand Down

0 comments on commit a073d5f

Please sign in to comment.