whosgonna created an issue (kamailio/kamailio#4283)
### Description
Using function `sht_setxi()` causes the script to exit and stop processing messages. Using the example from the documention:
``` #!KAMAILIO
loadmodule "pv" loadmodule "ctl" loadmodule "htable" loadmodule "xlog"
modparam("htable", "htable", "ha=>size=4");
request_route { xnotice("Request received [$ru]\n"); ## this prints
sht_setxi("ha", "test", "100", "10"); ## exactly as documented
xnotice("log line after sht_setxi()\n"); ## This does not print. } ```
### Troubleshooting
As shown above. Note that the similar function `sht_setxs()` (for setting string values) works as expected.
#### Reproduction
Trivial to reproduce.
#### SIP Traffic
Tested from localhost with `sipsak -s sip:127.0.0.1`, but any message seems to do this.
### Possible Solutions
I believe that the issue is in [`/src/modules/htable/htable.c`](/src/modules/htable/htable.c) within function `static int ki_ht_setxi()` where the return is `0` (last line in the function). I'm guessing it should return `1`, like ``static int ki_ht_setxs()` (sting function equivilent)
### Additional Information
Tested in 6.0.1 and 5.8.5
``` version: kamailio 6.0.1 (x86_64/linux) flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: unknown compiled with gcc 12.2.0 ```
```
```
* **Operating System**:
<!-- Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...; Kernel details (output of `lsb_release -a` and `uname -a`) -->
``` version: kamailio 5.8.5 (x86_64/linux) flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: unknown compiled on 19:38:35 Jan 30 2025 with gcc 14.2.0 ```
miconda left a comment (kamailio/kamailio#4283)
I pushed a fix for it in git master branch, to be backported. Reopen if still an issue.
Closed #4283 as completed.