diff options
author | Simo Sorce <simo@redhat.com> | 2012-03-07 18:05:06 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-03-09 14:22:49 -0500 |
commit | 5a05130ba12de25cceb51462c95f7a8082538328 (patch) | |
tree | 0d8468093ed59f777f4d61fe6220157509d2eddd /src/responder/common/responder_dp.c | |
parent | 24b34aaa810a1bf641f19b714a80f66f97f1b1a3 (diff) | |
download | sssd-5a05130ba12de25cceb51462c95f7a8082538328.tar.gz sssd-5a05130ba12de25cceb51462c95f7a8082538328.tar.xz sssd-5a05130ba12de25cceb51462c95f7a8082538328.zip |
Use the correct hash table for pending requests
The function that handled pending requests on reconnect was checking an
orphaned global variable that was never used, redenring the whole function
uselsess.
This fixes a very nasty bug that was causing requests for which we never
received an answer for (for example because the backend failed and was
restarted) to be never removed and therefore causing a black hole effect for
any other request of the same type.
Fixes: https://fedorahosted.org/sssd/ticket/1229
Diffstat (limited to 'src/responder/common/responder_dp.c')
-rw-r--r-- | src/responder/common/responder_dp.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/responder/common/responder_dp.c b/src/responder/common/responder_dp.c index a116fedd8..a54c68d7e 100644 --- a/src/responder/common/responder_dp.c +++ b/src/responder/common/responder_dp.c @@ -28,8 +28,6 @@ #include "providers/data_provider.h" #include "sbus/sbus_client.h" -hash_table_t *dp_requests = NULL; - struct sss_dp_req; struct sss_dp_callback { @@ -120,19 +118,19 @@ static int sss_dp_req_destructor(void *ptr) return 0; } -void handle_requests_after_reconnect(void) +void handle_requests_after_reconnect(struct resp_ctx *rctx) { int ret; hash_value_t *values; unsigned long count, i; struct sss_dp_req *sdp_req; - if (!dp_requests) { + if (!rctx->dp_request_table) { DEBUG(7, ("No requests to handle after reconnect\n")); return; } - ret = hash_values(dp_requests, &count, &values); + ret = hash_values(rctx->dp_request_table, &count, &values); if (ret != HASH_SUCCESS) { DEBUG(1, ("hash_values failed, " "not all request might be handled after reconnect.\n")); @@ -145,6 +143,7 @@ void handle_requests_after_reconnect(void) talloc_free(sdp_req); } } + static int sss_dp_get_reply(DBusPendingCall *pending, dbus_uint16_t *dp_err, dbus_uint32_t *dp_ret, |