about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhanemile <mail@emile.space>2020-07-29 22:31:41 +0200
committerhanemile <mail@emile.space>2020-07-29 22:31:41 +0200
commit5d2c1c885d8d9cfd1a5d21aa5b4e14e27e904bd7 (patch)
tree1ad298fd8119455b62d214359327905f1638cab7
parentef58f02e4e3e45b64b398d3884b54b2f7729a6c7 (diff)
adjusted timeouts
-rw-r--r--main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.go b/main.go
index 35f32dc..fa7eda7 100644
--- a/main.go
+++ b/main.go
@@ -8,8 +8,10 @@ import (
 	"net/http"
 	"os"
 	"strings"
+	"time"
 
 	"gopkg.in/h2non/gentleman.v2"
+    "gopkg.in/h2non/gentleman.v2/plugins/timeout"
 )
 
 var session = flag.String("session", "9e8831af-ce30-48c3-8663-4b27262f43f1.pjKPVCYufDhuA9GPJAlc_xh45M8", "The session (the value of the cookie named 'session')")
@@ -65,6 +67,10 @@ func fetchAllChallenges() (Challenges, error) {
 	cli := gentleman.New()
 	cli.URL(*rootURL)
 
+	// define the timeouts outrageously long, as some CTFs hosted using CTFd are incredibly inresponsive.
+	cli.Use(timeout.Request(1000 * time.Second))
+	cli.Use(timeout.Dial(1000 * time.Second, 2000 * time.Second))
+
 	req := cli.Request()
 	req.Path("/api/v1/challenges")