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

@ -1,7 +1,6 @@
package mux
import (
"fmt"
"io"
"runtime"
"sync"
@ -11,7 +10,6 @@ import (
"github.com/xtls/xray-core/common/buf"
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/protocol"
"github.com/xtls/xray-core/common/xudp"
"github.com/xtls/xray-core/transport/pipe"
)
@ -182,9 +180,7 @@ func (s *Session) Close(locked bool) error {
if s.XUDP.Status == Active {
s.XUDP.Expire = time.Now().Add(time.Minute)
s.XUDP.Status = Expiring
if xudp.Show {
fmt.Printf("XUDP put: %v\n", s.XUDP.GlobalID)
}
newError("XUDP put ", s.XUDP.GlobalID).AtDebug().WriteToLog()
}
XUDPManager.Unlock()
}
@ -234,9 +230,7 @@ func init() {
if x.Status == Expiring && now.After(x.Expire) {
x.Interrupt()
delete(XUDPManager.Map, id)
if xudp.Show {
fmt.Printf("XUDP del: %v\n", id)
}
newError("XUDP del ", id).AtDebug().WriteToLog()
}
}
XUDPManager.Unlock()