From 2aefadf282648010e9403e4a7f643fe78dc6df53 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 9 Jun 2000 22:00:53 +0000 Subject: Add another argument, "mode", which can be CAMEL_AUTHENTICATOR_ASK or * camel-session.c (camel_session_query_authenticator): Add another argument, "mode", which can be CAMEL_AUTHENTICATOR_ASK or CAMEL_AUTHENTICATOR_TELL, so callers can get the app to un-cache bad info. * providers/pop3/camel-pop3-store.c (pop3_connect): uncache the password if it doesn't work. svn path=/trunk/; revision=3496 --- camel/providers/pop3/camel-pop3-store.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'camel/providers/pop3/camel-pop3-store.c') diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index 9607d6723f..d82ef7b0b4 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -393,11 +393,10 @@ pop3_connect (CamelService *service, CamelException *ex) char *prompt = g_strdup_printf ("Please enter the POP3 password for %s@%s", service->url->user, service->url->host); - service->url->passwd = - camel_session_query_authenticator (camel_service_get_session (service), - prompt, TRUE, - service, "password", - ex); + service->url->passwd = camel_session_query_authenticator ( + camel_service_get_session (service), + CAMEL_AUTHENTICATOR_ASK, prompt, TRUE, + service, "password", ex); g_free (prompt); if (!service->url->passwd) { pop3_disconnect (service, ex); @@ -415,7 +414,7 @@ pop3_connect (CamelService *service, CamelException *ex) "server. Error sending username:" " %s", msg ? msg : "(Unknown)"); g_free (msg); - pop3_disconnect (service, ex); + goto lose; } g_free (msg); @@ -440,8 +439,7 @@ pop3_connect (CamelService *service, CamelException *ex) camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, "No support for requested " "authentication mechanism."); - pop3_disconnect (service, ex); - return FALSE; + goto lose; } if (status != CAMEL_POP3_OK) { @@ -450,13 +448,21 @@ pop3_connect (CamelService *service, CamelException *ex) "server. Error sending password:" " %s", msg ? msg : "(Unknown)"); g_free (msg); - pop3_disconnect (service, ex); - return FALSE; + goto lose; } g_free (msg); service_class->connect (service, ex); return TRUE; + + lose: + /* Uncache the password. */ + camel_session_query_authenticator (camel_service_get_session (service), + CAMEL_AUTHENTICATOR_TELL, NULL, + TRUE, service, "password", ex); + + pop3_disconnect (service, ex); + return FALSE; } static gboolean -- cgit v1.2.3