mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-10-31 16:15:28 +00:00
Merge branch 'master' of github.com:v2ray/v2ray-core
This are significant amount of change introduced in this merge, needs additional testing.
This commit is contained in:
+14
-3
@@ -1,6 +1,7 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"context"
|
||||
|
||||
@@ -25,7 +26,8 @@ type AccessMessage struct {
|
||||
To interface{}
|
||||
Status AccessStatus
|
||||
Reason interface{}
|
||||
Detour interface{}
|
||||
Email string
|
||||
Detour string
|
||||
}
|
||||
|
||||
func (m *AccessMessage) String() string {
|
||||
@@ -36,9 +38,18 @@ func (m *AccessMessage) String() string {
|
||||
builder.WriteByte(' ')
|
||||
builder.WriteString(serial.ToString(m.To))
|
||||
builder.WriteByte(' ')
|
||||
builder.WriteString(serial.ToString(m.Detour))
|
||||
builder.WriteByte(' ')
|
||||
if len(m.Detour) > 0 {
|
||||
builder.WriteByte('[')
|
||||
builder.WriteString(m.Detour)
|
||||
builder.WriteString("] ")
|
||||
}
|
||||
builder.WriteString(serial.ToString(m.Reason))
|
||||
|
||||
if len(m.Email) > 0 {
|
||||
builder.WriteString("email:")
|
||||
builder.WriteString(m.Email)
|
||||
builder.WriteByte(' ')
|
||||
}
|
||||
return builder.String()
|
||||
}
|
||||
|
||||
|
||||
@@ -118,8 +118,9 @@ func (w *ServerWorker) handleStatusNew(ctx context.Context, meta *FrameMetadata,
|
||||
}
|
||||
if inbound := session.InboundFromContext(ctx); inbound != nil && inbound.Source.IsValid() {
|
||||
msg.From = inbound.Source
|
||||
msg.Email = inbound.User.Email
|
||||
}
|
||||
log.Record(msg)
|
||||
ctx = log.ContextWithAccessMessage(ctx, msg)
|
||||
}
|
||||
link, err := w.dispatcher.Dispatch(ctx, meta.Target)
|
||||
if err != nil {
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ func PortFromString(s string) (Port, error) {
|
||||
return PortFromInt(uint32(val))
|
||||
}
|
||||
|
||||
// Value return the correspoding uint16 value of a Port.
|
||||
// Value return the corresponding uint16 value of a Port.
|
||||
func (p Port) Value() uint16 {
|
||||
return uint16(p)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user