>From e425fa10751a3731a62e4055ea3a24fff8434e2c Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Mon, 3 Jun 2013 10:40:12 +0200 Subject: [PATCH 3/3] 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. --- src/providers/data_provider_be.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index 1d61a88b78398bbfc2c4a0e8ca9434f4fb0049f7..f3b50af7e14ac2adc4dd2b061bdc960a709d5a65 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:"", 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; -- 1.8.2.1