X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fnng%2Fsrc%2Frtable_nng_static.c;h=d1e0cbbeaf42f46a7fb3761f2571c1c454f5a6d6;hb=ae8e63b75e4c5e754c1f3c2d4a600100a05225a0;hp=8b3bf67536e6ab6de4c691fa300655605f5d2300;hpb=fd9cc7a5b3355146388ebdf4d558cb284c66c5f1;p=ric-plt%2Flib%2Frmr.git diff --git a/src/nng/src/rtable_nng_static.c b/src/nng/src/rtable_nng_static.c index 8b3bf67..d1e0cbb 100644 --- a/src/nng/src/rtable_nng_static.c +++ b/src/nng/src/rtable_nng_static.c @@ -155,20 +155,6 @@ extern endpoint_t* uta_add_ep( route_table_t* rt, rtable_ent_t* rte, char* ep_n } ep = rt_ensure_ep( rt, ep_name ); // get the ep and create one if not known - /* - if( (ep = uta_get_ep( rt, ep_name )) == NULL ) { // not there yet, make - if( (ep = (endpoint_t *) malloc( sizeof( *ep ) )) == NULL ) { - fprintf( stderr, "uta: [WARN] malloc failed for endpoint creation: %s\n", ep_name ); - return NULL; - } - - ep->open = 0; // not connected - ep->addr = uta_h2ip( ep_name ); - ep->name = strdup( ep_name ); - - rmr_sym_put( rt->hash, ep_name, 1, ep ); - } - */ if( rrg != NULL ) { if( rrg->nused >= rrg->nendpts ) { @@ -199,11 +185,12 @@ static int uta_epsock_byname( route_table_t* rt, char* ep_name, nng_socket* nn_s return FALSE; } - ep = rmr_sym_get( rt->hash, ep_name, 1 ); if( ep == NULL ) { if( DEBUG ) fprintf( stderr, "[DBUG] get ep by name for %s not in hash!\n", ep_name ); - return FALSE; + if( ! ep_name || (ep = rt_ensure_ep( rt, ep_name)) == NULL ) { // create one if not in rt (support rts without entry in our table) + return FALSE; + } } if( ! ep->open ) { // not open -- connect now