Skip to content

Commit

Permalink
Require -streams to be between 1 and 4 in every client (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodauria authored Jan 17, 2024
1 parent 4010abf commit f3bfdb8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/minimal-download/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ outer:
func main() {
flag.Parse()

if *flagStreams < 1 || *flagStreams > 4 {
log.Fatal("Invalid configuration: the number of streams must be between 1 and 4.")
}

ctx, cancel := context.WithTimeout(context.Background(), *flagMaxDuration)
defer cancel()

Expand Down
4 changes: 4 additions & 0 deletions cmd/msak-client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func main() {
log.Fatal("Invalid configuration: please check streams, delay and duration and make sure they make sense.")
}

if *flagStreams < 1 || *flagStreams > 4 {
log.Fatal("Invalid configuration: the number of streams must be between 1 and 4.")
}

config := client.Config{
Server: *flagServer,
Scheme: *flagScheme,
Expand Down

0 comments on commit f3bfdb8

Please sign in to comment.