X-Git-Url: http://git.pjr.cc/?p=goDBhammer.git;a=blobdiff_plain;f=src%2Fwebconnector.go;h=de43ec682de0a5e1b336e740dba8129cb71808d8;hp=80a333f22ebc0f7cab5d3dc1ee2e3a015fe62d83;hb=9b12ded071272846ea82adfcc94c6bc08e3aec74;hpb=4644c6698a7b6ce6fdb913c2efd170cba3ebec16 diff --git a/src/webconnector.go b/src/webconnector.go index 80a333f..de43ec6 100644 --- a/src/webconnector.go +++ b/src/webconnector.go @@ -38,16 +38,21 @@ func ServerResponder(c *http.Conn, req *http.Request) { func beginPage(c *http.Conn, req *http.Request) { - header(c); - io.WriteString(c, "

Starting hammer

"); - //dbhost := req.FormValue("dbhost"); - //dbuser := req.FormValue("dbuser"); - //dbpass := req.FormValue("dbpass"); - //dbname := req.FormValue("dbname"); - //nthreads := req.FormValue("nthreads"); - //dbmult := req.FormValue("dbmult"); - - footer(c); + + if req.Method != "GET" { + http.Redirect(c, "/begin", 301); + } else { + header(c); + io.WriteString(c, "

Starting hammer

"); + //dbhost := req.FormValue("dbhost"); + //dbuser := req.FormValue("dbuser"); + //dbpass := req.FormValue("dbpass"); + //dbname := req.FormValue("dbname"); + //nthreads := req.FormValue("nthreads"); + //dbmult := req.FormValue("dbmult"); + + footer(c); + } } @@ -61,6 +66,7 @@ func confirmPage(c *http.Conn, req *http.Request) dbname := req.FormValue("dbname"); nthreads := req.FormValue("nthreads"); dbmult := req.FormValue("dbmult"); + var dbtype string; io.WriteString(c, "You are trying to perform a benchmark with the following values:
"); io.WriteString(c, ""); @@ -81,8 +87,10 @@ func confirmPage(c *http.Conn, req *http.Request) io.WriteString(c, ""); io.WriteString(c, ""); + dbtype = "mysql"; + footer(c); - comout <- fmt.Sprintf("configure:%s:%s:%s:%s:%s:%s", dbhost, dbuser, dbpass, dbname, dbmult, nthreads); + comout <- fmt.Sprintf("configure:%s:%s:%s:%s:%s:%s:%s", dbtype, dbhost, dbuser, dbpass, dbname, dbmult, nthreads); }