Module: kamailio Branch: master Commit: 772f261f91685583af3db7cee2c227336eef7c42 URL: https://github.com/kamailio/kamailio/commit/772f261f91685583af3db7cee2c22733...
Author: Tyler Moore tmoore@goflyball.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2024-08-01T08:02:09+02:00
htable: add uint support when packing an htable
- add support for packing unsigned integer values from DB, into hash tables.
---
Modified: src/modules/htable/ht_db.c
---
Diff: https://github.com/kamailio/kamailio/commit/772f261f91685583af3db7cee2c22733... Patch: https://github.com/kamailio/kamailio/commit/772f261f91685583af3db7cee2c22733...
---
diff --git a/src/modules/htable/ht_db.c b/src/modules/htable/ht_db.c index 7a22ff6c484..8b0c667411d 100644 --- a/src/modules/htable/ht_db.c +++ b/src/modules/htable/ht_db.c @@ -132,6 +132,8 @@ static int ht_pack_values( len += RES_ROWS(db_res)[row].values[c].val.blob_val.len; } else if(RES_ROWS(db_res)[row].values[c].type == DB1_INT) { len += 12; + } else if(RES_ROWS(db_res)[row].values[c].type == DB1_UINT) { + len += 12; } else { LM_ERR("unsupported data type for column %d\n", c); return -1; @@ -165,6 +167,11 @@ static int ht_pack_values( RES_ROWS(db_res)[row].values[c].val.int_val, &iv.len); strncpy(p, iv.s, iv.len); p += iv.len; + } else if(RES_ROWS(db_res)[row].values[c].type == DB1_UINT) { + iv.s = int2str( + RES_ROWS(db_res)[row].values[c].val.uint_val, &iv.len); + strncpy(p, iv.s, iv.len); + p += iv.len; } if(c + 1 < cols) { *p = ht->pack[1];