summaryrefslogtreecommitdiff
path: root/server/responder/common/responder_dp.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-11-19 16:37:51 -0500
committerStephen Gallagher <sgallagh@redhat.com>2009-11-23 12:46:30 -0500
commit64e5787639836a49ddc589eda65be454c4bdff58 (patch)
tree75fdc5923cd6854547be1cdd62110a0bd602aaab /server/responder/common/responder_dp.c
parent23341562c1cd4baf46cbc4eacaa09d6b6cb00e82 (diff)
downloadsssd-64e5787639836a49ddc589eda65be454c4bdff58.tar.gz
sssd-64e5787639836a49ddc589eda65be454c4bdff58.tar.bz2
sssd-64e5787639836a49ddc589eda65be454c4bdff58.zip
Speed up user requests while offline
This adds a new boolean option to sss_dp_send_acct_req() called fast_reply. If we make a request to the backends and we are currently offline, this option will determine whether we should immediately return from the cache (acceptable for NSS requests) or potentially wait for an online check to complete (required for PAM requests).
Diffstat (limited to 'server/responder/common/responder_dp.c')
-rw-r--r--server/responder/common/responder_dp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/responder/common/responder_dp.c b/server/responder/common/responder_dp.c
index 943b72c5..03e83ec6 100644
--- a/server/responder/common/responder_dp.c
+++ b/server/responder/common/responder_dp.c
@@ -243,7 +243,8 @@ static int sss_dp_send_acct_req_create(struct resp_ctx *rctx,
int sss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *callback_memctx,
sss_dp_callback_t callback, void *callback_ctx,
- int timeout, const char *domain, int type,
+ int timeout, const char *domain,
+ bool fast_reply, int type,
const char *opt_name, uint32_t opt_id)
{
int ret, hret;
@@ -279,6 +280,10 @@ int sss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *callback_memctx,
return EINVAL;
}
+ if (fast_reply) {
+ be_type |= BE_REQ_FAST;
+ }
+
if (dp_requests == NULL) {
/* Create a hash table to handle queued update requests */
ret = hash_create(10, &dp_requests, NULL);