use fixed buffer size

This commit is contained in:
ginuerzh
2025-02-18 21:04:04 +08:00
parent e0915affda
commit 69a0aa8853
3 changed files with 6 additions and 14 deletions
+2 -4
View File
@@ -121,11 +121,9 @@ func (h *routerHandler) handleAssociate(ctx context.Context, conn net.Conn, netw
log.Debugf("%s/%s: router=%s, connector=%s, weight=%d established", host, network, routerID, connectorID, connectorID.Weight())
b := bufpool.Get(h.md.bufferSize)
defer bufpool.Put(b)
var b [MaxMessageSize]byte
for {
n, err := conn.Read(b)
n, err := conn.Read(b[:])
if err != nil {
if err == io.EOF {
return nil