diff --git a/src/piler-smtp.c b/src/piler-smtp.c index 6ac8c9e..7eade8d 100644 --- a/src/piler-smtp.c +++ b/src/piler-smtp.c @@ -234,7 +234,9 @@ } if(getnameinfo((struct sockaddr *)&client_address, client_len, hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV) == 0){ - syslog(LOG_PRIORITY, "connected from %s:%s on descriptor %d", hbuf, sbuf, client_sockfd); + // Strictly speaking it's not correct to log num_connections+1 connections + // but it still gives a good clue how many connections we have at the moment + syslog(LOG_PRIORITY, "connected from %s:%s on descriptor %d (active connections: %d)", hbuf, sbuf, client_sockfd, num_connections + 1); } if(make_socket_non_blocking(client_sockfd) == -1){ diff --git a/src/session.c b/src/session.c index fca1632..78148ed 100644 --- a/src/session.c +++ b/src/session.c @@ -151,7 +151,7 @@ void tear_down_session(struct smtp_session **sessions, int slot, int *num_connections){ - syslog(LOG_PRIORITY, "disconnected from %s", sessions[slot]->remote_host); + syslog(LOG_PRIORITY, "disconnected from %s on descriptor %d (%d active connections)", sessions[slot]->remote_host, sessions[slot]->net.socket, (*num_connections)-1); close(sessions[slot]->net.socket);