summaryrefslogtreecommitdiff
path: root/server/providers
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-09-25 11:08:22 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-09-25 12:58:47 -0400
commit039ccb42e498a92f877a3e91cada515ce08926fb (patch)
tree47bf8d2f95b114f6af19eb535162eb3c634ba3c4 /server/providers
parent9e821019e8db89e0f3c408f1c6eb583f89f26a88 (diff)
downloadsssd-039ccb42e498a92f877a3e91cada515ce08926fb.tar.gz
sssd-039ccb42e498a92f877a3e91cada515ce08926fb.tar.bz2
sssd-039ccb42e498a92f877a3e91cada515ce08926fb.zip
Let backend respond while fetching large results
Timers always come before fd events, wait 5 microseconds between processing operations so that tevent has a chance of cactching an fd event in between. This allows the backend to reply to pings even while processing very large ldap results (importanty especially during the first enumeration).
Diffstat (limited to 'server/providers')
-rw-r--r--server/providers/ldap/sdap_async.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c
index 6ab88679..16511748 100644
--- a/server/providers/ldap/sdap_async.c
+++ b/server/providers/ldap/sdap_async.c
@@ -298,7 +298,7 @@ static void sdap_process_message(struct tevent_context *ev,
static void sdap_unlock_next_reply(struct sdap_op *op)
{
- struct timeval no_timeout = {0, 0};
+ struct timeval tv;
struct tevent_timer *te;
struct sdap_msg *next_reply;
@@ -311,7 +311,16 @@ static void sdap_unlock_next_reply(struct sdap_op *op)
/* if there are still replies to parse, queue a new operation */
if (op->list) {
- te = tevent_add_timer(op->ev, op, no_timeout,
+ /* use a very small timeout, so that fd operations have a chance to be
+ * served while processing a long reply */
+ tv = tevent_timeval_current();
+
+ /* wait 5 microsecond */
+ tv.tv_usec += 5;
+ tv.tv_sec += tv.tv_usec / 1000000;
+ tv.tv_usec = tv.tv_usec % 1000000;
+
+ te = tevent_add_timer(op->ev, op, tv,
sdap_process_next_reply, op);
if (!te) {
DEBUG(1, ("Failed to add critical timer for next reply!\n"));