aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-08-20 06:34:25 +0800
committerChris Toshok <toshok@src.gnome.org>2002-08-20 06:34:25 +0800
commit78305f0bea5f65fb18b6e185e399465806c68b2a (patch)
tree63acc788193fd79e3761548b2982b0a5bc205446
parent1c97f91cc4acd3b33f78740892726507211215f5 (diff)
downloadgsoc2013-evolution-78305f0bea5f65fb18b6e185e399465806c68b2a.tar
gsoc2013-evolution-78305f0bea5f65fb18b6e185e399465806c68b2a.tar.gz
gsoc2013-evolution-78305f0bea5f65fb18b6e185e399465806c68b2a.tar.bz2
gsoc2013-evolution-78305f0bea5f65fb18b6e185e399465806c68b2a.tar.lz
gsoc2013-evolution-78305f0bea5f65fb18b6e185e399465806c68b2a.tar.xz
gsoc2013-evolution-78305f0bea5f65fb18b6e185e399465806c68b2a.tar.zst
gsoc2013-evolution-78305f0bea5f65fb18b6e185e399465806c68b2a.zip
add "cache-completions" here, since file completion results are blanket
2002-08-19 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-file.c (pas_backend_file_get_static_capabilities): add "cache-completions" here, since file completion results are blanket cached (as they're generated from a summary). * backend/pas/pas-backend-ldap.c (pas_backend_ldap_process_get_cursor): there should be no search limit on the get_cursor_request, as it's meant to match every card it can. (ldap_search_handler): parse the ldap result in the RES_SEARCH_RESULT case. we'll want more here soon, so we can notify the front end if the result was truncated due to either the size or time limit being exceeded. (pas_backend_ldap_process_get_book_view): in the case of a completion view, we hardcode (yeah yeah, i know, but really) the search limit to MIN (100, user-specified-limit). (pas_backend_ldap_search): each view has its own limit now, defaulting from the user specified one for normal searches but possibly different for completion views. use the view's limit here. svn path=/trunk/; revision=17811
-rw-r--r--addressbook/ChangeLog23
-rw-r--r--addressbook/backend/pas/pas-backend-file.c2
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.c19
3 files changed, 41 insertions, 3 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index a92016d810..0a8ddeacc9 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,26 @@
+2002-08-19 Chris Toshok <toshok@ximian.com>
+
+ * backend/pas/pas-backend-file.c
+ (pas_backend_file_get_static_capabilities): add
+ "cache-completions" here, since file completion results are
+ blanket cached (as they're generated from a summary).
+
+ * backend/pas/pas-backend-ldap.c
+ (pas_backend_ldap_process_get_cursor): there should be no search
+ limit on the get_cursor_request, as it's meant to match every card
+ it can.
+ (ldap_search_handler): parse the ldap result in the
+ RES_SEARCH_RESULT case. we'll want more here soon, so we can
+ notify the front end if the result was truncated due to either the
+ size or time limit being exceeded.
+ (pas_backend_ldap_process_get_book_view): in the case of a
+ completion view, we hardcode (yeah yeah, i know, but really) the
+ search limit to MIN (100, user-specified-limit).
+ (pas_backend_ldap_search): each view has its own limit now,
+ defaulting from the user specified one for normal searches but
+ possibly different for completion views. use the view's limit
+ here.
+
2002-08-19 Dan Winship <danw@ximian.com>
* gui/component/select-names/e-select-names-bonobo.c
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index c0d03d6b5d..fe14be3f07 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -1584,7 +1584,7 @@ pas_backend_file_remove_client (PASBackend *backend,
static char *
pas_backend_file_get_static_capabilities (PASBackend *backend)
{
- return g_strdup("local,do-initial-query");
+ return g_strdup("local,do-initial-query,cache-completions");
}
static gboolean
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c
index 8ea22275c3..296bb8797a 100644
--- a/addressbook/backend/pas/pas-backend-ldap.c
+++ b/addressbook/backend/pas/pas-backend-ldap.c
@@ -140,6 +140,7 @@ struct _PASBackendLDAPBookView {
PASBackendLDAPPrivate *blpriv;
gchar *search;
PASBackendCardSExp *card_sexp;
+ int limit;
LDAPOp *search_op;
};
@@ -1793,7 +1794,7 @@ pas_backend_ldap_process_get_cursor (PASBackend *backend,
"(objectclass=*)",
NULL, 0,
NULL, NULL, NULL, /* timeout */
- bl->priv->ldap_limit, &get_cursor_msgid);
+ 0, &get_cursor_msgid);
} while (pas_backend_ldap_reconnect (bl, book_view, ldap_error));
if (ldap_error == LDAP_SUCCESS) {
@@ -2760,6 +2761,13 @@ ldap_search_handler (LDAPOp *op, LDAPMessage *res)
}
}
else if (msg_type == LDAP_RES_SEARCH_RESULT) {
+ int ldap_error;
+
+ ldap_parse_result (ldap, res, &ldap_error,
+ NULL, NULL, NULL, NULL, 0);
+
+ g_warning ("search returned %d\n", ldap_error);
+
/* the entry that marks the end of our search */
if (search_op->num_pending_adds)
send_pending_adds (search_op);
@@ -2812,7 +2820,7 @@ pas_backend_ldap_search (PASBackendLDAP *bl,
NULL, /* XXX */
NULL, /* XXX */
NULL, /* XXX timeout */
- bl->priv->ldap_limit, &search_msgid);
+ view->limit, &search_msgid);
} while (pas_backend_ldap_reconnect (bl, view->book_view, ldap_err));
g_free (ldap_query);
@@ -2876,6 +2884,13 @@ pas_backend_ldap_process_get_book_view (PASBackend *backend,
view->card_sexp = pas_backend_card_sexp_new (view->search);
view->blpriv = bl->priv;
+ if (req->op == GetCompletionView) {
+ view->limit = MIN (bl->priv->ldap_limit, 100);
+ }
+ else {
+ view->limit = bl->priv->ldap_limit;
+ }
+
bl->priv->book_views = g_list_prepend(bl->priv->book_views, view);
pas_book_respond_get_book_view (book,