Merge branch 'master' of github:szmoore/MCTX3420
authorSam Moore <[email protected]>
Fri, 13 Sep 2013 13:47:02 +0000 (21:47 +0800)
committerSam Moore <[email protected]>
Fri, 13 Sep 2013 13:47:02 +0000 (21:47 +0800)
Conflicts:
server/data.c
server/sensor.c

It's pretty scary how much got automatically merged.
Almost as if git is sentient.

1  2 
server/data.c
server/data.h
server/fastcgi.c
server/sensor.c

diff --cc server/data.c
@@@ -14,9 -14,7 +14,8 @@@ void Data_Init(DataFile * df
  {
        // Everything is NULL
        df->filename = NULL;
-       df->read_file = NULL;
-       df->write_file = NULL;
 +      pthread_mutex_init(&(df->mutex), NULL);
+       df->file = NULL;
  }
  
  /**
diff --cc server/data.h
Simple merge
Simple merge
diff --cc server/sensor.c
@@@ -300,17 -314,29 +313,16 @@@ void Sensor_Handler(FCGIContext *contex
                // Error occured; FCGI_RejectJSON already called
                return;
        }
 -      else if (id < 0 || id >= NUMSENSORS)
 +
 +      // Error checking on sensor id
 +      if (id < 0 || id >= NUMSENSORS)
        {
 -              FCGI_RejectJSON(context, "Invalid sensor id specified");
 +              FCGI_RejectJSON(context, "Invalid sensor id");
                return;
        }
 -
 -      // Get Sensor and format
        Sensor * s = g_sensors+id;
 -      DataFormat format = JSON;
 -
 -      // Check if format type was specified
 -      if (FCGI_RECEIVED(values[FORMAT].flags))
 -      {
 -              if (strcmp(fmt_str, "json") == 0)
 -                      format = JSON;
 -              else if (strcmp(fmt_str, "tsv") == 0)
 -                      format = TSV;
 -              else 
 -              {
 -                      FCGI_RejectJSON(context, "Unknown format type specified.");
 -                      return;
 -              }
 -      }
 +      
 +      DataFormat format = Data_GetFormat(&(values[FORMAT]));
  
        // Begin response
        Sensor_BeginResponse(context, id, format);

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