changeset 3360:8df4cfb22171 HEAD

STARTTLS was broken
author Timo Sirainen <tss@iki.fi>
date Sun, 08 May 2005 20:16:28 +0300
parents 455b4a29166c
children 5cb55f703d9b
files src/imap-login/client.c src/pop3-login/client.c
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap-login/client.c	Sun May 08 17:12:58 2005 +0300
+++ b/src/imap-login/client.c	Sun May 08 20:16:28 2005 +0300
@@ -173,8 +173,9 @@
 	}
 
 	client_send_tagline(client, "OK Begin TLS negotiation now.");
-	if (o_stream_get_buffer_used_size(client->output) != 0) {
+	if (o_stream_flush(client->output) <= 0) {
 		/* the buffer has to be flushed */
+		o_stream_set_flush_pending(client->output, TRUE);
 		o_stream_set_flush_callback(client->output,
 					    client_output_starttls, client);
 	} else {
--- a/src/pop3-login/client.c	Sun May 08 17:12:58 2005 +0300
+++ b/src/pop3-login/client.c	Sun May 08 20:16:28 2005 +0300
@@ -127,8 +127,9 @@
 	}
 
 	client_send_line(client, "+OK Begin TLS negotiation now.");
-	if (o_stream_get_buffer_used_size(client->output) != 0) {
+	if (o_stream_flush(client->output) <= 0) {
 		/* the buffer has to be flushed */
+		o_stream_set_flush_pending(client->output, TRUE);
 		o_stream_set_flush_callback(client->output,
 					    client_output_starttls, client);
 	} else {