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);
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);
router->trustedClients = trustedClients;
router->trustedServers = trustedServers;
+
router->classes = osrfNewHash();
router->classes->freeItem = &osrfRouterClassFree;
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 );