Skip to content

Commit

Permalink
Added new deploy target for rsa_dfi example. Clean up some printf. Sp…
Browse files Browse the repository at this point in the history
…lit Celix DEBUG flag from civetweb DEBUG flag
  • Loading branch information
gricciardi committed Nov 17, 2016
1 parent 95c06ab commit e232322
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
5 changes: 0 additions & 5 deletions remote_services/discovery_etcd/private/src/etcd_watcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,26 +363,21 @@ celix_status_t etcdWatcher_create(discovery_pt discovery, bundle_context_pt cont

status = etcd_init((char*)etcd_server, etcd_port);

printf(" ININT\n");
if (status == CELIX_SUCCESS) {
etcdWatcher_addOwnFramework(*watcher);
status = celixThreadMutex_create(&(*watcher)->watcherLock, NULL);
printf(" 111\n");
}

if (status == CELIX_SUCCESS) {
if (celixThreadMutex_lock(&(*watcher)->watcherLock) == CELIX_SUCCESS) {
status = celixThread_create(&(*watcher)->watcherThread, NULL, etcdWatcher_run, *watcher);
if (status == CELIX_SUCCESS) {
printf(" STARTEDTSTARTED\n");
(*watcher)->running = true;
}
celixThreadMutex_unlock(&(*watcher)->watcherLock);
}
}


printf(" DONEDONE\n");
return status;
}

Expand Down
14 changes: 14 additions & 0 deletions remote_services/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ if (RSA_EXAMPLES)
BUNDLES org.apache.celix.calc.api.Calculator_proxy
)
endif ()

if (BUILD_RSA_DISCOVERY_ETCD AND BUILD_RSA_REMOTE_SERVICE_ADMIN_DFI)
add_deploy(remote-services-dfi
NAME "server"
GROUP "remote-services/remote-services-dfi"
BUNDLES discovery_etcd topology_manager remote_service_admin_dfi calculator shell shell_tui log_service log_writer
)

add_deploy("remote-services-dfi-client"
NAME "client"
GROUP "remote-services/remote-services-dfi"
BUNDLES topology_manager remote_service_admin_dfi shell shell_tui log_service log_writer calculator_shell discovery_etcd
)
endif ()
endif (RSA_EXAMPLES)


Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ celix_status_t importRegistration_create(bundle_context_pt context, endpoint_des
}

if (status == CELIX_SUCCESS) {
printf("IMPORT REGISTRATION IS %p\n", reg);
//printf("IMPORT REGISTRATION IS %p\n", reg);
*out = reg;
}
else{
Expand Down
10 changes: 5 additions & 5 deletions remote_services/utils/private/src/civetweb.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void *pthread_getspecific(pthread_key_t key)
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))

#if !defined(DEBUG_TRACE)
#if defined(DEBUG)
#if defined(CWDEBUG)

static void DEBUG_TRACE_FUNC(const char *func, unsigned line, PRINTF_FORMAT_STRING(const char *fmt), ...) PRINTF_ARGS(3, 4);

Expand All @@ -386,7 +386,7 @@ static void DEBUG_TRACE_FUNC(const char *func, unsigned line, const char *fmt, .

#else
#define DEBUG_TRACE(fmt, ...)
#endif /* DEBUG */
#endif /* CWDEBUG */
#endif /* DEBUG_TRACE */

#if defined(MEMORY_DEBUGGING)
Expand Down Expand Up @@ -3284,7 +3284,7 @@ static void open_auth_file(struct mg_connection *conn, const char *path,
if (gpass != NULL) {
/* Use global passwords file */
if (!mg_fopen(conn, gpass, "r", filep)) {
#ifdef DEBUG
#ifdef CWDEBUG
mg_cry(conn, "fopen(%s): %s", gpass, strerror(ERRNO));
#endif
}
Expand All @@ -3296,7 +3296,7 @@ static void open_auth_file(struct mg_connection *conn, const char *path,
mg_snprintf(conn, name, sizeof(name), "%s%c%s",
path, '/', PASSWORDS_FILE_NAME);
if (!mg_fopen(conn, name, "r", filep)) {
#ifdef DEBUG
#ifdef CWDEBUG
mg_cry(conn, "fopen(%s): %s", name, strerror(ERRNO));
#endif
}
Expand All @@ -3310,7 +3310,7 @@ static void open_auth_file(struct mg_connection *conn, const char *path,
mg_snprintf(conn, name, sizeof(name), "%.*s%c%s",
(int) (e - p), p, '/', PASSWORDS_FILE_NAME);
if (!mg_fopen(conn, name, "r", filep)) {
#ifdef DEBUG
#ifdef CWDEBUG
mg_cry(conn, "fopen(%s): %s", name, strerror(ERRNO));
#endif
}
Expand Down

0 comments on commit e232322

Please sign in to comment.