qb_log (LOG_ERR, "got %s error, disconnecting.",
cs_strerror(error));
votequorum_finalize(vq_handle);
- qb_loop_poll_del (ta_poll_handle_get(), fd);
- close (fd);
vq_handle = 0;
return -1;
}
qb_log (LOG_ERR, "got %s error, disconnecting.",
cs_strerror(error));
quorum_finalize(q_handle);
- qb_loop_poll_del (ta_poll_handle_get(), fd);
- close (fd);
q_handle = 0;
return -1;
}
return ret;
}
-static void lib_init (int sock)
-{
- int ret;
- char response[100];
-
- snprintf (response, 100, "%s", OK_STR);
- ret = q_lib_init ();
-
- if (ret != CS_OK) {
- snprintf (response, 100, "%s", FAIL_STR);
- qb_log (LOG_ERR, "q_lib_init FAILED: %d", ret);
- }
-
- send (sock, response, strlen (response), 0);
-}
-
static void getinfo (int sock)
{
int ret;
{
char response[100];
char *cmp;
+ cs_error_t rc1;
+ cs_error_t rc2;
snprintf (response, 100, "%s", OK_STR);
- votequorum_context_set (vq_handle, response);
- votequorum_context_get (vq_handle, (void**)&cmp);
+ rc1 = votequorum_context_set (vq_handle, response);
+ rc2 = votequorum_context_get (vq_handle, (void**)&cmp);
if (response != cmp) {
snprintf (response, 100, "%s", FAIL_STR);
- qb_log (LOG_ERR, "votequorum context not the same");
+ qb_log (LOG_ERR, "votequorum context not the same %d %d",
+ rc1, rc2);
}
- quorum_context_set (q_handle, response);
- quorum_context_get (q_handle, (const void**)&cmp);
+ rc1 = quorum_context_set (q_handle, response);
+ rc2 = quorum_context_get (q_handle, (const void**)&cmp);
if (response != cmp) {
snprintf (response, 100, "%s", FAIL_STR);
- qb_log (LOG_ERR, "quorum context not the same");
+ qb_log (LOG_ERR, "quorum context not the same %d %d",
+ rc1, rc2);
}
send (sock, response, strlen (response) + 1, 0);
}
{
char response[100];
+ q_lib_init ();
+
qb_log (LOG_INFO,"RPC:%s() called.", func);
if (strcmp ("votequorum_getinfo", func) == 0) {
setexpected (sock, args[0]);
} else if (strcmp ("quorum_getquorate", func) == 0) {
getquorate (sock);
- } else if (strcmp ("init", func) == 0) {
- lib_init (sock);
} else if (strcmp ("context_test", func) == 0) {
context_test (sock);
- } else if (strcmp ("are_you_ok_dude", func) == 0) {
+ } else if (strcmp ("are_you_ok_dude", func) == 0 ||
+ strcmp ("init", func) == 0) {
snprintf (response, 100, "%s", OK_STR);
send (sock, response, strlen (response) + 1, 0);
} else {