Revert change made to timestamp placing in JSON responses
authorJeremy Tan <[email protected]>
Thu, 12 Sep 2013 14:14:08 +0000 (22:14 +0800)
committerJeremy Tan <[email protected]>
Thu, 12 Sep 2013 14:14:08 +0000 (22:14 +0800)
server/fastcgi.c
server/sensor.h

index 8c6355a..8f4ab32 100644 (file)
@@ -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));
 }
 
 /**
index dd919f9..89dae33 100644 (file)
@@ -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
 

UCC git Repository :: git.ucc.asn.au