From c40b2e130b559caf90cf737977edba1f5703efc9 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 21 Sep 2015 13:18:47 +0200 Subject: LDAP: Save connection time from LDAP provider Whenever a connection request ends successfully, store the success time to the sdap_id_conn_ctx. --- src/providers/ldap/ldap_common.h | 2 ++ src/providers/ldap/sdap_id_op.c | 1 + 2 files changed, 3 insertions(+) diff --git a/src/providers/ldap/ldap_common.h b/src/providers/ldap/ldap_common.h index f552520a0..2e060f0ba 100644 --- a/src/providers/ldap/ldap_common.h +++ b/src/providers/ldap/ldap_common.h @@ -57,6 +57,8 @@ struct sdap_id_conn_ctx { struct sdap_id_conn_ctx *prev, *next; /* do not go offline, try another connection */ bool ignore_mark_offline; + /* time of last successfull connection */ + time_t conn_time; }; struct sdap_id_ctx { diff --git a/src/providers/ldap/sdap_id_op.c b/src/providers/ldap/sdap_id_op.c index 0474a9cb7..6d8cdc384 100644 --- a/src/providers/ldap/sdap_id_op.c +++ b/src/providers/ldap/sdap_id_op.c @@ -773,6 +773,7 @@ static void sdap_id_op_connect_req_complete(struct sdap_id_op *op, int dp_error, state->result = ret; if (ret == EOK) { + op->conn_data->conn_cache->id_conn->conn_time = time(NULL); tevent_req_done(req); } else { sdap_id_op_hook_conn_data(op, NULL); -- cgit