mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-21 20:56:06 +03:00
chore: fix some comment typos (#3716)
Signed-off-by: curlwget <curlwget@icloud.com>
This commit is contained in:
parent
0df7fa23f8
commit
790f908f0b
@ -90,7 +90,7 @@ func NewClient(
|
|||||||
ns.PrioritizedDomain = append(ns.PrioritizedDomain, localTLDsAndDotlessDomains...)
|
ns.PrioritizedDomain = append(ns.PrioritizedDomain, localTLDsAndDotlessDomains...)
|
||||||
ns.OriginalRules = append(ns.OriginalRules, localTLDsAndDotlessDomainsRule)
|
ns.OriginalRules = append(ns.OriginalRules, localTLDsAndDotlessDomainsRule)
|
||||||
// The following lines is a solution to avoid core panics(rule index out of range) when setting `localhost` DNS client in config.
|
// The following lines is a solution to avoid core panics(rule index out of range) when setting `localhost` DNS client in config.
|
||||||
// Because the `localhost` DNS client will apend len(localTLDsAndDotlessDomains) rules into matcherInfos to match `geosite:private` default rule.
|
// Because the `localhost` DNS client will append len(localTLDsAndDotlessDomains) rules into matcherInfos to match `geosite:private` default rule.
|
||||||
// But `matcherInfos` has no enough length to add rules, which leads to core panics (rule index out of range).
|
// But `matcherInfos` has no enough length to add rules, which leads to core panics (rule index out of range).
|
||||||
// To avoid this, the length of `matcherInfos` must be equal to the expected, so manually append it with Golang default zero value first for later modification.
|
// To avoid this, the length of `matcherInfos` must be equal to the expected, so manually append it with Golang default zero value first for later modification.
|
||||||
// Related issues:
|
// Related issues:
|
||||||
|
@ -203,7 +203,7 @@ func TestStatsChannelBlocking(t *testing.T) {
|
|||||||
|
|
||||||
// Test blocking channel publishing
|
// Test blocking channel publishing
|
||||||
go func() {
|
go func() {
|
||||||
// Dummy messsage with no subscriber receiving, will block broadcasting goroutine
|
// Dummy message with no subscriber receiving, will block broadcasting goroutine
|
||||||
c.Publish(context.Background(), nil)
|
c.Publish(context.Background(), nil)
|
||||||
|
|
||||||
<-pauseCh
|
<-pauseCh
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ClientManager struct {
|
type ClientManager struct {
|
||||||
Enabled bool // wheather mux is enabled from user config
|
Enabled bool // whether mux is enabled from user config
|
||||||
Picker WorkerPicker
|
Picker WorkerPicker
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// copied from "github.com/golang/go/main.go"
|
// copied from "github.com/golang/go/main.go"
|
||||||
|
|
||||||
// Execute excute the commands
|
// Execute execute the commands
|
||||||
func Execute() {
|
func Execute() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
args := flag.Args()
|
args := flag.Args()
|
||||||
|
@ -319,7 +319,7 @@ func XtlsPadding(b *buf.Buffer, command byte, userUUID *[]byte, longPadding bool
|
|||||||
|
|
||||||
// XtlsUnpadding remove padding and parse command
|
// XtlsUnpadding remove padding and parse command
|
||||||
func XtlsUnpadding(b *buf.Buffer, s *TrafficState, ctx context.Context) *buf.Buffer {
|
func XtlsUnpadding(b *buf.Buffer, s *TrafficState, ctx context.Context) *buf.Buffer {
|
||||||
if s.RemainingCommand == -1 && s.RemainingContent == -1 && s.RemainingPadding == -1 { // inital state
|
if s.RemainingCommand == -1 && s.RemainingContent == -1 && s.RemainingPadding == -1 { // initial state
|
||||||
if b.Len() >= 21 && bytes.Equal(s.UserUUID, b.BytesTo(16)) {
|
if b.Len() >= 21 && bytes.Equal(s.UserUUID, b.BytesTo(16)) {
|
||||||
b.Advance(16)
|
b.Advance(16)
|
||||||
s.RemainingCommand = 5
|
s.RemainingCommand = 5
|
||||||
|
Loading…
Reference in New Issue
Block a user