[sr-dev] git:master:ec25a62f: Merge pull request #749 from athonet-open/fix__log_tcp

GitHub noreply at github.com
Wed Aug 17 11:49:27 CEST 2016


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: GitHub <noreply at github.com>
Date: 2016-08-17T11:49:22+02:00

Merge pull request #749 from athonet-open/fix__log_tcp

core: fix some logging in tcp_read.c

---

Modified: tcp_read.c

---

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

---

diff --git a/tcp_read.c b/tcp_read.c
index 499db29..a31d3a2 100644
--- a/tcp_read.c
+++ b/tcp_read.c
@@ -287,11 +287,10 @@ int tcp_read_data(int fd, struct tcp_connection *c,
 						}
 				}
 				LOG(cfg_get(core, core_cfg, corelog),
-						"error reading: %s (%d) ([%s]:%u -> [%s]:%u)\n",
+						"error reading: %s (%d) ([%s]:%u ->",
 						strerror(errno), errno,
-						ip_addr2a(&c->rcv.src_ip), c->rcv.src_port,
-						ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port);
-
+						ip_addr2a(&c->rcv.src_ip), c->rcv.src_port);
+				LOG(cfg_get(core, core_cfg, corelog),"-> [%s]:%u)\n", ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port);
 				if((errno == ECONNRESET || errno == ETIMEDOUT) && likely(c->rcv.proto_reserved1 != 0)){
 					tcp_make_closed_event(&c->rcv, c);
 				}
@@ -305,9 +304,8 @@ int tcp_read_data(int fd, struct tcp_connection *c,
 			if (likely(c->rcv.proto_reserved1 != 0)){
 				tcp_make_closed_event(&c->rcv, c);
 			}
-			LM_DBG("EOF on %p, FD %d ([%s]:%u -> [%s]:%u)\n", c, fd,
-					ip_addr2a(&c->rcv.src_ip), c->rcv.src_port,
-					ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port);
+			LM_DBG("EOF on %p, FD %d ([%s]:%u ->", c, fd, ip_addr2a(&c->rcv.src_ip), c->rcv.src_port);
+			LM_DBG("-> [%s]:%u)\n", ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port);
 		}else{
 			if (unlikely(c->state==S_CONN_CONNECT || c->state==S_CONN_ACCEPT)){
 				TCP_STATS_ESTABLISHED(c->state);




More information about the sr-dev mailing list