Before, the connection was not guaranteed to be fully initialized after the SSL
handshake. The problem would occur when the handshake finished while writing the
SSL output stream. In a similar HTTP client issue, this caused a segfault.
i_assert(ret == 0);
return;
}
+ }
- /* ready for SMTP handshake */
+ if (!conn->connect_succeeded) {
+ /* just got ready for SMTP handshake */
smtp_client_connection_established(conn);
}
static void
smtp_client_connection_established(struct smtp_client_connection *conn)
{
+ i_assert(!conn->connect_succeeded);
+ conn->connect_succeeded = TRUE;
+
if (conn->to_connect != NULL)
timeout_reset(conn->to_connect);
bool authenticated:1;
bool initial_xclient_sent:1;
bool connect_failed:1;
+ bool connect_succeeded:1;
bool handshake_failed:1;
bool corked:1;
bool sent_quit:1;