void osrfRouterFree( osrfRouter* router ) {
if(!router) return;
+ osrfHashFree(router->classes);
free(router->domain);
free(router->name);
free(router->resource);
if(!strcmp( omsg->method_name, ROUTER_REQUEST_CLASS_LIST )) {
int i;
- jresponse = jsonParseString("[]");
+ jresponse = jsonNewObjectType(JSON_ARRAY);
osrfStringArray* keys = osrfHashKeys( router->classes );
for( i = 0; i != keys->size; i++ )
if (!classname)
return -1;
- jresponse = jsonParseString("{}");
+ jresponse = jsonNewObjectType(JSON_HASH);
class = osrfHashGet(router->classes, classname);
free(classname);
osrfRouterClass* class;
osrfRouterNode* node;
- jresponse = jsonParseString("{}");
+ jresponse = jsonNewObjectType(JSON_HASH);
osrfHashIterator* class_itr = osrfNewHashIterator(router->classes);
while( (class = osrfHashIteratorNext(class_itr)) ) {
- jsonObject* class_res = jsonParseString("{}");
+ jsonObject* class_res = jsonNewObjectType(JSON_HASH);
char* classname = class_itr->current;
osrfHashIterator* node_itr = osrfNewHashIterator(class->nodes);
osrfRouterClass* class;
osrfRouterNode* node;
int count;
- jresponse = jsonParseString("{}");
+ jresponse = jsonNewObjectType(JSON_HASH);
osrfHashIterator* class_itr = osrfNewHashIterator(router->classes);
while( (class = osrfHashIteratorNext(class_itr)) ) {