char* osrf_json_gateway_config_file = NULL;
int bootstrapped = 0;
+int numserved = 0;
static const char* osrf_json_gateway_set_config(cmd_parms *parms, void *config, const char *arg) {
osrf_json_gateway_config *cfg;
return HTTP_INTERNAL_SERVER_ERROR;
}
-
osrfLogSetAppname("osrf_json_gw");
- char* service = NULL; /* service to connect to */
- char* method = NULL; /* method to perform */
- char* format = NULL; /* method to perform */
- char* a_l = NULL; /* request api level */
- int isXML = 0;
- int api_level = 1;
+ char* service = NULL; /* service to connect to */
+ char* method = NULL; /* method to perform */
+ char* format = NULL; /* method to perform */
+ char* a_l = NULL; /* request api level */
+ int isXML = 0;
+ int api_level = 1;
r->allowed |= (AP_METHOD_BIT << M_GET);
r->allowed |= (AP_METHOD_BIT << M_POST);
if (isXML)
snprintf( buf, l, "<debug>\"%s : %s\"</debug>", statusname, statustext );
+
else {
char bb[l];
bzero(bb, l);
osrf_app_session_destroy(session);
}
+ osrfLogInfo(OSRF_LOG_MARK, "Completed processing service=%s, method=%s", service, method);
+ osrfLogDebug(OSRF_LOG_MARK, "Gateway served %d requests", ++numserved);
string_array_destroy(params);
string_array_destroy(mparams);
if(thing->type == JSON_ARRAY) {
int i;
for( i = 0; i != thing->size; i++ )
- jsonObjectPush(newarr, jsonObjectGetIndex(thing,i));
+ jsonObjectPush(newarr, jsonObjectClone(jsonObjectGetIndex(thing,i)));
+ jsonObjectFree(thing);
} else {
jsonObjectPush(newarr, thing);
int __osrfLogActivityEnabled = 1;
+void osrfLogCleanup() {
+ free(__osrfLogAppname);
+ free(__osrfLogFile);
+}
+
+
void osrfLogInit( int type, const char* appname, int maxlevel ) {
osrfLogSetType(type);
if(appname) osrfLogSetAppname(appname);
/* Log an activity message */
void osrfLogActivity( const char* file, int line, const char* msg, ... );
+void osrfLogCleanup();
+
/* sets the activity flag */
void osrfLogSetActivityEnabled( int enabled );