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