dovecot-2.2: login: Reverted previous fix attempt for SSL_accept...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jan 5 01:14:34 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/174d7e974326
changeset: 15526:174d7e974326
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 27 09:13:57 2012 +0200
description:
login: Reverted previous fix attempt for SSL_accept() busy-looping.
Apparently didn't work. Probably this patch doesn't help anything then, so
just remove the extra complexity.

diffstat:

 src/login-common/ssl-proxy-openssl.c |  17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diffs (63 lines):

diff -r 8e5d9d88e250 -r 174d7e974326 src/login-common/ssl-proxy-openssl.c
--- a/src/login-common/ssl-proxy-openssl.c	Tue Nov 27 08:43:15 2012 +0200
+++ b/src/login-common/ssl-proxy-openssl.c	Tue Nov 27 09:13:57 2012 +0200
@@ -394,9 +394,8 @@
 	return ssl_err2str(err, data, flags);
 }
 
-static void
-ssl_handle_error(struct ssl_proxy *proxy, int ret, bool remove_wrong_direction,
-		 const char *func_name)
+static void ssl_handle_error(struct ssl_proxy *proxy, int ret,
+			     const char *func_name)
 {
 	const char *errstr = NULL;
 	int err;
@@ -409,13 +408,9 @@
 	switch (err) {
 	case SSL_ERROR_WANT_READ:
 		ssl_set_io(proxy, SSL_ADD_INPUT);
-		if (remove_wrong_direction)
-			ssl_set_io(proxy, SSL_REMOVE_OUTPUT);
 		break;
 	case SSL_ERROR_WANT_WRITE:
 		ssl_set_io(proxy, SSL_ADD_OUTPUT);
-		if (remove_wrong_direction)
-			ssl_set_io(proxy, SSL_REMOVE_INPUT);
 		break;
 	case SSL_ERROR_SYSCALL:
 		/* eat up the error queue */
@@ -463,13 +458,13 @@
 	if (proxy->client_proxy) {
 		ret = SSL_connect(proxy->ssl);
 		if (ret != 1) {
-			ssl_handle_error(proxy, ret, TRUE, "SSL_connect()");
+			ssl_handle_error(proxy, ret, "SSL_connect()");
 			return;
 		}
 	} else {
 		ret = SSL_accept(proxy->ssl);
 		if (ret != 1) {
-			ssl_handle_error(proxy, ret, TRUE, "SSL_accept()");
+			ssl_handle_error(proxy, ret, "SSL_accept()");
 			return;
 		}
 	}
@@ -496,7 +491,7 @@
 			       sizeof(proxy->plainout_buf) -
 			       proxy->plainout_size);
 		if (ret <= 0) {
-			ssl_handle_error(proxy, ret, FALSE, "SSL_read()");
+			ssl_handle_error(proxy, ret, "SSL_read()");
 			break;
 		} else {
 			i_free_and_null(proxy->last_error);
@@ -512,7 +507,7 @@
 
 	ret = SSL_write(proxy->ssl, proxy->sslout_buf, proxy->sslout_size);
 	if (ret <= 0)
-		ssl_handle_error(proxy, ret, FALSE, "SSL_write()");
+		ssl_handle_error(proxy, ret, "SSL_write()");
 	else {
 		i_free_and_null(proxy->last_error);
 		proxy->sslout_size -= ret;


More information about the dovecot-cvs mailing list