changeset 10332:fed94dd1991b HEAD

lmtp client: Fail immediately if server disconnects.
author Timo Sirainen <tss@iki.fi>
date Mon, 16 Nov 2009 16:05:51 -0500
parents b5b253d35612
children c48703f5ce25
files src/lib-lda/lmtp-client.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-lda/lmtp-client.c	Mon Nov 16 14:40:59 2009 -0500
+++ b/src/lib-lda/lmtp-client.c	Mon Nov 16 16:05:51 2009 -0500
@@ -378,6 +378,11 @@
 	if (client->input->stream_errno != 0) {
 		errno = client->input->stream_errno;
 		i_error("lmtp client: read() failed: %m");
+		lmtp_client_fail(client, ERRSTR_TEMP_REMOTE_FAILURE
+				 " (read failure)");
+	} else if (client->input->eof) {
+		lmtp_client_fail(client, ERRSTR_TEMP_REMOTE_FAILURE
+				 " (disconnected in input)");
 	}
 	lmtp_client_unref(&client);
 }