Module: kamailio
Branch: master
Commit: 85def4c200e216dce5d3d8e53461a69ab408fa3c
URL:
https://github.com/kamailio/kamailio/commit/85def4c200e216dce5d3d8e53461a69…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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/85def4c200e216dce5d3d8e53461a69…
Patch:
https://github.com/kamailio/kamailio/commit/85def4c200e216dce5d3d8e53461a69…
---
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))