add src field for logger and recorder

This commit is contained in:
ginuerzh
2025-07-02 21:35:02 +08:00
parent 97ed5080a6
commit d9a2f44a78
27 changed files with 217 additions and 92 deletions
+3
View File
@@ -63,6 +63,9 @@ func (h *httpHandler) handleUDP(ctx context.Context, conn net.Conn, ro *xrecorde
}
defer c.Close()
log.WithFields(map[string]any{"src": c.LocalAddr().String()})
ro.Src = c.LocalAddr().String()
pc, ok := c.(net.PacketConn)
if !ok {
err = errors.New("wrong connection type")