Skip to content

Commit efe7519

Browse files
committed
Increase server first packet buffer size to 2000
1 parent 7f9c174 commit efe7519

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/server/dispatcher.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import (
2020

2121
var b64 = base64.StdEncoding.EncodeToString
2222

23+
const firstPacketSize = 2000
24+
2325
func Serve(l net.Listener, sta *State) {
2426
waitDur := [10]time.Duration{
2527
50 * time.Millisecond, 100 * time.Millisecond, 300 * time.Millisecond, 500 * time.Millisecond, 1 * time.Second,
@@ -124,7 +126,7 @@ func readFirstPacket(conn net.Conn, buf []byte, timeout time.Duration) (int, Tra
124126

125127
func dispatchConnection(conn net.Conn, sta *State) {
126128
var err error
127-
buf := make([]byte, 1500)
129+
buf := make([]byte, firstPacketSize)
128130

129131
i, transport, redirOnErr, err := readFirstPacket(conn, buf, 15*time.Second)
130132
data := buf[:i]

0 commit comments

Comments
 (0)