mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
chore: fix some errors detected by staticcheck (#3089)
* chore: fix some errors detected by staticcheck * feat: remove `rand.Seed()` usage for possibly using "fastrand64" runtime to avoid locking ref: https://pkg.go.dev/math/rand#Seed
This commit is contained in:
parent
173b03448f
commit
a994bf8b04
10 changed files with 23 additions and 27 deletions
|
@ -101,7 +101,7 @@ func (s *Server) processTCP(ctx context.Context, conn stat.Connection, dispatche
|
|||
reader := &buf.BufferedReader{Reader: buf.NewReader(conn)}
|
||||
request, err := svrSession.Handshake(reader, conn)
|
||||
if err != nil {
|
||||
if inbound != nil && inbound.Source.IsValid() {
|
||||
if inbound.Source.IsValid() {
|
||||
log.Record(&log.AccessMessage{
|
||||
From: inbound.Source,
|
||||
To: "",
|
||||
|
@ -122,7 +122,7 @@ func (s *Server) processTCP(ctx context.Context, conn stat.Connection, dispatche
|
|||
if request.Command == protocol.RequestCommandTCP {
|
||||
dest := request.Destination()
|
||||
newError("TCP Connect request to ", dest).WriteToLog(session.ExportIDToError(ctx))
|
||||
if inbound != nil && inbound.Source.IsValid() {
|
||||
if inbound.Source.IsValid() {
|
||||
ctx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{
|
||||
From: inbound.Source,
|
||||
To: dest,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue