From a1cf780cccc4819eb360cda1e0e94e17935cb8c7 Mon Sep 17 00:00:00 2001 From: Scott Moeller Date: Tue, 5 Mar 2013 21:49:48 -0800 Subject: [PATCH] curvetun: Enhanced server connect and disconnect syslog messages Made the messages a bit clearer for the average user, who may be unaware (or not care) that there are four file descriptors always open in addition to the number of active connections. Old connect/disconnect messages: curvetun[25448]: New connection from 68.107.99.106:41208 with id 15 on CPU0, 5 active! curvetun[25448]: Closed connection with id 15, 4 active! New connect message: curvetun[16247]: New connection from 68.107.99.106:36581 (1 active client connections) - id 15 on CPU0 curvetun[16247]: Closed connection with id 15 (0 active client connections remain) --- ct_server.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ct_server.c b/ct_server.c index cb11727..045472e 100644 --- a/ct_server.c +++ b/ct_server.c @@ -714,9 +714,8 @@ int server_main(char *home, char *dev, char *port, int udp, int ipv4, int log) NI_NUMERICHOST | NI_NUMERICSERV); syslog_maybe(auth_log, LOG_INFO, "New connection " - "from %s:%s with id %d on CPU%d, %d " - "active!\n", hbuff, sbuff, nfd, ncpu, - curfds); + "from %s:%s (%d active client connections) - id %d on CPU%d", + hbuff, sbuff, curfds-4, nfd, ncpu); set_nonblocking(nfd); set_socket_keepalive(nfd); @@ -766,8 +765,8 @@ int server_main(char *home, char *dev, char *port, int udp, int ipv4, int log) unregister_socket(fd_del); syslog_maybe(auth_log, LOG_INFO, "Closed connection " - "with id %d, %d active!\n", fd_del, - curfds); + "with id %d (%d active client connections remain)\n", fd_del, + curfds-4); } else { int cpu, fd_work = events[i].data.fd; -- 2.11.4.GIT