Module: kamailio
Branch: master
Commit: 81e9c4f965dcedccdc73f88c6b8f0c2ff09598c8
URL: https://github.com/kamailio/kamailio/commit/81e9c4f965dcedccdc73f88c6b8f0c2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-06-27T13:41:29+02:00
core: log file and line for dns hash remove entry with high refcnt
---
Modified: src/core/dns_cache.c
---
Diff: https://github.com/kamailio/kamailio/commit/81e9c4f965dcedccdc73f88c6b8f0c2…
Patch: https://github.com/kamailio/kamailio/commit/81e9c4f965dcedccdc73f88c6b8f0c2…
---
diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c
index 9f6e47781f2..fbc5e83f27c 100644
--- a/src/core/dns_cache.c
+++ b/src/core/dns_cache.c
@@ -484,18 +484,24 @@ int init_dns_cache_stats(int iproc_num)
/* must be called with the DNS_LOCK hold
* removes an entry from the hash, dec. its refcnt and if not referenced
* anymore deletes it */
-inline static void _dns_hash_remove(struct dns_hash_entry *e)
+inline static void _dns_hash_remove_entry(
+ struct dns_hash_entry *e, char *fpath, unsigned int line)
{
clist_rm(e, next, prev);
e->next = e->prev = 0;
- debug_lu_lst("_dns_hash_remove: pre rm:", &e->last_used_lst);
+ debug_lu_lst("dns hash remove: pre rm:", &e->last_used_lst);
clist_rm(&e->last_used_lst, next, prev);
- debug_lu_lst("_dns_hash_remove: post rm:", &e->last_used_lst);
+ debug_lu_lst("dns hash remove: post rm:", &e->last_used_lst);
e->last_used_lst.next = e->last_used_lst.prev = 0;
*dns_cache_mem_used -= e->total_size;
+ if(atomic_get_int(&e->refcnt) > 1) {
+ LM_INFO("item %p with high refcnt %d (%s:%u)\n", e,
+ atomic_get_int(&e->refcnt), fpath, line);
+ }
dns_hash_put(e);
}
+#define _dns_hash_remove(e) _dns_hash_remove_entry(e, __FILE__, __LINE__)
/* non locking version (the dns hash must _be_ locked externally)
* returns 0 when not found, or the entry on success (an entry with a
2954456878 created an issue (kamailio/kamailio#4300)
loadmodule "nghttp2.so"
modparam("nghttp2", "listen_addr", "0.0.0.0")
modparam("nghttp2", "listen_port", "8363")
event_route[nghttp2:request] {
xinfo("request: $nghttp2(method) - url: $nghttp2(path) - data: [$nghttp2(data)]\n");
nghttp2_reply("200","<html><body>OK</body></html>");
}
curl -H "Content-Type: application/json" -X POST -d '{"test":"data"}' "http://127.0.0.1:8363/"
curl: (56) Recv failure: Connection reset by peer
When using curl request, the message "Recv failure" appears. What is wrong with the settings?
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4300
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4300(a)github.com>