import "net/http"\r
import "os"\r
import "strings"\r
+import "time"\r
import _ "github.com/mattn/go-sqlite3"\r
\r
// HTML templates\r
// serving\r
fmt.Printf("Serving on port %d...\n", port)\r
addr := fmt.Sprintf(":%d", port)\r
- http.ListenAndServe(addr, nil)\r
+ for true {\r
+ err := http.ListenAndServe(addr, nil)\r
+ if err == nil {\r
+ fmt.Println("got it!")\r
+ }\r
+ time.Sleep(100*time.Millisecond)\r
+ }\r
}\r
\r
// intercepts all URLs, displays a landing page\r
}\r
\r
req, _ := http.NewRequest("POST", url, strings.NewReader(body))\r
- req.ContentLength = int64(bodylength)\r
+ //req.ContentLength = int64(bodylength)\r
+ //req.ContentLength = 0\r
+ req.ContentLength = int64(len([]byte(body)))\r
\r
header := map[string][]string{\r
"X-D0-Blind-Id-Detached-Signature": {blind_id_header},\r
res, err := http.DefaultClient.Do(req)\r
if err != nil {\r
fmt.Printf("Error submitting request #%d. Continuing...\n", request_id)\r
+ fmt.Println(err)\r
continue\r
}\r
defer res.Body.Close()\r