From 108a72d8b153864beb2079d54f36dfcaaad7aedf Mon Sep 17 00:00:00 2001 From: Jeremy Tan Date: Thu, 12 Sep 2013 22:14:08 +0800 Subject: [PATCH] Revert change made to timestamp placing in JSON responses --- server/fastcgi.c | 11 +++++------ server/sensor.h | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) 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 -- 2.20.1