]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: If remote server disconnects, log the reason.
authorTimo Sirainen <tss@iki.fi>
Thu, 1 Dec 2011 07:24:58 +0000 (09:24 +0200)
committerTimo Sirainen <tss@iki.fi>
Thu, 1 Dec 2011 07:24:58 +0000 (09:24 +0200)
src/lib-imap-client/imapc-connection.c

index 590de51cab3e13a548f3d90ec92eef86569d23f6..a9b15a6059e4bb1c1ef9d93ef5628194bcb5bb9b 100644 (file)
@@ -1108,8 +1108,12 @@ static void imapc_connection_input(struct imapc_connection *conn)
                                conn->name);
                } else if (!conn->handshake_failed) {
                        errstr = ssl_iostream_get_last_error(conn->ssl_iostream);
+                       if (errstr == NULL) {
+                               errstr = conn->input->stream_errno == 0 ? "EOF" :
+                                       strerror(conn->input->stream_errno);
+                       }
                        i_error("imapc(%s): Server disconnected: %s",
-                               conn->name, errstr != NULL ? errstr : "");
+                               conn->name, errstr);
                }
                imapc_connection_reconnect(conn);
        }