Mercurial > dovecot > core-2.2
changeset 19235:77486e114423
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.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 28 Sep 2015 13:53:22 +0300 |
parents | 44dd7e81a38b |
children | c30c30c1e642 |
files | src/lib-http/http-client-connection.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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;