X-Git-Url: http://git.pjr.cc/?p=goDBhammer.git;a=blobdiff_plain;f=src%2Fwebconnector.go;fp=src%2Fwebconnector.go;h=3216db3ebea12c499691c926a0d897b1591461f4;hp=127d168ced996ba377462cf606b5e53404d7bc3e;hb=72f8f5c4eea74b9148fea41006fdc6db181fb86c;hpb=a9e8c776ba53f6314093f06d5e82e709e2e7ec7e diff --git a/src/webconnector.go b/src/webconnector.go index 127d168..3216db3 100644 --- a/src/webconnector.go +++ b/src/webconnector.go @@ -22,13 +22,15 @@ var comin chan string; var cominstatus chan string; var comout chan string; +var stat int; + func JSONResponder(c *http.Conn, req *http.Request) { //stat := <- cominstatus; if(req.Method == "GET") { - j, _, _ := json.StringToJson("{\"status\":1, \"complete\":90}"); + j, _, _ := json.StringToJson(fmt.Sprintf("{\"status\":%d, \"complete\":90}", stat)); io.WriteString(c, fmt.Sprintf("%s\n", json.JsonToString(j))); fmt.Printf("i got a get\n"); @@ -37,7 +39,8 @@ func JSONResponder(c *http.Conn, req *http.Request) lp := make([]byte, 1048576); req.Body.Read(lp); fmt.Printf("i got a post...%s\n", (string)(lp)); - http.Redirect(c, "/", 301); + //http.Redirect(c, "/", 301); + stat = 2; } } @@ -59,6 +62,7 @@ func main() cominstatus = make(chan string); comout = make(chan string); + stat = 1; bc := benchcontroller.CreateController(); go benchcontroller.MainLoop(bc, comout, comin, cominstatus);