cmd/strelaysrv: Smaller, adjustable network buffer

This commit is contained in:
Jakob Borg
2017-08-30 18:52:28 +02:00
parent 33ffb07d31
commit 70d121a94b
2 changed files with 9 additions and 7 deletions

View File

@@ -254,7 +254,7 @@ func (s *session) proxy(c1, c2 net.Conn) error {
atomic.AddInt64(&numProxies, 1)
defer atomic.AddInt64(&numProxies, -1)
buf := make([]byte, 65536)
buf := make([]byte, networkBufferSize)
for {
c1.SetReadDeadline(time.Now().Add(networkTimeout))
n, err := c1.Read(buf)