Module: kamailio
Branch: master
Commit: 556efcaa34367dc689ee653b0de9f22ccef073f9
URL: 
https://github.com/kamailio/kamailio/commit/556efcaa34367dc689ee653b0de9f22ccef073f9

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2024-11-25T19:58:06+01:00

core: tcp - emit async tkv event for read error

---

Modified: src/core/tcp_read.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/556efcaa34367dc689ee653b0de9f22ccef073f9.diff
Patch: 
https://github.com/kamailio/kamailio/commit/556efcaa34367dc689ee653b0de9f22ccef073f9.patch

---

diff --git a/src/core/tcp_read.c b/src/core/tcp_read.c
index cd7790eb958..c08d9bf074f 100644
--- a/src/core/tcp_read.c
+++ b/src/core/tcp_read.c
@@ -52,6 +52,7 @@
 #include "ut.h"
 #include "trim.h"
 #include "pt.h"
+#include "async_task.h"
 #include "daemonize.h"
 #include "cfg/cfg_struct.h"
 #ifdef CORE_TLS
@@ -269,6 +270,9 @@ int tcp_read_data(int fd, struct tcp_connection *c, char 
*buf, int b_size,
                                                strerror(errno), errno, 
ip_addr2xa(&c->rcv.src_ip),
                                                c->rcv.src_port, 
ip_addr2xa(&c->rcv.dst_ip),
                                                c->rcv.dst_port);
+                               async_tkv_emit(1200, "tcp-read-error",
+                                               "erno=%d;srcip=%s;dstip=%s", 
errno,
+                                               ip_addr2xa(&c->rcv.src_ip), 
ip_addr2xa(&c->rcv.dst_ip));
                                if(errno == ETIMEDOUT) {
                                        c->event = TCP_CLOSED_TIMEOUT;
                                } else if(errno == ECONNRESET) {

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to