[evolution-patches] eds patch for calendar auth
- From: Not Zed <notzed ximian com>
- To: evolution-patches lists ximian com
- Subject: [evolution-patches] eds patch for calendar auth
- Date: Thu, 12 Aug 2004 18:43:42 +0800
simplifies the e-cal auth stuff. now its upto the auth callback to handle thread issues; which e-passwords does now.
this moves the thread-related issues to code that knows how to do it properly :)
i was getting consistent repeated hangs starting calendar/tasks or toggling a tasks folder on and off rapidly for a remote groupwise server. the password code was returning a password, but the code this patch removes was getting confused and it never got the cond back to tell it to move forward.
this possibly addresses 62866 and other calendar auth-related issues.
? calendar/d.diff
? calendar/libical/src/libicalss/icalssyacc.output
? calendar/libical/src/python/Makefile
? calendar/libical/src/python/Makefile.in
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.304
diff -u -3 -r1.304 ChangeLog
--- calendar/ChangeLog 2 Aug 2004 11:38:08 -0000 1.304
+++ calendar/ChangeLog 12 Aug 2004 10:34:21 -0000
@@ -1,3 +1,10 @@
+2004-08-12 Not Zed <NotZed Ximian com>
+
+ * libecal/e-cal.c (async_auth_func_cb): removed.
+ (open_async): dont override the auth callback. It is now up to
+ the caller to ensure they're thread-safe and serialised
+ appropriately.
+
2004-08-02 Not Zed <NotZed Ximian com>
** See bug #58642.
Index: calendar/libecal/e-cal.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal.c,v
retrieving revision 1.69
diff -u -3 -r1.69 e-cal.c
--- calendar/libecal/e-cal.c 30 Jul 2004 12:30:43 -0000 1.69
+++ calendar/libecal/e-cal.c 12 Aug 2004 10:34:22 -0000
@@ -1583,40 +1583,18 @@
gboolean exists;
gboolean result;
ECalendarStatus status;
- ECalAuthFunc real_auth_func;
- gpointer real_auth_user_data;
const char *auth_prompt;
const char *auth_key;
char *password;
- GMutex *mutex;
- GCond *cond;
} ECalAsyncData;
static gboolean
-async_auth_idle_cb (gpointer data)
-{
- ECalAsyncData *ccad = data;
-
- g_mutex_lock (ccad->mutex);
- ccad->password = ccad->real_auth_func (ccad->ecal, ccad->auth_prompt, ccad->auth_key, ccad->real_auth_user_data);
- g_cond_signal (ccad->cond);
- g_mutex_unlock (ccad->mutex);
-
- return FALSE;
-}
-
-static gboolean
async_signal_idle_cb (gpointer data)
{
ECalAsyncData *ccad = data;
g_signal_emit (G_OBJECT (ccad->ecal), e_cal_signals[CAL_OPENED], 0, ccad->status);
- ccad->ecal->priv->auth_func = ccad->real_auth_func;
- ccad->ecal->priv->auth_user_data = ccad->real_auth_user_data;
- g_mutex_free (ccad->mutex);
- g_cond_free (ccad->cond);
-
/* free memory */
g_object_unref (ccad->ecal);
g_free (ccad);
@@ -1624,39 +1602,10 @@
return FALSE;
}
-static char *
-async_auth_func_cb (ECal *ecal, const char *prompt, const char *key, gpointer user_data)
-{
- ECalAsyncData *ccad = user_data;
- char * password;
-
- ccad->auth_prompt = prompt;
- ccad->auth_key = key;
-
- g_idle_add ((GSourceFunc) async_auth_idle_cb, ccad);
-
- g_mutex_lock (ccad->mutex);
- g_cond_wait (ccad->cond, ccad->mutex);
- password = ccad->password;
- ccad->password = NULL;
- g_mutex_unlock (ccad->mutex);
-
- return password;
-}
-
-
static gpointer
open_async (gpointer data)
{
ECalAsyncData *ccad = data;
-
- ccad->mutex = g_mutex_new ();
- ccad->cond = g_cond_new ();
-
- ccad->real_auth_func = ccad->ecal->priv->auth_func;
- ccad->real_auth_user_data = ccad->ecal->priv->auth_user_data;
- ccad->ecal->priv->auth_func = async_auth_func_cb;
- ccad->ecal->priv->auth_user_data = ccad;
ccad->result = open_calendar (ccad->ecal, ccad->exists, NULL, &ccad->status);
g_idle_add ((GSourceFunc) async_signal_idle_cb, ccad);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]