- implement xstring by librtti
This commit is contained in:
parent
15fac3cda1
commit
ce69347581
7 changed files with 250 additions and 95 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "objmgr.h"
|
||||
#include "request.h"
|
||||
#include "xce/types.h"
|
||||
#include "xstring.h"
|
||||
|
||||
static int xce_apiserver_push_configs(cluster_t* c, endpoint_t* ep)
|
||||
{
|
||||
|
|
@ -603,9 +604,8 @@ int add_apiserver(cluster_t* c, char* name, endpoint_t* ep)
|
|||
|
||||
for (i = 0; i < N_APISERVER_MAX; i++) {
|
||||
if (c->apiservers[i].name == NULL) {
|
||||
c->apiservers[i].name
|
||||
= create_obj_by_typename(&(c->objmgr), "xstring", name);
|
||||
c->apiservers[i].ep = ep;
|
||||
c->apiservers[i].name = makeString(name);
|
||||
c->apiservers[i].ep = ep;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -514,6 +514,8 @@ int cluster_init(cluster_t* c)
|
|||
|
||||
iomgr_set_ssl_ctx(&(c->iomgr), ssl_ctx);
|
||||
|
||||
xstring_table_init(c->myconf->cluster_config->xstrings->nhash_slots);
|
||||
|
||||
register_xstring(&(c->objmgr),
|
||||
c->myconf->cluster_config->xstrings->nhash_slots,
|
||||
c->myconf->cluster_config->xstrings->delta);
|
||||
|
|
@ -583,7 +585,7 @@ static int check_worker_timeout_(void* arg1, void* arg2)
|
|||
if (w1 == NULL) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
config = c->myconf->cluster_config;
|
||||
timeout = config->heartbeat_interval * config->inactive_heartbeat_count;
|
||||
|
||||
|
|
@ -712,5 +714,7 @@ void cluster_fini(cluster_t* c)
|
|||
|
||||
cleanup_openssl();
|
||||
|
||||
xstring_table_fini();
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ incdir = include_directories('.', '../include', '../lib',
|
|||
|
||||
controller_deps = [
|
||||
libxce_dep,
|
||||
librtti_dep,
|
||||
c_capnproto_dep,
|
||||
math_dep,
|
||||
tinylog_dep,
|
||||
|
|
@ -48,6 +49,7 @@ history_dep = dependency('history')
|
|||
|
||||
xce_test_deps = [
|
||||
libxce_dep,
|
||||
librtti_dep,
|
||||
struct2json_dep,
|
||||
readline_dep,
|
||||
history_dep,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue