changeset 22847:3338a8e5976d

lib-http: server: Recreate connection IO after streams change.
author Stephan Bosch <stephan.bosch@dovecot.fi>
date Fri, 09 Feb 2018 23:57:29 +0100
parents 5f45d733a483
children 170f155eb2b2
files src/lib-http/http-server-connection.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-http/http-server-connection.c	Fri Feb 09 23:56:55 2018 +0100
+++ b/src/lib-http/http-server-connection.c	Fri Feb 09 23:57:29 2018 +0100
@@ -397,6 +397,7 @@
 	if (conn->server->set.debug)
 		http_server_connection_debug(conn, "Starting SSL handshake");
 
+	http_server_connection_input_halt(conn);
 	if (master_service_ssl_init(master_service,
 				&conn->conn.input, &conn->conn.output,
 				&conn->ssl_iostream, &error) < 0) {
@@ -404,6 +405,8 @@
 			"Couldn't initialize SSL server for %s: %s", conn->conn.name, error);
 		return -1;
 	}
+	http_server_connection_input_resume(conn);
+
 	if (ssl_iostream_handshake(conn->ssl_iostream) < 0) {
 		http_server_connection_error(conn,"SSL handshake failed: %s",
 			ssl_iostream_get_last_error(conn->ssl_iostream));