[libgdata] core: Remove redundant cancellation checks from the authentication thread



commit 458b9cc57e2a9a734a591a3fe4e0955b3decd401
Author: Philip Withnall <philip tecnocode co uk>
Date:   Thu Dec 16 16:41:44 2010 +0000

    core: Remove redundant cancellation checks from the authentication thread
    
    Helps: bgo#637036

 gdata/gdata-service.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/gdata/gdata-service.c b/gdata/gdata-service.c
index e131809..2e4aa12 100644
--- a/gdata/gdata-service.c
+++ b/gdata/gdata-service.c
@@ -812,16 +812,10 @@ authenticate_thread (GSimpleAsyncResult *result, GDataService *service, GCancell
 	gboolean success;
 	AuthenticateAsyncData *data = g_simple_async_result_get_op_res_gpointer (result);
 
-	/* Check to see if it's been cancelled already */
-	if (g_cancellable_set_error_if_cancelled (cancellable, &error) == TRUE) {
-		g_simple_async_result_set_from_error (result, error);
-		g_error_free (error);
-		authenticate_async_data_free (data);
-		return;
-	}
-
 	/* Authenticate and return */
 	success = authenticate (service, data->username, data->password, NULL, NULL, cancellable, &error);
+	g_simple_async_result_set_op_res_gboolean (result, success);
+
 	if (success == FALSE) {
 		g_simple_async_result_set_from_error (result, error);
 		g_error_free (error);
@@ -829,7 +823,6 @@ authenticate_thread (GSimpleAsyncResult *result, GDataService *service, GCancell
 
 	/* Update the authentication details held by the service (protected by a mutex) */
 	set_authentication_details (service, data->username, data->password, success);
-	g_simple_async_result_set_op_res_gboolean (result, success);
 }
 
 /**



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