1
0
Derivar 0

Add option to flush after each line of input (#244)

Este cometimento está contido em:
Jack Cable 2021-03-02 11:10:19 -06:00 cometido por GitHub
ascendente 3c17bf32e8
cometimento a9fc785eb0
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados
ID da chave GPG: 4AEE18F83AFDEB23
2 ficheiros modificados com 4 adições e 0 eliminações

Ver ficheiro

@ -20,6 +20,7 @@ type Config struct {
LocalAddress string `long:"source-ip" description:"Local source IP address to use for making connections"`
Senders int `short:"s" long:"senders" default:"1000" description:"Number of send goroutines to use"`
Debug bool `long:"debug" description:"Include debug fields in the output."`
Flush bool `long:"flush" description:"Flush after each line of output."`
GOMAXPROCS int `long:"gomaxprocs" default:"0" description:"Set GOMAXPROCS"`
ConnectionsPerHost int `long:"connections-per-host" default:"1" description:"Number of times to connect to each host (results in more output)"`
ReadLimitPerHost int `long:"read-limit-per-host" default:"96" description:"Maximum total kilobytes to read for a single host (default 96kb)"`

Ver ficheiro

@ -153,6 +153,9 @@ func OutputResults(w *bufio.Writer, results <-chan []byte) error {
if err := w.WriteByte('\n'); err != nil {
return err
}
if config.Flush {
out.Flush()
}
}
return nil
}