From a743a6c7d3f7b65a366251dd121011725964d07b Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 19 Aug 2019 11:37:03 +0200 Subject: [PATCH] core: tcp - debug messages when looking up tcp connection --- src/core/tcp_main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c index 7ecaf47eb6a..819cfe9c3f4 100644 --- a/src/core/tcp_main.c +++ b/src/core/tcp_main.c @@ -1622,7 +1622,7 @@ struct tcp_connection* _tcpconn_find(int id, struct ip_addr* ip, int port, int is_local_ip_any; #ifdef EXTRA_DEBUG - LM_DBG("%d port %d\n",id, port); + LM_DBG("%d port %d\n", id, port); if (ip) print_ip("tcpconn_find: ip ", ip, "\n"); #endif if (likely(id)){ @@ -1632,7 +1632,10 @@ struct tcp_connection* _tcpconn_find(int id, struct ip_addr* ip, int port, LM_DBG("c=%p, c->id=%d, port=%d\n", c, c->id, c->rcv.src_port); print_ip("ip=", &c->rcv.src_ip, "\n"); #endif - if ((id==c->id)&&(c->state!=S_CONN_BAD)) return c; + if ((id==c->id)&&(c->state!=S_CONN_BAD)) { + LM_DBG("found connection by id: %d\n", id); + return c; + } } }else if (likely(ip)){ hash=tcp_addr_hash(ip, port, l_ip, l_port); @@ -1648,8 +1651,11 @@ struct tcp_connection* _tcpconn_find(int id, struct ip_addr* ip, int port, (ip_addr_cmp(ip, &a->parent->rcv.src_ip)) && (is_local_ip_any || ip_addr_cmp(l_ip, &a->parent->rcv.dst_ip)) - ) + ) { + LM_DBG("found connection by peer address (id: %d)\n", + a->parent->id); return a->parent; + } } } return 0;