lib_LTLIBRARIES = libblade.la
libblade_la_SOURCES = src/blade.c src/blade_stack.c
libblade_la_SOURCES += src/blade_transportmgr.c src/blade_rpcmgr.c src/blade_routemgr.c src/blade_subscriptionmgr.c
-libblade_la_SOURCES += src/blade_upstreammgr.c src/blade_mastermgr.c src/blade_connectionmgr.c src/blade_sessionmgr.c
+libblade_la_SOURCES += src/blade_mastermgr.c src/blade_connectionmgr.c src/blade_sessionmgr.c
libblade_la_SOURCES += src/blade_identity.c src/blade_rpc.c src/blade_connection.c src/blade_session.c
-libblade_la_SOURCES += src/blade_protocol.c src/blade_subscription.c
+libblade_la_SOURCES += src/blade_protocol.c src/blade_subscription.c src/blade_channel.c
libblade_la_SOURCES += src/blade_transport.c src/blade_transport_wss.c
libblade_la_CFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
library_includedir = $(prefix)/include
library_include_HEADERS = src/include/blade.h src/include/blade_types.h src/include/blade_stack.h
library_include_HEADERS += src/include/blade_transportmgr.h src/include/blade_rpcmgr.h src/include/blade_routemgr.h src/include/blade_subscriptionmgr.h
-library_include_HEADERS += src/include/blade_upstreammgr.h src/include/blade_mastermgr.h src/include/blade_connectionmgr.h src/include/blade_sessionmgr.h
+library_include_HEADERS += src/include/blade_mastermgr.h src/include/blade_connectionmgr.h src/include/blade_sessionmgr.h
library_include_HEADERS += src/include/blade_identity.h src/include/blade_rpc.h src/include/blade_connection.h src/include/blade_session.h
-library_include_HEADERS += src/include/blade_protocol.h src/include/blade_subscription.h
+library_include_HEADERS += src/include/blade_protocol.h src/include/blade_subscription.h src/include/blade_channel.h
library_include_HEADERS += src/include/blade_transport.h src/include/blade_transport_wss.h
library_include_HEADERS += src/include/unqlite.h test/tap.h
KS_DECLARE(ks_status_t) blade_mastermgr_startup(blade_mastermgr_t *bmmgr, config_setting_t *config)
{
- ks_pool_t *pool = NULL;
-
ks_assert(bmmgr);
- pool = ks_pool_get(bmmgr);
-
if (blade_mastermgr_config(bmmgr, config) != KS_STATUS_SUCCESS) {
ks_log(KS_LOG_DEBUG, "blade_mastermgr_config failed\n");
return KS_STATUS_FAIL;
KS_DECLARE(ks_status_t) blade_mastermgr_protocol_controller_remove(blade_mastermgr_t *bmmgr, const char *protocol, const char *controller)
{
ks_status_t ret = KS_STATUS_SUCCESS;
- ks_pool_t *pool = NULL;
blade_protocol_t *bp = NULL;
ks_bool_t remove = KS_FALSE;
ks_assert(protocol);
ks_assert(controller);
- pool = ks_pool_get(bmmgr);
-
ks_hash_write_lock(bmmgr->protocols);
bp = (blade_protocol_t *)ks_hash_search(bmmgr->protocols, (void *)protocol, KS_UNLOCKED);
ks_assert(bp);
ks_assert(controller);
- ret = (ks_bool_t)(uintptr_t)ks_hash_search(bp->controllers, controller, KS_READLOCKED);
+ ret = (ks_bool_t)(uintptr_t)ks_hash_search(bp->controllers, (void *)controller, KS_READLOCKED);
ks_hash_read_unlock(bp->controllers);
return ret;
/*
* Copyright (c) 2017, Shane Bryldt
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* * Neither the name of the original author; nor the names of any contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
- *
+ *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
blade_routemgr_t *brmgr = NULL;
ks_assert(brmgrP);
-
+
ks_pool_open(&pool);
ks_assert(pool);
ks_rwl_read_lock(brmgr->local_lock);
if (brmgr->local_nodeid) bs = blade_sessionmgr_session_lookup(blade_handle_sessionmgr_get(brmgr->handle), brmgr->local_nodeid);
-
+
ks_rwl_read_unlock(brmgr->local_lock);
return bs;
ks_assert(key);
ks_rwl_read_lock(brmgr->master_lock);
-
+
if (brmgr->master_nodeid) {
ret = KS_TRUE;
cJSON_AddStringToObject(json, key, brmgr->master_nodeid);
// blade CoreRPC's to route to the known master node, but is also used to pass to downstream nodes
// when they connect
}
-
+
ks_rwl_read_unlock(brmgr->master_lock);
return ret;
if (value && !ks_safe_strcasecmp(value, target)) {
if (!cleanup) ks_hash_create(&cleanup, KS_HASH_MODE_CASE_INSENSITIVE, KS_HASH_FLAG_NOLOCK | KS_HASH_FLAG_DUP_CHECK, ks_pool_get(brmgr));
- ks_hash_insert(cleanup, (const void *)key, (void *)value);
+ ks_hash_insert(cleanup, (void *)key, (void *)value);
}
}