[evolution-patches] ldap and groupwise book.cancel




I've already committed this, just sending the patch fyi incase i rooted it up.

Implements 'cancel' which is a fix/workaround for the 'load images if sender is in addressbook' issues (or at least the one i could recreate).  Some ldap queries seem to never come back from some servers, and with no timeout, it means it never fails.  Perhaps the code should be doing search_ext with a timeout?

--
Michael Zucchi <notzed ximian com>

Ximian Evolution and Free Software Developer
? addressbook/c.diff
? addressbook/libedata-book/a.diff
Index: addressbook/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/ChangeLog,v
retrieving revision 1.159
diff -u -3 -r1.159 ChangeLog
--- addressbook/ChangeLog	15 Jun 2004 10:11:20 -0000	1.159
+++ addressbook/ChangeLog	16 Jun 2004 06:09:09 -0000
@@ -1,3 +1,14 @@
+2004-06-16  Not Zed  <NotZed Ximian com>
+
+	* backends/groupwise/e-book-backend-groupwise.c
+	(e_book_backend_groupwise_cancel_operation): implement, noop
+	currently.  Saves an assert exploding the server.
+
+	* backends/ldap/e-book-backend-ldap.c
+	(e_book_backend_ldap_cancel_operation): implement.
+	(ldap_cancel_op): cancel each operation synchronously (?).
+	Related to #56479.
+
 2004-06-15 Sivaiah Nallagatla <snallagatla novell com>
 
 	* backends/groupwise/e-book-backend-groupwise.c 
Index: addressbook/backends/groupwise/e-book-backend-groupwise.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/backends/groupwise/e-book-backend-groupwise.c,v
retrieving revision 1.21
diff -u -3 -r1.21 e-book-backend-groupwise.c
--- addressbook/backends/groupwise/e-book-backend-groupwise.c	15 Jun 2004 10:11:20 -0000	1.21
+++ addressbook/backends/groupwise/e-book-backend-groupwise.c	16 Jun 2004 06:09:10 -0000
@@ -2056,7 +2056,12 @@
 						  fields);
  
 }
-  
+
+static GNOME_Evolution_Addressbook_CallStatus
+e_book_backend_groupwise_cancel_operation (EBookBackend *backend, EDataBook *book)
+{
+	return GNOME_Evolution_Addressbook_CouldNotCancel;
+}
 
 static GNOME_Evolution_Addressbook_CallStatus
 e_book_backend_groupwise_load_source (EBookBackend           *backend,
@@ -2241,6 +2246,7 @@
 	parent_class->authenticate_user       = e_book_backend_groupwise_authenticate_user;
 	parent_class->get_supported_fields    = e_book_backend_groupwise_get_supported_fields;
 	parent_class->get_supported_auth_methods = e_book_backend_groupwise_get_supported_auth_methods;
+	parent_class->cancel_operation        = e_book_backend_groupwise_cancel_operation;
 	parent_class->remove                  = e_book_backend_groupwise_remove;
 	object_class->dispose                 = e_book_backend_groupwise_dispose;
 }
Index: addressbook/backends/ldap/e-book-backend-ldap.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/backends/ldap/e-book-backend-ldap.c,v
retrieving revision 1.23
diff -u -3 -r1.23 e-book-backend-ldap.c
--- addressbook/backends/ldap/e-book-backend-ldap.c	10 Jun 2004 03:05:08 -0000	1.23
+++ addressbook/backends/ldap/e-book-backend-ldap.c	16 Jun 2004 06:09:11 -0000
@@ -3273,6 +3273,28 @@
 						     bl->priv->supported_auth_methods);
 }
 
+static void
+ldap_cancel_op(void *key, void *value, void *data)
+{
+	EBookBackendLDAP *bl = data;
+	LDAPOp *op = value;
+
+	/* ignore errors, its only best effort? */
+	ldap_abandon_ext (bl->priv->ldap, op->id, NULL, NULL);
+}
+
+static GNOME_Evolution_Addressbook_CallStatus
+e_book_backend_ldap_cancel_operation (EBookBackend *backend, EDataBook *book)
+{
+	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
+
+	g_static_rec_mutex_lock (&bl->priv->op_hash_mutex);
+	g_hash_table_foreach (bl->priv->id_to_op, ldap_cancel_op, bl);
+	g_static_rec_mutex_unlock (&bl->priv->op_hash_mutex);
+
+	return GNOME_Evolution_Addressbook_Success;
+}
+
 static GNOME_Evolution_Addressbook_CallStatus
 e_book_backend_ldap_load_source (EBookBackend             *backend,
 				 ESource                  *source,
@@ -3457,6 +3479,7 @@
 	parent_class->authenticate_user       = e_book_backend_ldap_authenticate_user;
 	parent_class->get_supported_fields    = e_book_backend_ldap_get_supported_fields;
 	parent_class->get_supported_auth_methods = e_book_backend_ldap_get_supported_auth_methods;
+	parent_class->cancel_operation	      = e_book_backend_ldap_cancel_operation;
 
 	object_class->dispose = e_book_backend_ldap_dispose;
 }


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