Commit dbd7d206 dbd7d2064a80471e2b7cba17bd7a13abdb1976bf by Sergey Poznyakoff

(tls_available,tls_done): Static variables.

(imap4d_starttls): Register mu_deinit_tls_libs as an 'atexit'
function.
(starttls_init): New function.
1 parent 56810e89
......@@ -19,6 +19,9 @@
#ifdef WITH_TLS
static int tls_available;
static int tls_done;
int
imap4d_starttls (struct imap4d_command *command, char *arg)
{
......@@ -40,10 +43,21 @@ imap4d_starttls (struct imap4d_command *command, char *arg)
imap4d_capability_remove ("STARTTLS");
login_disabled = 0;
imap4d_capability_remove ("LOGINDISABLED");
util_atexit (mu_deinit_tls_libs);
}
return status;
}
void
starttls_init ()
{
tls_available = mu_check_tls_environment ();
if (tls_available)
tls_available = mu_init_tls_libs ();
if (tls_available)
imap4d_capability_add ("STARTTLS");
}
#endif /* WITH_TLS */
/* EOF */
......