[sr-dev] git:master:d61ff2e4: core: fix some logging in tcp_read.c
Dragos Oancea
dragos.oancea at athonet.com
Wed Aug 17 11:49:27 CEST 2016
Module: kamailio
Branch: master
Commit: d61ff2e4cf49479a811019c2f01ace46344cacc2
URL: https://github.com/kamailio/kamailio/commit/d61ff2e4cf49479a811019c2f01ace46344cacc2
Author: Dragos Oancea <dragos.oancea at athonet.com>
Committer: Dragos Oancea <dragos.oancea at athonet.com>
Date: 2016-08-17T11:15:19+02:00
core: fix some logging in tcp_read.c
---
Modified: tcp_read.c
---
Diff: https://github.com/kamailio/kamailio/commit/d61ff2e4cf49479a811019c2f01ace46344cacc2.diff
Patch: https://github.com/kamailio/kamailio/commit/d61ff2e4cf49479a811019c2f01ace46344cacc2.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