WIP: Fixed rate limiting

This commit is contained in:
jdl 2025-08-26 16:17:46 +02:00
parent 169231d848
commit 3c4534f620

View File

@ -87,10 +87,6 @@ func (r *Remote) updateConf(conf remoteConfig) {
// ----------------------------------------------------------------------------
func (r *Remote) sendUDP(b []byte, addr netip.AddrPort) {
if err := r.limiter.Limit(); err != nil {
r.logf("Rate limiter")
return
}
if _, err := r.SendUDP(b, addr); err != nil {
r.logf("Failed to send URP packet: %v", err)
}
@ -162,6 +158,11 @@ func (r *Remote) relayData(toIP byte, enc []byte) {
}
func (r *Remote) sendControl(conf remoteConfig, data []byte) {
if err := r.limiter.Limit(); err != nil {
r.logf("Rate limiter")
return
}
if conf.Direct {
r.sendControlDirect(conf, data)
} else {