dovecot-2.2: lib-http: Avoid crashes when server is already disc...

dovecot at dovecot.org dovecot at dovecot.org
Mon Sep 28 10:56:06 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/77486e114423
changeset: 19235:77486e114423
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Sep 28 13:53:22 2015 +0300
description:
lib-http: Avoid crashes when server is already disconnected.
I'm not sure if this is the nicest fix, but seems to work for now at least.

diffstat:

 src/lib-http/http-client-connection.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 44dd7e81a38b -r 77486e114423 src/lib-http/http-client-connection.c
--- a/src/lib-http/http-client-connection.c	Mon Sep 28 13:51:49 2015 +0300
+++ b/src/lib-http/http-client-connection.c	Mon Sep 28 13:53:22 2015 +0300
@@ -551,7 +551,7 @@
 		/* request is dereferenced in payload destroy callback */
 		i_stream_unref(&payload);
 
-		if (conn->to_input != NULL) {
+		if (conn->to_input != NULL && conn->conn.input != NULL) {
 			/* already finished reading the payload */
 			http_client_payload_finished(conn);
 		}
@@ -561,7 +561,7 @@
 		http_client_request_unref(&req);
 	}
 
-	if (conn->incoming_payload == NULL) {
+	if (conn->incoming_payload == NULL && conn->conn.input != NULL) {
 		i_assert(conn->conn.io != NULL ||
 			conn->peer->addr.type == HTTP_CLIENT_PEER_ADDR_RAW);
 		ret = TRUE;


More information about the dovecot-cvs mailing list