Commits

Jeremy Sandell  committed d1d55f4 Draft

versioning

  • Participants
  • Parent commits 90ee94d

Comments (0)

Files changed (2)

 
 HOSTNAME=$(hostname)
 
+VERSION="";
+
 if [[ $HOSTNAME == "devbook" ]];
 then
     HTTP_PARSER_PATH=/home/jeremy/repos/git/http-parser/
 
 else
 
+    if [[ -n $1 ]]; then
+        VERSION="-version=$1";
+    fi
+
 echo "Release"
 
 echo "[net.http._parser]"
-dmd $RELEASE_FLAGS -c -odobj -w -wi -L-L$HTTP_PARSER_PATH -L-l$HTTP_PARSER_LIB net/http/_parser.di 
+dmd $VERSION $RELEASE_FLAGS -c -odobj -w -wi -L-L$HTTP_PARSER_PATH -L-l$HTTP_PARSER_LIB net/http/_parser.di 
 
 echo "[net.http.parser]"
-dmd $RELEASE_FLAGS -c -odobj -w -wi -L-L$HTTP_PARSER_PATH -L-l$HTTP_PARSER_LIB net/http/parser.di 
+dmd $VERSION $RELEASE_FLAGS -c -odobj -w -wi -L-L$HTTP_PARSER_PATH -L-l$HTTP_PARSER_LIB net/http/parser.di 
 
 echo "[parse.d]"
-dmd $RELEASE_FLAGS -ofparse.exe -odobj -w -wi -L-L$HTTP_PARSER_PATH -L-l$HTTP_PARSER_LIB parse.d obj/_parser.o obj/parser.o
+dmd $VERSION $RELEASE_FLAGS -ofparse.exe -odobj -w -wi -L-L$HTTP_PARSER_PATH -L-l$HTTP_PARSER_LIB parse.d obj/_parser.o obj/parser.o
 
 fi
 
 import net.http.parser;
 
 //debug=connection;
-
+debug=summary;
 
 string b64encode(string input)
 {
     Camera c;
     Auth auth;
     
-    c.domain = "127.0.0.1";
-    c.port = 5000;
-    c.command = "schedule";
-    c.url = format("/%s/", c.command);
+    version(camera)
+    {
+        c.domain = "192.168.2.20";
+        c.port = 80;
+        c.command = "get_params";
+        c.url = format("/%s/", c.command);
+    }
+    else
+    {
+        c.domain = "127.0.0.1";
+        c.port = 5000;
+        c.command = "schedule";
+        c.url = format("/%s/", c.command);
+    }
 
     auth.username = "username";
     auth.password = "password";
             writefln("status: %s", parser.code);
         }
 
+        version(camera)
+        {
+            writefln("content_length: %s", parser.content_length);
+            writefln("headers: %s", parser.headers);
+            writefln("status: %s", parser.code);
+            writefln("content:\n%s", parser.content);
+        }
+
         if (parser.code != 200)
             writefln(response.data);