diff options
author | Sumit Bose <sbose@redhat.com> | 2013-06-03 10:40:12 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-06-04 17:24:13 +0200 |
commit | af4027dd2759c73cde55b55fe9e1248089e8a42c (patch) | |
tree | 0a3f6562755c059c0f89eebe819e6ba3be5b4a44 | |
parent | 044aff9bd41e0126b89f1ad672e196c3aa1654b7 (diff) | |
download | sssd-af4027dd2759c73cde55b55fe9e1248089e8a42c.tar.gz sssd-af4027dd2759c73cde55b55fe9e1248089e8a42c.tar.bz2 sssd-af4027dd2759c73cde55b55fe9e1248089e8a42c.zip |
Use queue for get_subdomains
It does not make much sense to run multiple get_subdomains request in
parallel because all requests will load the same information from the
server. The IPA and AD provider already implement a short timeout to
avoid the multiple requests are running to fast after each other. But if
the timeout is over chances are that if two or more request come in fast
the first request cannot update the timeout and request will run in
parallel. To avoid this the requests are queued and send one after the
other to the provider.
-rw-r--r-- | src/providers/data_provider_be.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index 1d61a88b..f3b50af7 100644 --- a/src/providers/data_provider_be.c +++ b/src/providers/data_provider_be.c @@ -496,6 +496,8 @@ static void get_subdomains_callback(struct be_req *req, dp_err_type, errnum, errstr?errstr:"<NULL>", dp_pam_err_to_string(req, dp_err_type, errnum))); + be_queue_next_request(req, BET_SUBDOMAINS); + reply = (DBusMessage *)req->pvt; if (reply) { @@ -629,9 +631,11 @@ static int be_get_subdomains(DBusMessage *message, struct sbus_connection *conn) be_req->req_data = req; - ret = be_file_request(becli->bectx, - be_req, - becli->bectx->bet_info[BET_SUBDOMAINS].bet_ops->handler); + ret = be_queue_request(becli->bectx, + &becli->bectx->bet_info[BET_SUBDOMAINS].req_queue, + becli->bectx, + be_req, + becli->bectx->bet_info[BET_SUBDOMAINS].bet_ops->handler); if (ret != EOK) { err_maj = DP_ERR_FATAL; err_min = ret; |