From 3d07f9ff630072db3090852bd5e2c6167d13a8d9 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 11 Oct 2005 14:01:29 +0000 Subject: [PATCH] some more sanity checks git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@550 9efc2488-bf62-4759-914b-345cdb29e865 --- src/libstack/osrfConfig.c | 2 +- src/router/osrf_router.c | 3 ++- src/router/osrf_router_main.c | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libstack/osrfConfig.c b/src/libstack/osrfConfig.c index 825a65f..5141984 100644 --- a/src/libstack/osrfConfig.c +++ b/src/libstack/osrfConfig.c @@ -89,7 +89,7 @@ int osrfConfigGetValueList(osrfConfig* cfg, osrfStringArray* arr, char* path, .. if(!arr || !path) return 0; if(!cfg) cfg = __osrfConfigDefault; - if(!cfg) { return warning_handler("No Confif object!"); } + if(!cfg) { return warning_handler("No Config object!"); } VA_LIST_TO_STRING(path); diff --git a/src/router/osrf_router.c b/src/router/osrf_router.c index 07609ce..d7ea522 100644 --- a/src/router/osrf_router.c +++ b/src/router/osrf_router.c @@ -12,7 +12,7 @@ osrfRouter* osrfNewRouter( char* resource, char* password, int port, osrfStringArray* trustedClients, osrfStringArray* trustedServers ) { - if(!( domain && name && resource && password && port )) return NULL; + if(!( domain && name && resource && password && port && trustedClients && trustedServers )) return NULL; osrfRouter* router = safe_malloc(sizeof(osrfRouter)); router->domain = strdup(domain); @@ -24,6 +24,7 @@ osrfRouter* osrfNewRouter( router->trustedClients = trustedClients; router->trustedServers = trustedServers; + router->classes = osrfNewHash(); router->classes->freeItem = &osrfRouterClassFree; diff --git a/src/router/osrf_router_main.c b/src/router/osrf_router_main.c index c7fd903..8d715cd 100644 --- a/src/router/osrf_router_main.c +++ b/src/router/osrf_router_main.c @@ -78,6 +78,9 @@ int __setupRouter( char* config, char* context ) { for( i = 0; i != tclients->size; i++ ) info_handler( "Router adding trusted client: %s", osrfStringArrayGetString( tclients, i ) ); + if( tclients->size == 0 || tservers->size == 0 ) + fatal_handler("We need trusted servers and trusted client to run the router..."); + osrfRouter* router = osrfNewRouter( server, username, resource, password, iport, tclients, tservers ); -- 2.11.0