Lines Matching defs:op

94 static void sdap_id_op_hook_conn_data(struct sdap_id_op *op, struct sdap_id_conn_data *conn_data);
96 static bool sdap_id_op_can_reconnect(struct sdap_id_op *op);
98 static void sdap_id_op_connect_req_complete(struct sdap_id_op *op, int dp_error, int ret);
191 struct sdap_id_op *op;
194 while ((op = conn_data->ops) != NULL) {
195 op->conn_data = NULL;
196 DLIST_REMOVE(conn_data->ops, op);
293 struct sdap_id_op *op = talloc_zero(memctx, struct sdap_id_op);
294 if (!op) {
298 op->conn_cache = conn_cache;
300 talloc_set_destructor((void*)op, sdap_id_op_destroy);
301 return op;
305 static void sdap_id_op_hook_conn_data(struct sdap_id_op *op, struct sdap_id_conn_data *conn_data)
307 if (!op) {
308 DEBUG(SSSDBG_FATAL_FAILURE, "NULL op passed!!!\n");
312 struct sdap_id_conn_data *current = op->conn_data;
318 DLIST_REMOVE(current->ops, op);
321 op->conn_data = conn_data;
324 DLIST_ADD_END(conn_data->ops, op, struct sdap_id_op*);
335 struct sdap_id_op *op = talloc_get_type(pvt, struct sdap_id_op);
337 if (op->conn_data) {
339 sdap_id_op_hook_conn_data(op, NULL);
346 static bool sdap_id_op_can_reconnect(struct sdap_id_op *op)
354 count = be_fo_get_server_count(op->conn_cache->id_conn->id_ctx->be,
355 op->conn_cache->id_conn->service->name);
361 return op->reconnect_retry_count < max_retries;
368 struct sdap_id_op *op;
378 if (state->op != NULL) {
380 state->op->connect_req = NULL;
387 struct tevent_req *sdap_id_op_connect_send(struct sdap_id_op *op,
401 if (op->connect_req) {
417 state->id_conn = op->conn_cache->id_conn;
419 state->op = op;
420 op->connect_req = req;
422 if (op->conn_data) {
438 } else if (op->conn_data && !op->conn_data->connect_req) {
456 struct sdap_id_op *op = state->op;
457 struct sdap_id_conn_cache *conn_cache = op->conn_cache;
468 sdap_id_op_hook_conn_data(op, conn_data);
474 sdap_id_op_hook_conn_data(op, conn_data);
511 sdap_id_op_hook_conn_data(op, conn_data);
622 struct sdap_id_op *op;
629 DLIST_FOR_EACH(op, conn_data->ops) {
630 if (op->connect_req) {
635 if (!op) {
657 "skipping automatic retry on op #%d as be is offline\n", notify_count);
666 "attempting automatic retry on op #%d\n", notify_count);
668 } else if (sdap_id_op_can_reconnect(op)) {
670 "attempting failover retry on op #%d\n", notify_count);
671 op->reconnect_retry_count++;
677 if (retry && op->connect_req) {
678 int retry_ret = sdap_id_op_connect_step(op->connect_req);
681 sdap_id_op_connect_req_complete(op, DP_ERR_FATAL, retry_ret);
690 "notify connected to op #%d\n", notify_count);
691 sdap_id_op_connect_req_complete(op, DP_ERR_OK, ret);
693 DEBUG(SSSDBG_TRACE_ALL, "notify offline to op #%d\n", notify_count);
694 sdap_id_op_connect_req_complete(op, DP_ERR_OFFLINE, EAGAIN);
697 "notify error to op #%d: %d [%s]\n", notify_count, ret, strerror(ret));
698 sdap_id_op_connect_req_complete(op, DP_ERR_FATAL, ret);
760 static void sdap_id_op_connect_req_complete(struct sdap_id_op *op, int dp_error, int ret)
762 struct tevent_req *req = op->connect_req;
769 op->connect_req = NULL;
778 sdap_id_op_hook_conn_data(op, NULL);
807 int sdap_id_op_done(struct sdap_id_op *op, int retval, int *dp_err_out)
810 struct sdap_id_conn_data *current_conn = op->conn_data;
824 && current_conn == op->conn_cache->cached_connection) {
826 op->conn_cache->cached_connection = NULL;
830 be_fo_try_next_server(op->conn_cache->id_conn->id_ctx->be,
831 op->conn_cache->id_conn->service->name);
837 } else if (be_is_offline(op->conn_cache->id_conn->id_ctx->be)) {
845 if (!sdap_id_op_can_reconnect(op)) {
859 op->reconnect_retry_count++;
861 "advising for connection retry #%i\n", op->reconnect_retry_count);
864 op->reconnect_retry_count = 0;
869 sdap_id_op_hook_conn_data(op, NULL);
877 struct sdap_handle *sdap_id_op_handle(struct sdap_id_op *op)
879 return op && op->conn_data ? op->conn_data->sh : NULL;