[sr-dev] Using htable module while developing other modules

Henning Westerholt hw at kamailio.org
Sat Feb 23 23:49:17 CET 2019


Am Samstag, 23. Februar 2019, 12:42:28 CET schrieb Mojtaba:
> According to previous my question about udsing htable module as
> dependencies module in other modules (Actually i mean hiops module), i want
> to have some changes in my code. Already i saved some data in cache memory
> that is implemented via linked_list structure in module, i want to replace
> them with htable module.
> So i have to load htable module and some more extra works, all things are
> straightforward. But when i have more dived into htable module (api.c,
> ht_api.c files), there is no function to get the value of specific key.
> there is  "ht_api_get_cell_expire_f" function that it just get back the
> expire time, no value of key.
> Now I need a function that it  return the value of key also, Could i add
> this function in api.c and ht_api.c  source files and commit it or not?
> If there is already the function like this, let me know about it?
> Let me know about it?

Hello Mojtaba,

the htable API could be extended if necessary. So you propose a 
ht_api_get_cell" API function binding? The proper way to add this to the 
htable module would be with a pull request, that the author can have a look 
and it can be reviewed and maybe adapted before integration.

I looked in the API, there is no function like this right now:

typedef struct htable_api {
    ht_api_set_cell_f set;
    ht_api_del_cell_f rm;
    ht_api_set_cell_expire_f set_expire;
    ht_api_get_cell_expire_f get_expire;
    ht_api_rm_cell_re_f rm_re;
    ht_api_count_cells_re_f count_re;
} htable_api_t;

Best regards,

Henning

-- 
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services
Kamailio security assessment - https://skalatan.de/de/assessment



More information about the sr-dev mailing list