Skip to content

Commit

Permalink
htable: use long types for expires operations
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed May 10, 2023
1 parent 35e2796 commit 9326cff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/modules/htable/ht_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,8 @@ int ht_dbg(void)
while(it)
{
LM_ERR("\tcell: %.*s\n", it->name.len, it->name.s);
LM_ERR("\thid: %u msize: %u flags: %d expire: %u\n", it->cellid,
it->msize, it->flags, (unsigned int)it->expire);
LM_ERR("\thid: %u msize: %u flags: %d expire: %llu\n", it->cellid,
it->msize, it->flags, (unsigned long long)it->expire);
if(it->flags&AVP_VAL_STR)
LM_ERR("\tv-s:%.*s\n", it->value.s.len, it->value.s.s);
else
Expand Down Expand Up @@ -1268,7 +1268,7 @@ int ht_set_cell_expire(ht_t *ht, str *name, int type, int_str *val)
now = 0;
if(val->n>0)
now = time(NULL) + val->n;
LM_DBG("set auto-expire to %u (%ld)\n", (unsigned int)now,
LM_DBG("set auto-expire to %llu (%ld)\n", (unsigned long long)now,
val->n);

ht_slot_lock(ht, idx);
Expand Down
4 changes: 2 additions & 2 deletions src/modules/htable/ht_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ int ht_db_load_table(ht_t *ht, str *dbtable, int mode)
int i;
int ret;
int cnt;
int now;
long now;
int ncols;
int c;

Expand Down Expand Up @@ -272,7 +272,7 @@ int ht_db_load_table(ht_t *ht, str *dbtable, int mode)
pname.s = "";
n = 0;
last_ktype = 0;
now = (int)time(NULL);
now = (long)time(NULL);
do {
for(i=0; i<RES_ROW_N(db_res); i++)
{
Expand Down

0 comments on commit 9326cff

Please sign in to comment.