Error conditions were duplicated for builds with and without SSL. This
can be factorized by letting mutt_ssl_socket_setup be defined even when
SSL is not enabled.
#include "connection.h"
#include "sasl_plain.h"
#include "socket.h"
+#include "ssl.h"
#include "tunnel.h"
#ifdef USE_SASL
#include "sasl.h"
#endif
-#ifdef USE_SSL
-#include "ssl.h"
-#endif
#endif /* _CONN_CONN_H */
int mutt_ssl_starttls(struct Connection *conn);
int mutt_ssl_socket_setup(struct Connection *conn);
+#else
+static inline int mutt_ssl_socket_setup(struct Connection *conn)
+{
+ return -1;
+}
#endif
#endif /* _CONN_SSL_H */
mutt_tunnel_socket_setup(conn);
else if (account->flags & MUTT_ACCT_SSL)
{
-#ifdef USE_SSL
if (mutt_ssl_socket_setup(conn) < 0)
{
+#ifndef USE_SSL
+ /* that's probably why it failed */
+ mutt_error(_("SSL is unavailable, cannot connect to %s"), account->host);
+#endif
mutt_socket_free(conn);
+
return NULL;
}
-#else
- mutt_error(_("SSL is unavailable, cannot connect to %s"), account->host);
- mutt_socket_free(conn);
-
- return NULL;
-#endif
}
else
{