chore: decrease direct udp read memory used for no-windows platform

This commit is contained in:
wwqgtxx
2023-05-11 13:47:51 +08:00
parent d9fa051dd8
commit 75cd72385a
8 changed files with 178 additions and 17 deletions

View File

@ -3,8 +3,6 @@ package outbound
import (
"context"
"errors"
"net"
"github.com/Dreamacro/clash/component/dialer"
"github.com/Dreamacro/clash/component/resolver"
C "github.com/Dreamacro/clash/constant"
@ -39,11 +37,7 @@ func (d *Direct) ListenPacketContext(ctx context.Context, metadata *C.Metadata,
if err != nil {
return nil, err
}
return newPacketConn(&directPacketConn{pc}, d), nil
}
type directPacketConn struct {
net.PacketConn
return newPacketConn(pc, d), nil
}
func NewDirect() *Direct {