dovecot-2.2: lib-http: Fixed crash caused by previous change.

dovecot at dovecot.org dovecot at dovecot.org
Tue Mar 5 16:32:17 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/00ee7a8306c7
changeset: 16000:00ee7a8306c7
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Mar 05 16:32:12 2013 +0200
description:
lib-http: Fixed crash caused by previous change.

diffstat:

 src/lib-http/http-client-connection.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r f89ebdc1625d -r 00ee7a8306c7 src/lib-http/http-client-connection.c
--- a/src/lib-http/http-client-connection.c	Tue Mar 05 14:32:03 2013 +0200
+++ b/src/lib-http/http-client-connection.c	Tue Mar 05 16:32:12 2013 +0200
@@ -284,6 +284,7 @@
 {
 	struct http_client_connection *conn =
 		(struct http_client_connection *)_conn;
+	const char *error;
 
 	conn->closing = TRUE;
 	conn->connected = FALSE;
@@ -294,10 +295,11 @@
 		break;
 	case CONNECTION_DISCONNECT_CONN_CLOSED:
 		/* retry pending requests if possible */
-		errno = _conn->input->stream_errno;
+		error = _conn->input == NULL ? "Connection lost" :
+			t_strdup_printf("Connection lost: %s",
+					strerror(_conn->input->stream_errno));
 		http_client_connection_retry_requests(conn,
-			HTTP_CLIENT_REQUEST_ERROR_CONNECTION_LOST,
-			t_strdup_printf("Connection lost: %m"));
+			HTTP_CLIENT_REQUEST_ERROR_CONNECTION_LOST, error);
 	default:
 		break;
 	}


More information about the dovecot-cvs mailing list