Reformat code

This commit is contained in:
世界 2023-03-17 13:17:01 +08:00
parent f57ec13880
commit 55efac7236
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
8 changed files with 28 additions and 28 deletions

View File

@ -3,11 +3,10 @@ package protocol
import ( import (
"runtime" "runtime"
"golang.org/x/sys/cpu"
"github.com/xtls/xray-core/common/bitmask" "github.com/xtls/xray-core/common/bitmask"
"github.com/xtls/xray-core/common/net" "github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/uuid" "github.com/xtls/xray-core/common/uuid"
"golang.org/x/sys/cpu"
) )
// RequestCommand is a custom command in a proxy request. // RequestCommand is a custom command in a proxy request.

View File

@ -485,7 +485,7 @@ func XtlsPadding(b *buf.Buffer, command byte, userUUID *[]byte, longPadding bool
} }
paddingLen = int32(l.Int64()) paddingLen = int32(l.Int64())
} }
if paddingLen > buf.Size - 21 - contentLen { if paddingLen > buf.Size-21-contentLen {
paddingLen = buf.Size - 21 - contentLen paddingLen = buf.Size - 21 - contentLen
} }
newbuffer := buf.New() newbuffer := buf.New()

View File

@ -37,7 +37,6 @@ func NewDNS(ctx context.Context, config interface{}) (interface{}, error) {
buf := make([]byte, 0x100) buf := make([]byte, 0x100)
off1, err := dns.PackDomainName(dns.Fqdn(config.(*Config).Domain), buf, 0, nil, false) off1, err := dns.PackDomainName(dns.Fqdn(config.(*Config).Domain), buf, 0, nil, false)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -240,8 +240,10 @@ func UClient(c net.Conn, config *Config, ctx context.Context, dest net.Destinati
return uConn, nil return uConn, nil
} }
var href = regexp.MustCompile(`href="([/h].*?)"`) var (
var dot = []byte(".") href = regexp.MustCompile(`href="([/h].*?)"`)
dot = []byte(".")
)
var maps struct { var maps struct {
sync.Mutex sync.Mutex