Code Review
/
ric-plt
/
lib
/
rmr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Correct excessive TCP connection bug
[ric-plt/lib/rmr.git]
/
test
/
test_ctx_support.c
diff --git
a/test/test_ctx_support.c
b/test/test_ctx_support.c
index
277f741
..
d15239a
100644
(file)
--- a/
test/test_ctx_support.c
+++ b/
test/test_ctx_support.c
@@
-61,12
+61,21
@@
static inline uta_ctx_t *mk_dummy_ctx() {
if( ctx == NULL ) {
return NULL;
}
if( ctx == NULL ) {
return NULL;
}
-
memset( ctx, 0, sizeof( *ctx ) );
memset( ctx, 0, sizeof( *ctx ) );
-
+
+ ctx->ephash = rmr_sym_alloc( 129 );
+
ctx->mring = uta_mk_ring( 4096 ); // message ring is always on for si
ctx->zcb_mring = uta_mk_ring( 128 ); // zero copy buffer mbuf ring to reduce malloc/free calls
ctx->si_ctx = malloc( 1024 );
ctx->mring = uta_mk_ring( 4096 ); // message ring is always on for si
ctx->zcb_mring = uta_mk_ring( 128 ); // zero copy buffer mbuf ring to reduce malloc/free calls
ctx->si_ctx = malloc( 1024 );
+ ctx->my_name = strdup( "hostname1" );
+ ctx->my_ip = strdup( "123.45.67.89" );
+
+ ctx->rtgate = (pthread_mutex_t *) malloc( sizeof( *ctx->rtgate ) );
+ if( ctx->rtgate != NULL ) {
+ pthread_mutex_init( ctx->rtgate, NULL );
+ }
+
return ctx;
}
return ctx;
}