diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-08-09 21:56:34 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-10-26 10:29:39 -0400 |
commit | 0d2af200576ae2fb9bd04e2762d62d4d7e0eb4b9 (patch) | |
tree | 9a401871594ea5008bffd0b56169d09a162b7718 /src/responder | |
parent | 62ada364bee87a0a910490f174e974c19b330791 (diff) | |
download | sssd-0d2af200576ae2fb9bd04e2762d62d4d7e0eb4b9.tar.gz sssd-0d2af200576ae2fb9bd04e2762d62d4d7e0eb4b9.tar.xz sssd-0d2af200576ae2fb9bd04e2762d62d4d7e0eb4b9.zip |
Do not delete requests inside hash_iterate loop
Diffstat (limited to 'src/responder')
-rw-r--r-- | src/responder/common/responder_dp.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/responder/common/responder_dp.c b/src/responder/common/responder_dp.c index 8050e06f8..a89425c43 100644 --- a/src/responder/common/responder_dp.c +++ b/src/responder/common/responder_dp.c @@ -107,22 +107,24 @@ static int sss_dp_req_destructor(void *ptr) return 0; } -static bool reconnect_handler(hash_entry_t *item, void *user_data) -{ - struct sss_dp_req *sdp_req = talloc_get_type(item->value.ptr, - struct sss_dp_req); - - return (talloc_free(sdp_req) == EOK ? true : false); -} - void handle_requests_after_reconnect(void) { int ret; + hash_value_t *values; + unsigned long count, i; + struct sss_dp_req *sdp_req; - ret = hash_iterate(dp_requests, reconnect_handler, NULL); + ret = hash_values(dp_requests, &count, &values); if (ret != HASH_SUCCESS) { - DEBUG(1, ("hash_iterate failed, " + DEBUG(1, ("hash_values failed, " "not all request might be handled after reconnect.\n")); + return; + } + + DEBUG(7, ("Will handle %lu requests after reconnect\n", count)); + for (i=0; i<count; i++) { + sdp_req = talloc_get_type(values[i].ptr, struct sss_dp_req); + talloc_free(sdp_req); } } |