summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreindenbom <eindenbom@gmail.com>2010-07-02 11:40:57 +0400
committerStephen Gallagher <sgallagh@redhat.com>2010-07-09 11:44:07 -0400
commit801fcc63a9ec83d76d8d027758f9a0357b34890f (patch)
tree0eeadf70df6a5014dd500f568b3b9243360670a0
parentcab4c5011d0dc6d98e2115f46b1185a17804df49 (diff)
downloadsssd-801fcc63a9ec83d76d8d027758f9a0357b34890f.tar.gz
sssd-801fcc63a9ec83d76d8d027758f9a0357b34890f.tar.xz
sssd-801fcc63a9ec83d76d8d027758f9a0357b34890f.zip
Eliminate delayed sdap_handle destruction after fail-over retry.
-rw-r--r--src/providers/ldap/sdap_async_connection.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index 2be0af2..3770fea 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -138,6 +138,7 @@ struct tevent_req *sdap_connect_send(TALLOC_CTX *memctx,
/* if we do not use start_tls the connection is not really connected yet
* just fake an async procedure and leave connection to the bind call */
if (!use_start_tls) {
+ tevent_req_done(req);
tevent_req_post(req, ev);
return req;
}
@@ -257,16 +258,8 @@ int sdap_connect_recv(struct tevent_req *req,
{
struct sdap_connect_state *state = tevent_req_data(req,
struct sdap_connect_state);
- enum tevent_req_state tstate;
- uint64_t err = EIO;
- if (tevent_req_is_error(req, &tstate, &err)) {
- /* if tstate shows in progress, it is because
- * we did not ask to perform tls, just pretend all is fine */
- if (tstate != TEVENT_REQ_IN_PROGRESS) {
- return err;
- }
- }
+ TEVENT_REQ_RETURN_ON_ERROR(req);
*sh = talloc_steal(memctx, state->sh);
if (!*sh) {
@@ -919,6 +912,9 @@ static int sdap_cli_resolve_next(struct tevent_req *req)
struct sdap_cli_connect_state);
struct tevent_req *subreq;
+ /* Before stepping to next server destroy any connection from previous attempt */
+ talloc_zfree(state->sh);
+
/* NOTE: this call may cause service->uri to be refreshed
* with a new valid server. Do not use service->uri before */
subreq = be_resolve_server_send(state, state->ev,
@@ -968,6 +964,7 @@ static void sdap_cli_connect_done(struct tevent_req *subreq)
const char *sasl_mech;
int ret;
+ talloc_zfree(state->sh);
ret = sdap_connect_recv(subreq, state, &state->sh);
talloc_zfree(subreq);
if (ret) {