diff --git a/http_client.go b/http_client.go index 8c7948b..554642b 100644 --- a/http_client.go +++ b/http_client.go @@ -21,7 +21,7 @@ type HTTPClientConfig struct { FollowRedirects int Debug bool OriginalHost bool - Timeout time.Duration + Timeout time.Duration } type HTTPClient struct { @@ -137,7 +137,7 @@ func (c *HTTPClient) Send(data []byte) (response []byte, err error) { c.conn.SetReadDeadline(timeout) n, err := c.conn.Read(c.respBuf) - // If response large then our buffer, we need to read all reponse buffer + // If response large then our buffer, we need to read all response buffer // Otherwise it will corrupt response of next request // Parsing response body is non trivial thing, especially with keep-alive // Simples case is to to close connection if response too large diff --git a/http_client_test.go b/http_client_test.go index 93051b6..1aa0e51 100644 --- a/http_client_test.go +++ b/http_client_test.go @@ -1,6 +1,8 @@ package main import ( + "bytes" + "crypto/rand" "io/ioutil" "net" "net/http" @@ -8,8 +10,6 @@ import ( "net/http/httputil" "sync" "testing" - "crypto/rand" - "bytes" _ "time" ) @@ -100,7 +100,7 @@ func TestHTTPClientResponseBuffer(t *testing.T) { wg.Done() })) - client := NewHTTPClient(server.URL, &HTTPClientConfig{Debug: true}) + client := NewHTTPClient(server.URL, &HTTPClientConfig{Debug: false}) wg.Add(2) client.Send(payload) diff --git a/output_http.go b/output_http.go index 2908b2e..005ecd8 100644 --- a/output_http.go +++ b/output_http.go @@ -18,7 +18,7 @@ type HTTPOutputConfig struct { elasticSearch string - Timeout time.Duration + Timeout time.Duration OriginalHost bool Debug bool @@ -98,7 +98,7 @@ func (o *HTTPOutput) startWorker() { FollowRedirects: o.config.redirectLimit, Debug: o.config.Debug, OriginalHost: o.config.OriginalHost, - Timeout: o.config.Timeout, + Timeout: o.config.Timeout, }) deathCount := 0