From 4a4903ef9ff94e63f03820c7982e402fa70921b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Andr=C3=A1ssy?= Date: Tue, 4 Jan 2022 20:49:18 +0100 Subject: [PATCH] add optional timeout parameter -t For some uploads 10 seconds is not enough. --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 971e440..1d4f859 100644 --- a/main.go +++ b/main.go @@ -37,6 +37,7 @@ var ( useSsl = flag.String("ssl", "", "SSL flag") syncRet = flag.String("sync_exp", "", "sync expected return code in format code:string") hasDownloadFile = flag.Bool("d", false, "set to true to take advantage of downloadFile API") + timeoutSeconds = flag.Int("t", 10, "Upload timeout") ) type Item struct { @@ -53,7 +54,7 @@ func main() { } var httpClient = &http.Client{ - Timeout: time.Second * 10, + Timeout: time.Second * time.Duration(*timeoutSeconds), } httpheader := "http://"