Skip to content

Commit

Permalink
acc: proper value for double representation of time for db accouting …
Browse files Browse the repository at this point in the history
…on 32b

(cherry picked from commit 4fe259a)
(cherry picked from commit a5866ef)
  • Loading branch information
miconda committed Jun 29, 2016
1 parent 28aefd8 commit 52077b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/acc/acc.c
Expand Up @@ -443,6 +443,7 @@ int acc_db_request( struct sip_msg *rq)
int i;
int o;
struct tm *t;
double dtime;

/* formated database columns */
m = core2strar( rq, val_arr, int_arr, type_arr );
Expand All @@ -458,8 +459,9 @@ int acc_db_request( struct sip_msg *rq)
VAL_INT(db_vals+(m++)) = (int)acc_env.tv.tv_usec;
i++;
} else if(acc_time_mode==2) {
VAL_DOUBLE(db_vals+(m++)) = ((double)(acc_env.tv.tv_sec * 1000)
+ (acc_env.tv.tv_usec / 1000)) / 1000;
dtime = (double)acc_env.tv.tv_usec;
dtime = (dtime / 1000000) + (double)acc_env.tv.tv_sec;
VAL_DOUBLE(db_vals+(m++)) = dtime;
i++;
} else if(acc_time_mode==3 || acc_time_mode==4) {
if(acc_time_mode==3) {
Expand Down

0 comments on commit 52077b5

Please sign in to comment.