Browse code

core: fix some logging in tcp_read.c

(cherry picked from commit d61ff2e4cf49479a811019c2f01ace46344cacc2)

Dragos Oancea authored on 16/08/2016 17:03:08
Showing 1 changed files
... ...
@@ -287,11 +287,10 @@ again:
287 287
 						}
288 288
 				}
289 289
 				LOG(cfg_get(core, core_cfg, corelog),
290
-						"error reading: %s (%d) ([%s]:%u -> [%s]:%u)\n",
290
+						"error reading: %s (%d) ([%s]:%u ->",
291 291
 						strerror(errno), errno,
292
-						ip_addr2a(&c->rcv.src_ip), c->rcv.src_port,
293
-						ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port);
294
-
292
+						ip_addr2a(&c->rcv.src_ip), c->rcv.src_port);
293
+				LOG(cfg_get(core, core_cfg, corelog),"-> [%s]:%u)\n", ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port);
295 294
 				if((errno == ECONNRESET || errno == ETIMEDOUT) && likely(c->rcv.proto_reserved1 != 0)){
296 295
 					tcp_make_closed_event(&c->rcv, c);
297 296
 				}
... ...
@@ -305,9 +304,8 @@ again:
305 305
 			if (likely(c->rcv.proto_reserved1 != 0)){
306 306
 				tcp_make_closed_event(&c->rcv, c);
307 307
 			}
308
-			LM_DBG("EOF on %p, FD %d ([%s]:%u -> [%s]:%u)\n", c, fd,
309
-					ip_addr2a(&c->rcv.src_ip), c->rcv.src_port,
310
-					ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port);
308
+			LM_DBG("EOF on %p, FD %d ([%s]:%u ->", c, fd, ip_addr2a(&c->rcv.src_ip), c->rcv.src_port);
309
+			LM_DBG("-> [%s]:%u)\n", ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port);
311 310
 		}else{
312 311
 			if (unlikely(c->state==S_CONN_CONNECT || c->state==S_CONN_ACCEPT)){
313 312
 				TCP_STATS_ESTABLISHED(c->state);