[dovecot-cvs] dovecot/src/pop3-login client.c,1.3,1.4

cras at procontrol.fi cras at procontrol.fi
Sun Feb 2 09:10:48 EET 2003


Update of /home/cvs/dovecot/src/pop3-login
In directory danu:/tmp/cvs-serv17045/pop3-login

Modified Files:
	client.c 
Log Message:
STARTTLS commands crashed. imap-login STARTTLS also ignored next command.



Index: client.c
===================================================================
RCS file: /home/cvs/dovecot/src/pop3-login/client.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- client.c	30 Jan 2003 19:52:39 -0000	1.3
+++ client.c	2 Feb 2003 07:10:46 -0000	1.4
@@ -45,6 +45,13 @@
 					  host));
 }
 
+static void client_open_streams(struct pop3_client *client, int fd)
+{
+	client->input = i_stream_create_file(fd, default_pool, 8192, FALSE);
+	client->output = o_stream_create_file(fd, default_pool, 1024,
+					      IO_PRIORITY_DEFAULT, FALSE);
+}
+
 static int cmd_stls(struct pop3_client *client)
 {
 	int fd_ssl;
@@ -79,11 +86,7 @@
 		i_stream_unref(client->input);
 		o_stream_unref(client->output);
 
-		client->input = i_stream_create_file(fd_ssl, default_pool,
-						     8192, FALSE);
-		client->output = o_stream_create_file(fd_ssl, default_pool,
-						      1024, IO_PRIORITY_DEFAULT,
-						      FALSE);
+		client_open_streams(client, fd_ssl);
 	} else {
 		client_send_line(client, "-ERR TLS handehake failed.");
 		client_destroy(client, "TLS handshake failed");
@@ -238,9 +241,7 @@
 	client->common.ip = *ip;
 	client->common.fd = fd;
 	client->io = io_add(fd, IO_READ, client_input, client);
-	client->input = i_stream_create_file(fd, default_pool, 8192, FALSE);
-	client->output = o_stream_create_file(fd, default_pool, 1024,
-					      IO_PRIORITY_DEFAULT, FALSE);
+	client_open_streams(client, fd);
 	client->plain_login = buffer_create_dynamic(system_pool, 128, 8192);
 
 	client->last_input = ioloop_time;




More information about the dovecot-cvs mailing list