FS-9952: Committing to show problem with ks_pool_resize

This commit is contained in:
Shane Bryldt authored and Mike Jerris committed 2017-03-22 17:42:50 -04:00
1 parent d6d8ede6b9
commit a7add33519
7 files changed
+269 -136

No files matched your search

+25 -4
View File
@@ -30,12 +30,14 @@ void command_test(blade_handle_t *bh, char *args);
void command_quit(blade_handle_t *bh, char *args);
void command_store(blade_handle_t *bh, char *args);
void command_fetch(blade_handle_t *bh, char *args);
void command_connect(blade_handle_t *bh, char *args);
static const struct command_def_s command_defs[] = {
{ "test", command_test },
{ "quit", command_quit },
{ "store", command_store },
{ "fetch", command_fetch },
{ "connect", command_connect },
{ NULL, NULL }
};
@@ -47,6 +49,8 @@ int main(int argc, char **argv)
config_setting_t *config_blade = NULL;
blade_module_t *mod_wss = NULL;
//blade_identity_t *id = NULL;
const char *cfgpath = "bladec.cfg";
ks_global_set_default_logger(KS_LOG_LEVEL_DEBUG);
@@ -54,12 +58,10 @@ int main(int argc, char **argv)
blade_handle_create(&bh, NULL, NULL);
//blade_identity_create(&id, blade_handle_pool_get(bh));
//blade_identity_parse(id, "test@domain.com/laptop?transport=wss&host=127.0.0.1&port=1234");
if (argc > 1) cfgpath = argv[1];
// @todo load config file, and lookup "blade" setting to put into config_blade
config_init(&config);
if (!config_read_file(&config, "bladec.cfg")) {
if (!config_read_file(&config, cfgpath)) {
ks_log(KS_LOG_ERROR, "%s:%d - %s\n", config_error_file(&config), config_error_line(&config), config_error_text(&config));
config_destroy(&config);
return EXIT_FAILURE;
@@ -91,6 +93,10 @@ int main(int argc, char **argv)
loop(bh);
blade_module_wss_on_shutdown(mod_wss);
blade_module_wss_on_unload(mod_wss);
blade_handle_destroy(&bh);
blade_shutdown();
@@ -236,3 +242,18 @@ void command_fetch(blade_handle_t *bh, char *args)
blade_handle_datastore_fetch(bh, blade_datastore_fetch_callback, key, strlen(key), bh);
}
void command_connect(blade_handle_t *bh, char *args)
{
blade_connection_t *bc = NULL;
blade_identity_t *target = NULL;
ks_assert(bh);
ks_assert(args);
blade_identity_create(&target, blade_handle_pool_get(bh));
if (blade_identity_parse(target, args) == KS_STATUS_SUCCESS) blade_handle_connect(bh, &bc, target);
blade_identity_destroy(&target);
}
-18
View File
@@ -1,10 +1,6 @@
blade:
{
identity = "peer@domain";
directory:
{
uris = ( "directory@domain?transport=wss&host=127.0.0.1&port=2100" );
};
datastore:
{
database:
@@ -12,18 +8,4 @@ blade:
path = ":mem:";
};
};
wss:
{
endpoints:
{
ipv4 = ( { address = "0.0.0.0", port = 2101 } );
ipv6 = ( { address = "::", port = 2101 } );
backlog = 128;
};
# SSL group is optional, disabled when absent
ssl:
{
# todo: server SSL stuffs here
};
};
};