X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fquery.c;fp=server%2Fquery.c;h=8499e37c62aede2281b0fba355c11934ab89994b;hb=321bf62fcb0943a140dbc55bff5350e11c0eb946;hp=7a9ab161019d6d7c0882fda74bb2a8f39a44cf62;hpb=259624013535f3c93315868efb5f6f611ba88470;p=matches%2FMCTX3420.git diff --git a/server/query.c b/server/query.c index 7a9ab16..8499e37 100644 --- a/server/query.c +++ b/server/query.c @@ -6,7 +6,7 @@ - +#include "query.h" #include "sensor.h" #include "log.h" @@ -32,8 +32,7 @@ void QuerySensor(int id) //TODO: This code will form the SensorHandler FastCGI f } else { - fseek(file, 0, SEEK_SET); - rewind(file); + fseek(file, (s->read_offset)*sizeof(DataPoint), SEEK_SET); amount_read = fread(&buffer, sizeof(DataPoint), QUERY_BUFSIZ, file); s->read_offset += amount_read; Log(LOGDEBUG, "Read %d data points; offset now at %d", amount_read, s->read_offset);