Skip to content

Commit

Permalink
tcpproxy: Increase reader buffer size
Browse files Browse the repository at this point in the history
Fixes: inetaf#40

Signed-off-by: Or Ozeri <[email protected]>
  • Loading branch information
orozery committed Mar 1, 2024
1 parent 3ce5804 commit 95f9559
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcpproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (p *Proxy) serveListener(ret chan<- error, ln net.Listener, routes []route)
// serveConn runs in its own goroutine and matches c against routes.
// It returns whether it matched purely for testing.
func (p *Proxy) serveConn(c net.Conn, routes []route) bool {
br := bufio.NewReader(c)
br := bufio.NewReaderSize(c, 65536)
for _, route := range routes {
if target, hostName := route.match(br); target != nil {
if n := br.Buffered(); n > 0 {
Expand Down

0 comments on commit 95f9559

Please sign in to comment.