[dovecot-cvs] dovecot/src/login-common login-proxy.c,1.2,1.3

cras at dovecot.org cras at dovecot.org
Wed Oct 20 16:59:35 EEST 2004


Update of /var/lib/cvs/dovecot/src/login-common
In directory talvi:/tmp/cvs-serv1261/login-common

Modified Files:
	login-proxy.c 
Log Message:
Logging changes.



Index: login-proxy.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/login-common/login-proxy.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- login-proxy.c	18 Oct 2004 23:07:01 -0000	1.2
+++ login-proxy.c	20 Oct 2004 13:59:32 -0000	1.3
@@ -17,7 +17,7 @@
 	struct istream *proxy_input;
 	struct ostream *client_output, *proxy_output;
 
-	char *host, *user, *login_cmd;
+	char *host, *user;
 	unsigned int port;
 
 	proxy_callback_t *callback;
@@ -172,6 +172,7 @@
 
 	proxy = i_new(struct login_proxy, 1);
 	proxy->host = i_strdup(host);
+	proxy->user = i_strdup(client->virtual_user);
 	proxy->port = port;
 
 	proxy->proxy_fd = fd;
@@ -186,6 +187,8 @@
 
 void login_proxy_free(struct login_proxy *proxy)
 {
+	struct ip_addr ip;
+
 	if (proxy->destroying)
 		return;
 
@@ -194,6 +197,11 @@
 		main_unref();
 		hash_remove(login_proxies, proxy);
 
+		if (net_getpeername(proxy->client_fd, &ip, NULL) < 0)
+			ip.family = 0;
+		i_info("proxy(%s): disconnecting %s",
+		       proxy->user, net_ip2addr(&ip));
+
 		if (proxy->client_io != NULL)
 			io_remove(proxy->client_io);
 		if (proxy->client_output != NULL)
@@ -213,6 +221,7 @@
 	net_disconnect(proxy->proxy_fd);
 
 	i_free(proxy->host);
+	i_free(proxy->user);
 	i_free(proxy);
 }
 



More information about the dovecot-cvs mailing list