mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Style fixes
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
+3
-3
@@ -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)
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user