Skip to content

Commit

Permalink
Fix: mgmtd: Keep the cached cib if a request is from the same crm_gui…
Browse files Browse the repository at this point in the history
… client (bsc#951634)
  • Loading branch information
gao-yan committed Jan 14, 2016
1 parent 5f0035e commit 4b2491d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions mgmt/daemon/mgmt_crm.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,17 +719,25 @@ final_crm(void)
int
set_crm(void)
{
free_cib_cached();
cib_t* cib_conn_old = cib_conn;

cib_conn = g_hash_table_lookup(cib_conns, client_id);

if (cib_conn == NULL || cib_conn != cib_conn_old) {
free_cib_cached();
}

if (cib_conn != NULL) {
const char *env = g_hash_table_lookup(cib_envs, cib_conn);
if (env == NULL) {
unsetenv("CIB_shadow");
} else {
setenv("CIB_shadow", env, 1);
}
mgmt_debug(LOG_DEBUG, "set_crm: client_id=%d cib_conn=%p cib_name=%s", *client_id, cib_conn, env);

if (cib_conn != cib_conn_old) {
mgmt_debug(LOG_DEBUG, "set_crm: client_id=%d cib_conn=%p cib_name=%s", *client_id, cib_conn, env);
}

return 0;
}
Expand Down

0 comments on commit 4b2491d

Please sign in to comment.