X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fapp_test%2Fsender.c;h=994c59140f43359f4d788598b717a04920a156c2;hb=ec88d3c0563eeb6ae5f73427edb0b3c4d7acf299;hp=51429b551811ceaa922d6174d3a8f55380f34d5c;hpb=77406e61f2158f5b88b7a9f6e3e86d8f62c8f71a;p=ric-plt%2Flib%2Frmr.git diff --git a/test/app_test/sender.c b/test/app_test/sender.c index 51429b5..994c591 100644 --- a/test/app_test/sender.c +++ b/test/app_test/sender.c @@ -68,6 +68,9 @@ #include +#define WBUF_SIZE 1024 +#define TRACE_SIZE 1024 + static int sum( char* str ) { int sum = 0; int i = 0; @@ -112,9 +115,9 @@ int main( int argc, char** argv ) { int mtype = 0; int stats_freq = 100; int successful = 0; // set to true after we have a successful send - char wbuf[1024]; + char* wbuf = NULL; // working buffer char me[128]; // who I am to vet rts was actually from me - char trace[1024]; + char* trace = NULL; // area to build trace data in long timeout = 0; int delay = 100000; // usec between send attempts int nmsgs = 10; // number of messages to send @@ -122,6 +125,9 @@ int main( int argc, char** argv ) { int start_mt = 0; int pass = 1; + wbuf = (char *) malloc( sizeof( char ) * WBUF_SIZE ); + trace = (char *) malloc( sizeof( char ) * TRACE_SIZE ); + if( argc > 1 ) { nmsgs = atoi( argv[1] ); } @@ -187,7 +193,7 @@ int main( int argc, char** argv ) { timeout = time( NULL ) + 20; - gethostname( wbuf, sizeof( wbuf ) ); + gethostname( wbuf, WBUF_SIZE ); snprintf( me, sizeof( me ), "%s-%d", wbuf, getpid( ) ); while( count < nmsgs ) { // we send n messages after the first message is successful