Module: kamailio
Branch: master
Commit: 9326cff7f67604a27049ee1cae0c9a5b965efd9d
URL: 
https://github.com/kamailio/kamailio/commit/9326cff7f67604a27049ee1cae0c9a5b965efd9d

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2023-05-10T13:34:32+02:00

htable: use long types for expires operations

---

Modified: src/modules/htable/ht_api.c
Modified: src/modules/htable/ht_db.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/9326cff7f67604a27049ee1cae0c9a5b965efd9d.diff
Patch: 
https://github.com/kamailio/kamailio/commit/9326cff7f67604a27049ee1cae0c9a5b965efd9d.patch

---

diff --git a/src/modules/htable/ht_api.c b/src/modules/htable/ht_api.c
index 13e29ae5cd..432d224aab 100644
--- a/src/modules/htable/ht_api.c
+++ b/src/modules/htable/ht_api.c
@@ -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
@@ -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);
diff --git a/src/modules/htable/ht_db.c b/src/modules/htable/ht_db.c
index db2a52ce8b..2b2eb25bfd 100644
--- a/src/modules/htable/ht_db.c
+++ b/src/modules/htable/ht_db.c
@@ -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;
 
@@ -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++)
                {

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to