From: Jeremy Tan Date: Thu, 12 Sep 2013 14:14:08 +0000 (+0800) Subject: Revert change made to timestamp placing in JSON responses X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=108a72d8b153864beb2079d54f36dfcaaad7aedf;p=matches%2FMCTX3420.git Revert change made to timestamp placing in JSON responses --- diff --git a/server/fastcgi.c b/server/fastcgi.c index 8c6355a..8f4ab32 100644 --- a/server/fastcgi.c +++ b/server/fastcgi.c @@ -62,12 +62,6 @@ static void IdentifyHandler(FCGIContext *context, char *params) { FCGI_JSONPair("build_date", __DATE__ " " __TIME__); FCGI_JSONLong("api_version", API_VERSION); - //Time and running statistics - gettimeofday(&now, NULL); - FCGI_JSONDouble("start_time", TIMEVAL_TO_DOUBLE(g_options.start_time)); - FCGI_JSONDouble("current_time", TIMEVAL_TO_DOUBLE(now)); - FCGI_JSONDouble("running_time", TIMEVAL_DIFF(now, g_options.start_time)); - //Sensor and actuator information if (ident_sensors) { FCGI_JSONKey("sensors"); @@ -297,6 +291,11 @@ void FCGI_BeginJSON(FCGIContext *context, StatusCodes status_code) printf("{\r\n"); printf("\t\"module\" : \"%s\"", context->current_module); FCGI_JSONLong("status", status_code); + //Time and running statistics + gettimeofday(&now, NULL); + FCGI_JSONDouble("start_time", TIMEVAL_TO_DOUBLE(g_options.start_time)); + FCGI_JSONDouble("current_time", TIMEVAL_TO_DOUBLE(now)); + FCGI_JSONDouble("running_time", TIMEVAL_DIFF(now, g_options.start_time)); } /** diff --git a/server/sensor.h b/server/sensor.h index dd919f9..89dae33 100644 --- a/server/sensor.h +++ b/server/sensor.h @@ -83,6 +83,5 @@ extern int Sensor_Query(Sensor * s, DataPoint * buffer, int bufsiz); // fill buf extern void Sensor_Handler(FCGIContext *context, char * params); -extern void Sensor_Handler2(FCGIContext *context, char *params); #endif //_SENSOR_H