Module: kamailio
Branch: master
Commit: 85def4c200e216dce5d3d8e53461a69ab408fa3c
URL: 
https://github.com/kamailio/kamailio/commit/85def4c200e216dce5d3d8e53461a69ab408fa3c

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-11T16:11:19+02:00

core: tcp - print str error in debug message if faling to write to connection

---

Modified: src/core/tcp_main.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/85def4c200e216dce5d3d8e53461a69ab408fa3c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/85def4c200e216dce5d3d8e53461a69ab408fa3c.patch

---

diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c
index 06812db509..09f7f4301b 100644
--- a/src/core/tcp_main.c
+++ b/src/core/tcp_main.c
@@ -2621,8 +2621,14 @@ static int tcpconn_1st_send(int fd, struct 
tcp_connection* c,
                   ENOTCONN appears on newer FreeBSD versions (non-blocking 
socket,
                   connect() & send immediately) */
                if ((n>=0) || errno==EAGAIN || errno==EWOULDBLOCK || 
errno==ENOTCONN){
-                       LM_DBG("pending write on new connection %p "
-                               "(%d/%d bytes written)\n", c, n, len);
+                       if(n<0) {
+                               LM_DBG("pending write on new connection %p "
+                                       "(%d/%d bytes written) (err: %d - 
%s)\n", c, n, len,
+                                       errno, strerror(errno));
+                       } else {
+                               LM_DBG("pending write on new connection %p "
+                                       "(%d/%d bytes written)\n", c, n, len);
+                       }
                        if (unlikely(n<0)) n=0;
                        else{
                                if (likely(c->state == S_CONN_CONNECT))


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to