some more sanity checks
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 11 Oct 2005 14:01:29 +0000 (14:01 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 11 Oct 2005 14:01:29 +0000 (14:01 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1908 dcc99617-32d9-48b4-a31d-7c20da2025e4

OpenSRF/src/libstack/osrfConfig.c
OpenSRF/src/router/osrf_router.c
OpenSRF/src/router/osrf_router_main.c

index 825a65f..5141984 100644 (file)
@@ -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);
 
index 07609ce..d7ea522 100644 (file)
@@ -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;
 
index c7fd903..8d715cd 100644 (file)
@@ -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 );