[sr-dev] Re: [kamailio/kamailio] core/resolve: Check dns_cache_init and choose appropriate functions (PR #3858)
Merged #3858 into master. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3858#event-13033452964 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] core/resolve: Check dns_cache_init and choose appropriate functions (PR #3858)
Thanks, merging! -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3858#issuecomment-2147088159 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] core/resolve: Check dns_cache_init and choose appropriate functions (PR #3858)
@xkaraman: fine to merge it from my point of view, thanks! -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3858#issuecomment-2146991340 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] core/resolve: Check dns_cache_init and choose appropriate functions (PR #3858)
@xkaraman pushed 1 commit. 0275d334c5b25548e92c40bb981540e2ec61d986 core/resolve: Check dns_cache_init and choose appropriate functions -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3858/files/ce47096d86bdf9379091d0a48676763d9b249a83..0275d334c5b25548e92c40bb981540e2ec61d986 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] core/resolve: Check dns_cache_init and choose appropriate functions (PR #3858)
@xkaraman commented on this pull request. > @@ -1833,6 +1847,23 @@ ip_addr_t *str2ip(str *st) return ipb; } +struct hostent *__resolvehost(char *name) +{ + if(dns_cache_init) { + return dns_resolvehost(name); + } else { + return _resolvehost(name); + } +} + +struct hostent *__sip_resolvehost(str *name, unsigned short *port, char *proto) +{ + if(dns_cache_init) { + return dns_sip_resolvehost(name, port, proto); + } else { True, both way are valid though. I think it's clearer with the `else`, but if maintainers have a preference I am fine to change that. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3858#discussion_r1624182929 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] core/resolve: Check dns_cache_init and choose appropriate functions (PR #3858)
@xkaraman pushed 1 commit. ce47096d86bdf9379091d0a48676763d9b249a83 core/resolve: Check dns_cache_init and choose appropriate functions -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3858/files/1babeb1941b8b068144b4ef988c0ad31e813e68f..ce47096d86bdf9379091d0a48676763d9b249a83 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] core/resolve: Check dns_cache_init and choose appropriate functions (PR #3858)
@xkaraman commented on this pull request. > @@ -1623,7 +1623,12 @@ struct hostent *no_naptr_srv_sip_resolvehost( srv_name.s = tmp_srv; srv_name.len = strlen(tmp_srv); #ifdef USE_DNS_CACHE - he = dns_srv_get_he(&srv_name, port, dns_flags); + if(dns_cache_init) { + he = dns_srv_get_he(&srv_name, port, dns_flags); + } else { + LM_WARN("USE_DNS_CACHE is defined but dns_cache_init=off\n"); You are right, removed. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3858#discussion_r1624176413 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] core/resolve: Check dns_cache_init and choose appropriate functions (PR #3858)
@dilyanpalauzov commented on this pull request. > @@ -1833,6 +1847,23 @@ ip_addr_t *str2ip(str *st) return ipb; } +struct hostent *__resolvehost(char *name) +{ + if(dns_cache_init) { + return dns_resolvehost(name); + } else { + return _resolvehost(name); + } +} + +struct hostent *__sip_resolvehost(str *name, unsigned short *port, char *proto) +{ + if(dns_cache_init) { + return dns_sip_resolvehost(name, port, proto); + } else { This `else` can be skipped: ```c if (x) return y; /*skipped else*/ return z; ``` -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3858#pullrequestreview-2091493759 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] core/resolve: Check dns_cache_init and choose appropriate functions (PR #3858)
@dilyanpalauzov commented on this pull request. > @@ -1623,7 +1623,12 @@ struct hostent *no_naptr_srv_sip_resolvehost( srv_name.s = tmp_srv; srv_name.len = strlen(tmp_srv); #ifdef USE_DNS_CACHE - he = dns_srv_get_he(&srv_name, port, dns_flags); + if(dns_cache_init) { + he = dns_srv_get_he(&srv_name, port, dns_flags); + } else { + LM_WARN("USE_DNS_CACHE is defined but dns_cache_init=off\n"); Why is this a run-time warning, depending on how Kamailio is compiled and current settings. I mean the distributions compile Kamailio and let the users select, `dns_cache_init` ON or OFF. With this change users will get a warning, they do not to fix, as it will be up to the distribution to fix the warning, by preventing the users to toggle `dns_cache_init`. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3858#pullrequestreview-2091484258 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] core/resolve: Check dns_cache_init and choose appropriate functions (PR #3858)
@xkaraman pushed 1 commit. 1babeb1941b8b068144b4ef988c0ad31e813e68f core/resolve: Check dns_cache_init and choose appropriate functions -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3858/files/df02022cb9f02b809be4069b596c26485b2f23cb..1babeb1941b8b068144b4ef988c0ad31e813e68f You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] core/resolve: Check dns_cache_init and choose appropriate functions (PR #3858)
@xkaraman pushed 1 commit. df02022cb9f02b809be4069b596c26485b2f23cb core/resolve: Check dns_cache_init and choose appropriate functions -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3858/files/93801ed11d0098634db621765e63423bd6e5456b..df02022cb9f02b809be4069b596c26485b2f23cb You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org