diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-01-22 13:14:45 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-01-22 13:14:45 +0000 |
commit | dbd7d2064a80471e2b7cba17bd7a13abdb1976bf (patch) | |
tree | 56778105ca3d1450cfea23fae589d7d5ae5801da /imap4d | |
parent | 56810e89d7da50c218006366969b73be5f0b4035 (diff) | |
download | mailutils-dbd7d2064a80471e2b7cba17bd7a13abdb1976bf.tar.gz mailutils-dbd7d2064a80471e2b7cba17bd7a13abdb1976bf.tar.bz2 |
(tls_available,tls_done): Static variables.
(imap4d_starttls): Register mu_deinit_tls_libs as an 'atexit'
function.
(starttls_init): New function.
Diffstat (limited to 'imap4d')
-rw-r--r-- | imap4d/starttls.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/imap4d/starttls.c b/imap4d/starttls.c index 011746242..7221b42ca 100644 --- a/imap4d/starttls.c +++ b/imap4d/starttls.c @@ -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 */ |