Skip to content

Commit 3cc1952

Browse files
committed
Revert back to copy buffer behaviour.
1 parent d5ff61c commit 3cc1952

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

domain-proxy/common.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import (
1414

1515
const (
1616
ByteBufferSizeKey = "BYTE_BUFFER_SIZE"
17-
DefaultByteBufferSize = 8192
17+
DefaultByteBufferSize = 1024
1818
DomainSocketKey = "DOMAIN_SOCKET"
1919
DefaultDomainSocket = "/tmp/domain-socket.sock"
2020
ConnectionTimeoutKey = "CONNECTION_TIMEOUT"
21-
DefaultConnectionTimeout = 10000 * time.Millisecond
21+
DefaultConnectionTimeout = 1000 * time.Millisecond
2222
IdleTimeoutKey = "IDLE_TIMEOUT"
23-
DefaultIdleTimeout = 10000 * time.Millisecond
23+
DefaultIdleTimeout = 1000 * time.Millisecond
2424
)
2525

2626
var Logger *log.Logger

domain-proxy/domain_proxy_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func (dps *DomainProxyServer) handleHttpRequest(w http.ResponseWriter, r *http.R
139139
}
140140
}
141141
w.WriteHeader(resp.StatusCode)
142-
if _, err = io.Copy(w, resp.Body); err != nil {
142+
if _, err = io.CopyBuffer(w, resp.Body, make([]byte, dps.byteBufferSize)); err != nil {
143143
Logger.Printf("Error copying response body: %v", err)
144144
}
145145
Logger.Printf("Request %d took %d ms", requestNo, time.Since(startTime).Milliseconds())

0 commit comments

Comments
 (0)