Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4a4903e

Browse files
add optional timeout parameter -t
For some uploads 10 seconds is not enough.
1 parent c3bb29c commit 4a4903e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎main.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ var (
3737
useSsl = flag.String("ssl", "", "SSL flag")
3838
syncRet = flag.String("sync_exp", "", "sync expected return code in format code:string")
3939
hasDownloadFile = flag.Bool("d", false, "set to true to take advantage of downloadFile API")
40+
timeoutSeconds = flag.Int("t", 10, "Upload timeout")
4041
)
4142

4243
type Item struct {
@@ -53,7 +54,7 @@ func main() {
5354
}
5455

5556
var httpClient = &http.Client{
56-
Timeout: time.Second * 10,
57+
Timeout: time.Second * time.Duration(*timeoutSeconds),
5758
}
5859

5960
httpheader := "http://"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /