Skip to content

Commit

Permalink
udpnat2: Set upstream to writer
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Nov 8, 2024
1 parent 6e1285b commit d159f02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions common/udpnat2/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
1 change: 0 additions & 1 deletion common/udpnat2/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d159f02

Please sign in to comment.