add max active talk requests

This commit is contained in:
thinkAfCod 2025-05-14 09:59:41 +08:00 committed by Chen Kai
parent 7714d41097
commit 8d05d5da6d
2 changed files with 3 additions and 3 deletions

View file

@ -28,7 +28,7 @@ import (
) )
// This is a limit for the number of concurrent talk requests. // This is a limit for the number of concurrent talk requests.
const maxActiveTalkRequests = 1024 const maxActiveTalkRequests = 2048
// This is the timeout for acquiring a handler execution slot for a talk request. // This is the timeout for acquiring a handler execution slot for a talk request.
// The timeout should be short enough to fit within the request timeout. // The timeout should be short enough to fit within the request timeout.

View file

@ -774,8 +774,8 @@ func (t *UDPv5) send(toID enode.ID, toAddr netip.AddrPort, packet v5wire.Packet,
t.logcontext = append(t.logcontext, "rawpacket", hexutil.Encode(enc)) t.logcontext = append(t.logcontext, "rawpacket", hexutil.Encode(enc))
t.log.Trace(">> "+packet.Name(), t.logcontext...) t.log.Trace(">> "+packet.Name(), t.logcontext...)
dataForSend := bufferpool.Get(len(enc)) dataForSend := bufferpool.Get(len(enc))[:0]
copy(dataForSend, enc) dataForSend = append(dataForSend, enc...)
pw := pendingWrite{ pw := pendingWrite{
toAddr: toAddr, toAddr: toAddr,