Module: kamailio Branch: master Commit: 577fb11010ff61af3c4b567581c0bbc5404654c8 URL: https://github.com/kamailio/kamailio/commit/577fb11010ff61af3c4b567581c0bbc5...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2024-01-09T14:07:18+01:00
htable: read rpc number value as long
- remove autoconvert for number, it is only for string values - GH #3674
---
Modified: src/modules/htable/htable.c
---
Diff: https://github.com/kamailio/kamailio/commit/577fb11010ff61af3c4b567581c0bbc5... Patch: https://github.com/kamailio/kamailio/commit/577fb11010ff61af3c4b567581c0bbc5...
---
diff --git a/src/modules/htable/htable.c b/src/modules/htable/htable.c index 5c682972f0c..0fcd280de9c 100644 --- a/src/modules/htable/htable.c +++ b/src/modules/htable/htable.c @@ -1673,7 +1673,8 @@ static void htable_rpc_seti(rpc_t *rpc, void *c) int_str keyvalue; ht_t *ht;
- if(rpc->scan(c, "SS.d", &htname, &keyname, &keyvalue.n) < 3) { + keyvalue.n = 0; + if(rpc->scan(c, "SSl", &htname, &keyname, &keyvalue.n) < 3) { rpc->fault(c, 500, "Not enough parameters (htable name, key name and value)"); return; @@ -1710,7 +1711,7 @@ static void htable_rpc_setex(rpc_t *rpc, void *c) int exval; ht_t *ht;
- if(rpc->scan(c, "SS.d", &htname, &itname, &exval) < 3) { + if(rpc->scan(c, "SSd", &htname, &itname, &exval) < 3) { rpc->fault(c, 500, "Not enough parameters (htable name, item name and expire)"); return; @@ -1761,10 +1762,10 @@ static void htable_rpc_setxs(rpc_t *rpc, void *c) static void htable_rpc_setxi(rpc_t *rpc, void *c) { str htname, keyname; - int ival; + int ival = 0; int exval;
- if(rpc->scan(c, "SS.dd", &htname, &keyname, &ival, &exval) < 4) { + if(rpc->scan(c, "SSdd", &htname, &keyname, &ival, &exval) < 4) { rpc->fault(c, 500, "Not enough parameters (htable name, key name, value and " "expire)");