[evolution-patches] Patch for login synchronization b/w GW addressbook, calendar



hi,

 The attached patch adds synchronization between simultaneous login
requests issued by the addressbook, calendar (and the alarm daemon) for
the same account so that we authenticate to the server only once. 
This problem also reduces the occurrences of #64298 (problems due to
invalid sessions)  though not addressing it directly.

kindly review the same.
thanks,
harish
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/ChangeLog,v
retrieving revision 1.71
diff -u -p -r1.71 ChangeLog
--- ChangeLog	8 Oct 2004 07:41:41 -0000	1.71
+++ ChangeLog	10 Oct 2004 14:16:08 -0000
@@ -1,3 +1,10 @@
+2004-10-10  Harish Krishnaswamy  <kharish novell com>
+
+	* e-gw-connection.c: (e_gw_connection_new): Add a static
+	mutex in this function to prevent the addressbook, calendar,
+	the alarm-daemon etc. from issuing simulataneous independant 
+	login requests to the server for the same account.
+
 2004-10-07  Chenthill Palanisamy <pchenthill novell com>
 
 	Fixes #65200
Index: e-gw-connection.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-connection.c,v
retrieving revision 1.84
diff -u -p -r1.84 e-gw-connection.c
--- e-gw-connection.c	8 Oct 2004 07:41:41 -0000	1.84
+++ e-gw-connection.c	10 Oct 2004 14:16:09 -0000
@@ -279,7 +279,10 @@ e_gw_connection_new (const char *uri, co
 	SoupSoapParameter *param;
 	EGwConnectionStatus status;
 	char *hash_key;
+	static GStaticMutex connecting = G_STATIC_MUTEX_INIT;	
 	
+	g_static_mutex_lock (&connecting);
+
 	/* search the connection in our hash table */
 	if (loaded_connections != NULL) {
 		hash_key = g_strdup_printf ("%s:%s %s",
@@ -291,6 +294,7 @@ e_gw_connection_new (const char *uri, co
 
 		if (E_IS_GW_CONNECTION (cnc)) {
 			g_object_ref (cnc);
+			g_static_mutex_unlock (&connecting);
 			return cnc;
 		}
 	}
@@ -314,6 +318,7 @@ e_gw_connection_new (const char *uri, co
 	response = e_gw_connection_send_message (cnc, msg);
 	if (!response) {
 		g_object_unref (cnc);
+		g_static_mutex_unlock (&connecting);
 		return NULL;
 	}
 
@@ -323,6 +328,7 @@ e_gw_connection_new (const char *uri, co
 	if (!param) {
 		g_object_unref (response);
 		g_object_unref (cnc);
+		g_static_mutex_unlock (&connecting);
 		return NULL;
 	}
 	
@@ -367,6 +373,7 @@ e_gw_connection_new (const char *uri, co
 
 	/* free memory */
 	g_object_unref (response);
+	g_static_mutex_unlock (&connecting);
 
 	return cnc;
 }


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