mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 00:31:58 +01:00
src: improved sessin logging
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
c96693f98f
commit
20d41eb261
@ -234,7 +234,9 @@ int main(int argc, char **argv){
|
||||
}
|
||||
|
||||
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){
|
||||
|
@ -151,7 +151,7 @@ void free_smtp_session(struct smtp_session *session){
|
||||
|
||||
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user