@cryptotaxi247 / netdata-1 / commits / 4218fe192

Change how the ip address and port are logged in socket.c (#5166)

The ip address and port are currently logged in two formats: "%s:%s" and "%s port %s". Not only is this inconsistent, but when the first of the above mentioned formatting is used and an ipv6 address is logged it is hard to read it. This patch removes the "%s:%s" occurrences. This fixes https://github.com/netdata/netdata/issues/5067.

krinfels committed Jan 14, 2019 at 12:00 UTC 4218fe1928f80c7b0f7dcf7348870201ab90f805
1 file changed +4 -4
libnetdata/socket/socket.c
+4 -4
@@ -1230,7 +1230,7 @@ static void poll_events_process(POLLJOB *p, POLLINFO *pi, struct pollfd *pf, sho
1230 #ifdef NETDATA_INTERNAL_CHECKS
1231 // this is common - it is used for web server file copies
1232 if(unlikely(!(pf->events & (POLLIN|POLLOUT)))) {
1233 - error("POLLFD: LISTENER: after reading, client slot %zu (fd %d) from '%s:%s' was left without expecting input or output. ", i, fd, pi->client_ip?pi->client_ip:"<undefined-ip>", pi->client_port?pi->client_port:"<undefined-port>");
1233 + error("POLLFD: LISTENER: after reading, client slot %zu (fd %d) from %s port %s was left without expecting input or output. ", i, fd, pi->client_ip?pi->client_ip:"<undefined-ip>", pi->client_port?pi->client_port:"<undefined-port>");
1234 //poll_close_fd(pi);
1235 //return;
1236 }
@@ -1331,7 +1331,7 @@ static void poll_events_process(POLLJOB *p, POLLINFO *pi, struct pollfd *pf, sho
1331 #ifdef NETDATA_INTERNAL_CHECKS
1332 // this is common - it is used for streaming
1333 if(unlikely(pi->flags & POLLINFO_FLAG_CLIENT_SOCKET && !(pf->events & (POLLIN|POLLOUT)))) {
1334 - error("POLLFD: LISTENER: after sending, client slot %zu (fd %d) from '%s:%s' was left without expecting input or output. ", i, fd, pi->client_ip?pi->client_ip:"<undefined-ip>", pi->client_port?pi->client_port:"<undefined-port>");
1334 + error("POLLFD: LISTENER: after sending, client slot %zu (fd %d) from %s port %s was left without expecting input or output. ", i, fd, pi->client_ip?pi->client_ip:"<undefined-ip>", pi->client_port?pi->client_port:"<undefined-port>");
1335 //poll_close_fd(pi);
1336 //return;
1337 }
@@ -1503,7 +1503,7 @@ void poll_events(LISTEN_SOCKETS *sockets
1503
1504 if(likely(pi->flags & POLLINFO_FLAG_CLIENT_SOCKET)) {
1505 if (unlikely(pi->send_count == 0 && p.complete_request_timeout > 0 && (now - pi->connected_t) >= p.complete_request_timeout)) {
1506 - info("POLLFD: LISTENER: client slot %zu (fd %d) from '%s:%s' has not sent a complete request in %zu seconds - closing it. "
1506 + info("POLLFD: LISTENER: client slot %zu (fd %d) from %s port %s has not sent a complete request in %zu seconds - closing it. "
1507 , i
1508 , pi->fd
1509 , pi->client_ip ? pi->client_ip : "<undefined-ip>"
@@ -1513,7 +1513,7 @@ void poll_events(LISTEN_SOCKETS *sockets
1513 poll_close_fd(pi);
1514 }
1515 else if(unlikely(pi->recv_count && p.idle_timeout > 0 && now - ((pi->last_received_t > pi->last_sent_t) ? pi->last_received_t : pi->last_sent_t) >= p.idle_timeout )) {
1516 - info("POLLFD: LISTENER: client slot %zu (fd %d) from '%s:%s' is idle for more than %zu seconds - closing it. "
1516 + info("POLLFD: LISTENER: client slot %zu (fd %d) from %s port %s is idle for more than %zu seconds - closing it. "
1517 , i
1518 , pi->fd
1519 , pi->client_ip ? pi->client_ip : "<undefined-ip>"