[evolution-data-server] Do not return CAMEL_AUTHENTICATION_REJECT on runtime errors



commit 6107302f8baed5066d5825ce804a76eed9407c51
Author: Milan Crha <mcrha redhat com>
Date:   Fri Apr 25 07:33:34 2014 +0200

    Do not return CAMEL_AUTHENTICATION_REJECT on runtime errors
    
    Returning CAMEL_AUTHENTICATION_REJECT on runtime errors also means
    that a stored password is forgotten and a user is asked for it,
    which is eventually not used, because the runtime error can repeat.
    The correct return code is CAMEL_AUTHENTICATION_ERROR in this case.

 camel/camel-service.c                      |   10 +++++-----
 camel/providers/imapx/camel-imapx-server.c |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 1c1821c..7e18212 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -2101,12 +2101,12 @@ camel_service_authenticate_sync (CamelService *service,
 
        g_return_val_if_fail (
                CAMEL_IS_SERVICE (service),
-               CAMEL_AUTHENTICATION_REJECTED);
+               CAMEL_AUTHENTICATION_ERROR);
 
        class = CAMEL_SERVICE_GET_CLASS (service);
        g_return_val_if_fail (
                class->authenticate_sync != NULL,
-               CAMEL_AUTHENTICATION_REJECTED);
+               CAMEL_AUTHENTICATION_ERROR);
 
        result = class->authenticate_sync (
                service, mechanism, cancellable, error);
@@ -2224,15 +2224,15 @@ camel_service_authenticate_finish (CamelService *service,
 
        g_return_val_if_fail (
                CAMEL_IS_SERVICE (service),
-               CAMEL_AUTHENTICATION_REJECTED);
+               CAMEL_AUTHENTICATION_ERROR);
        g_return_val_if_fail (
                g_task_is_valid (result, service),
-               CAMEL_AUTHENTICATION_REJECTED);
+               CAMEL_AUTHENTICATION_ERROR);
 
        g_return_val_if_fail (
                g_async_result_is_tagged (
                result, camel_service_authenticate),
-               CAMEL_AUTHENTICATION_REJECTED);
+               CAMEL_AUTHENTICATION_ERROR);
 
        /* XXX A little hackish, but best way to return enum values
         *     from GTask in GLib 2.36.  Recommended by Dan Winship. */
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 0120623..44f886a 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -4644,7 +4644,7 @@ camel_imapx_server_authenticate (CamelIMAPXServer *is,
 
        g_return_val_if_fail (
                CAMEL_IS_IMAPX_SERVER (is),
-               CAMEL_AUTHENTICATION_REJECTED);
+               CAMEL_AUTHENTICATION_ERROR);
 
        store = camel_imapx_server_ref_store (is);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]