Skip to content

armgit / hey

Public Imported from GitHub
0

HTTP load generator, ApacheBench (ab) replacement

Go

Revert back dial timeout, add TLS handshake timeout.

Burcu Doganc32318f843b8
diff --git a/boomer/run.go b/boomer/run.go
index 92842f9..2f2cb1a 100644
--- a/boomer/run.go
+++ b/boomer/run.go
@@ -18,9 +18,10 @@ import (
"crypto/tls"
"io"
"io/ioutil"
+ "sync"
+
"net"
"net/http"
- "sync"
"time"
)
@@ -39,9 +40,8 @@ func (b *Boomer) worker(ch chan *http.Request) {
TLSClientConfig: &tls.Config{InsecureSkipVerify: b.AllowInsecure, ServerName: host},
DisableCompression: b.DisableCompression,
DisableKeepAlives: b.DisableKeepAlives,
- Dial: (&net.Dialer{
- Timeout: time.Duration(b.Timeout) * time.Millisecond,
- }).Dial,
+ // TODO(jbd): Add dial timeout.
+ TLSHandshakeTimeout: time.Duration(b.Timeout) * time.Millisecond,
}
if b.ProxyAddr != "" {
tr.Dial = func(network string, addr string) (conn net.Conn, err error) {
@@ -53,7 +53,7 @@ func (b *Boomer) worker(ch chan *http.Request) {
s := time.Now()
resp, err := client.Do(req)
code := 0
- var size int64 = -1
+ var size int64 = 0
if err == nil {
code = resp.StatusCode
if resp.ContentLength > 0 {