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:
Shelikhoo
2019-10-30 20:03:11 +08:00
85 changed files with 863 additions and 16378 deletions
+14 -3
View File
@@ -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()
}
+2 -1
View File
@@ -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
View File
@@ -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)
}