Amend XUDP related logs

- Useful for debug XUDP improvements
- Move XUDP log in core log
- Freedom connection log show local port
This commit is contained in:
yuhan6665 2023-04-08 20:56:54 -04:00
parent 76b27a37cb
commit 05d24d6827
3 changed files with 7 additions and 24 deletions

View file

@ -117,7 +117,6 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
UDPOverride.Port = destination.Port
}
}
newError("opening connection to ", destination).WriteToLog(session.ExportIDToError(ctx))
input := link.Reader
output := link.Writer
@ -148,6 +147,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
return newError("failed to open connection to ", destination).Base(err)
}
defer conn.Close()
newError("connection opened to ", destination, ", local endpoint ", conn.LocalAddr(), ", remote endpoint ", conn.RemoteAddr()).WriteToLog(session.ExportIDToError(ctx))
var newCtx context.Context
var newCancel context.CancelFunc