# API and build change and fix summaries. Doc correctsions
# and/or changes are not mentioned here; see the commit messages.
+2020 August 4; Version 4.2.1
+ Add additional environment variable dump if RMR_LOG_VLEVEL set to
+ 4 at start.
+
2020 August 3; Version 4.2.0
Add support for the RMR_RTREQ_FREQ environment variable to control
the request frequency for a new route table (default 5s if not
set( major_version "4" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this
set( minor_version "2" )
-set( patch_level "0" )
+set( patch_level "1" )
set( install_root "${CMAKE_INSTALL_PREFIX}" )
set( install_inc "include/rmr" )
version 4.0.0, the RMR versions should no longer skip.
+2020 August 4; Version 4.2.1
+----------------------------
+
+Add additional environment variable dump if RMR_LOG_VLEVEL
+set to 4 at start.
+
+
+
2020 August 3; Version 4.2.0
----------------------------
rt_req_freq = atoi( eptr );
if( rt_req_freq < 1 || rt_req_freq > 300 ) {
rt_req_freq = DEF_RTREQ_FREQ;
- rmr_vlog( RMR_VL_WARN, "rmr_rtc: RT request frequency (%s) out of range (1-300), using default", DEF_RTREQ_FREQ );
+ rmr_vlog( RMR_VL_WARN, "rmr_rtc: RT request frequency (%d) out of range (1-300), using default", DEF_RTREQ_FREQ );
}
}
rmr_vlog( RMR_VL_INFO, "rmr_rtc: RT request frequency set to: %d seconds", rt_req_freq );
uta_link2 -- establish a nanomsg connection to a host
+ uta_dump_env -- dump the environment variables to stdout that are
+ of importance to RMR.
+
Author: E. Scott Daniels
Date: 30 November 2018
*/
Given a buffer of 'sep' separated tokens, and a list of things,
return up to max tokens with any tokens that matched things in
the list. Toks is the user supplied array of char* which we will
- fill in (up to max) with pointers to tokens from buf. This
- damages buf, so the caller must dup the string if it must be
- preserved for later, original, use. The pointers returned in
+ fill in (up to max) with pointers to tokens from buf. This
+ damages buf, so the caller must dup the string if it must be
+ preserved for later, original, use. The pointers returned in
toks will reference portions of bufs.
Returns the number of tokens referenced by toks.
int i;
int j;
-
+
all_toks = malloc( sizeof( char * ) * max ); // refernce to all tokens; we'll prune
pcount = ntoks = uta_tokenise( buf, all_toks, max, sep ); // split them up
j = 0;
to the list so that we don't pick up entries from the rtable that are for other
processes listening on different interfaces.
- The ENV_BIN_IF environment variable may be either an IP address (v6 must be in
+ The ENV_BIN_IF environment variable may be either an IP address (v6 must be in
square braces), or an interface name (e.g. eth0).
*/
if_addrs_t* mk_ip_list( char* port ) {
return NULL;
}
+/*
+ Write all environment variables that we consider to be important to stderr.
+*/
+static void uta_dump_env( ) {
+ char* token;
+ char* elist[] = {
+ ENV_BIND_IF,
+ ENV_RTG_PORT,
+ ENV_RTG_ADDR,
+ ENV_SEED_RT,
+ ENV_SEED_MEMAP,
+ ENV_RTG_RAW,
+ ENV_VERBOSE_FILE,
+ ENV_NAME_ONLY,
+ ENV_WARNINGS,
+ ENV_SRC_ID,
+ ENV_LOG_HR,
+ ENV_LOG_VLEVEL,
+ ENV_CTL_PORT,
+ ENV_RTREQ_FREA
+ };
+ int i;
+
+ for( i = 0; i < sizeof( elist ) / sizeof( char *); i ++ ) {
+ token = getenv( elist[i] );
+ if( token != NULL ) {
+ rmr_vlog( RMR_VL_INFO, "dump_env: %s = '%s'\n", elist[i], token );
+ } else {
+ rmr_vlog( RMR_VL_INFO, "dump_env: %s = <unset>\n", elist[i] );
+ }
+ }
+}
+
#endif
int old_vlevel;
old_vlevel = rmr_vlog_init(); // initialise and get the current level
- rmr_set_vlevel( RMR_VL_INFO ); // we WILL announce our version etc
if( ! announced ) {
+ rmr_set_vlevel( RMR_VL_INFO ); // we WILL announce our version
rmr_vlog( RMR_VL_INFO, "ric message routing library on SI95/g mv=%d flg=%02x (%s %s.%s.%s built: %s)\n",
RMR_MSG_VER, flags, QUOTE_DEF(GIT_ID), QUOTE_DEF(MAJOR_VER), QUOTE_DEF(MINOR_VER), QUOTE_DEF(PATCH_VER), __DATE__ );
announced = 1;
+
+ rmr_set_vlevel( old_vlevel ); // return logging to the desired state
+ uta_dump_env(); // spit out environment settings meaningful to us if in info mode
}
- rmr_set_vlevel( old_vlevel ); // return logging to the desired state
errno = 0;
if( uproto_port == NULL ) {
rmr_set_low_latency( NULL );
rmr_set_fack( NULL );
+
+ msg2 = rmr_alloc_msg( rmc, 1024 );
+ msg2 = rmr_rcv_msg( NULL, msg2 );
+ if( msg2 != NULL ) {
+ errors += fail_if( msg2->state == RMR_OK, "nil context check for rcv msg returned OK" );
+ }
+ msg2 = rmr_torcv_msg( NULL, msg2, 200 );
+ if( msg2 != NULL ) {
+ errors += fail_if( msg2->state == RMR_OK, "nil context check for torcv msg returned OK" );
+ }
+
+ // ----- thread start coverage ---------------------------------------------------------------------------
+ setenv( "RMR_WARNINGS", "1", 1 ); // force non-default branches during these tests
+ setenv( "RMR_SRC_NAMEONLY", "1", 1 );
+
+ rmr_init( ":6789", 1024, 0 ); // threaded mode with defined/default RM target
+ setenv( "RMR_RTG_SVC", "-1", 1 ); // force into static table mode
+ rmr_init( ":6789", 1024, 0 ); // threaded mode with static table
+
// --------------- phew, done ------------------------------------------------------------------------------
if( ! errors ) {
rtc_file( NULL ); // the static file only collector
rtc_file( ctx );
+ setenv( "RMR_RTREQ_FREQ", "400", 1 ); // force error checking code in rtc to resort to default
+ rtc( ctx );
+
+ setenv( "RMR_CTL_PORT", "43086", 1 ); // force defined branch in rtc
rtc( ctx );
setenv( "RMR_RTG_SVC", "4567", 1 ); // drive for edge case coverage to ensure no nil pointer etc
void* if_list;
+ uta_dump_env();
+
// ------------------ tokenise tests -----------------------------------------------------------
dbuf = strdup( buf );
i = uta_tokenise( dbuf, tokens, 127, ',' );
#define NO_EMULATION
#include "test_support.c" // our private library of test tools
+#include "logging.c" // tools references logging, so pull in too
#include "tools_static.c"
#include "tools_static_test.c"