udpnat2: Set upstream to writer

This commit is contained in:
世界 2024-11-08 10:22:04 +08:00
parent b5f9e70ffd
commit 524a6bd0d1
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
2 changed files with 4 additions and 1 deletions

View file

@ -104,3 +104,7 @@ func (c *Conn) SetReadDeadline(t time.Time) error {
func (c *Conn) SetWriteDeadline(t time.Time) error {
return os.ErrInvalid
}
func (c *Conn) Upstream() any {
return c.writer
}

View file

@ -55,7 +55,6 @@ func (s *Service) NewPacket(bufferSlices [][]byte, source M.Socksaddr, destinati
if !loaded {
ok, ctx, writer, onClose := s.prepare(source, destination, userData)
if !ok {
println(2)
s.metrics.Rejects++
return
}