X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fnng%2Fsrc%2Frmr_nng.c;h=45b7fc6edcb02e88956347af5874becde3861aa3;hb=cf4413c47ce274d7fc08c3bcfc8c4de3d465ad4d;hp=8a7c6d05bda43237b71445b4e436d033f0bddb4c;hpb=1739800d21456ddb0b0efbf92cb6d60c6f772feb;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/nng/src/rmr_nng.c b/src/rmr/nng/src/rmr_nng.c index 8a7c6d0..45b7fc6 100644 --- a/src/rmr/nng/src/rmr_nng.c +++ b/src/rmr/nng/src/rmr_nng.c @@ -753,9 +753,12 @@ static void* init( char* uproto_port, int max_msg_size, int flags ) { return NULL; } + ctx->rtable = rt_clone_space( NULL, NULL, 0 ); // allows wormhole and rts calls to work before rt is received if( flags & FL_NOTHREAD ) { // if no rtc thread, we still need an empty route table for wormholes - ctx->rtable = rt_clone_space( NULL, NULL, 0 ); // so create one + ctx->rmr_ready = 1; // for a nothread instance, rmr is ready to go here } else { + ctx->rmr_ready = o; // ensure not ready until static/dynamic table loaded + if( (tok = getenv( ENV_RTG_RAW )) != NULL && *tok == '0' ) { // use RMR for Rmgr comm only when specifically off if( pthread_create( &ctx->rtc_th, NULL, rtc, (void *) ctx ) ) { // kick the rmr based rt collector thread rmr_vlog( RMR_VL_WARN, "rmr_init: unable to start route table collector thread: %s", strerror( errno ) ); @@ -830,11 +833,7 @@ extern int rmr_ready( void* vctx ) { return FALSE; } - if( ctx->rtable != NULL ) { - return TRUE; - } - - return FALSE; + return ctx->rmr_ready; } /*