1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00
* fix typo

* fix typo

* fix typo

* fix typo

* fix typo

* fix typo

* fic typo
This commit is contained in:
Machtergreifung 2022-01-02 21:36:07 +08:00 committed by GitHub
parent d24c276cc5
commit 25ae87aad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 14 deletions

View File

@ -14,7 +14,7 @@ import (
"github.com/v2fly/v2ray-core/v4/features/dns"
)
// newFakeDNSSniffer Create a Fake DNS metadata sniffer
// newFakeDNSSniffer Creates a Fake DNS metadata sniffer
func newFakeDNSSniffer(ctx context.Context) (protocolSnifferWithMetadata, error) {
var fakeDNSEngine dns.FakeDNSEngine
err := core.RequireFeatures(ctx, func(fdns dns.FakeDNSEngine) {

View File

@ -13,7 +13,7 @@ import (
dns_feature "github.com/v2fly/v2ray-core/v4/features/dns"
)
// Fqdn normalize domain make sure it ends with '.'
// Fqdn normalizes domain make sure it ends with '.'
func Fqdn(domain string) string {
if len(domain) > 0 && strings.HasSuffix(domain, ".") {
return domain
@ -163,7 +163,7 @@ func buildReqMsgs(domain string, option dns_feature.IPOption, reqIDGen func() ui
return reqs
}
// parseResponse parse DNS answers from the returned payload
// parseResponse parses DNS answers from the returned payload
func parseResponse(payload []byte) (*IPRecord, error) {
var parser dnsmessage.Parser
h, err := parser.Start(payload)

View File

@ -105,7 +105,7 @@ func (fkdns *Holder) initialize(ipPoolCidr string, lruSize int) error {
return nil
}
// GetFakeIPForDomain check and generate a fake IP for a domain name
// GetFakeIPForDomain checks and generate a fake IP for a domain name
func (fkdns *Holder) GetFakeIPForDomain(domain string) []net.Address {
if v, ok := fkdns.domainToIP.Get(domain); ok {
return []net.Address{v.(net.Address)}
@ -128,7 +128,7 @@ func (fkdns *Holder) GetFakeIPForDomain(domain string) []net.Address {
return []net.Address{ip}
}
// GetDomainFromFakeDNS check if an IP is a fake IP and have corresponding domain name
// GetDomainFromFakeDNS checks if an IP is a fake IP and have corresponding domain name
func (fkdns *Holder) GetDomainFromFakeDNS(ip net.Address) string {
if !ip.Family().IsIP() || !fkdns.ipRange.Contains(ip.IP()) {
return ""

View File

@ -175,7 +175,7 @@ func (h *HealthPing) doCheck(tags []string, duration time.Duration, rounds int)
}
}
// PutResult put a ping rtt to results
// PutResult puts a ping rtt to results
func (h *HealthPing) PutResult(tag string, rtt time.Duration) {
h.access.Lock()
defer h.access.Unlock()

View File

@ -9,7 +9,7 @@ import (
const replayFilterCapacity = 100000
// ReplayFilter check for replay attacks.
// ReplayFilter checks for replay attacks.
type ReplayFilter struct {
lock sync.Mutex
poolA *cuckoo.Filter
@ -19,7 +19,7 @@ type ReplayFilter struct {
interval int64
}
// NewReplayFilter create a new filter with specifying the expiration time interval in seconds.
// NewReplayFilter creates a new filter with specifying the expiration time interval in seconds.
func NewReplayFilter(interval int64) *ReplayFilter {
filter := &ReplayFilter{}
filter.interval = interval
@ -31,7 +31,7 @@ func (filter *ReplayFilter) Interval() int64 {
return filter.interval
}
// Check determine if there are duplicate records.
// Check determines if there are duplicate records.
func (filter *ReplayFilter) Check(sum []byte) bool {
filter.lock.Lock()
defer filter.lock.Unlock()

View File

@ -53,7 +53,7 @@ func MergeBytes(dest MultiBuffer, src []byte) MultiBuffer {
return dest
}
// ReleaseMulti release all content of the MultiBuffer, and returns an empty MultiBuffer.
// ReleaseMulti releases all content of the MultiBuffer, and returns an empty MultiBuffer.
func ReleaseMulti(mb MultiBuffer) MultiBuffer {
for i := range mb {
mb[i].Release()
@ -235,7 +235,7 @@ func (mb MultiBuffer) Len() int32 {
return size
}
// IsEmpty return true if the MultiBuffer has no content.
// IsEmpty returns true if the MultiBuffer has no content.
func (mb MultiBuffer) IsEmpty() bool {
for _, b := range mb {
if !b.IsEmpty() {
@ -283,14 +283,14 @@ func (c *MultiBufferContainer) Write(b []byte) (int, error) {
return len(b), nil
}
// WriteMultiBuffer implement Writer.
// WriteMultiBuffer implements Writer.
func (c *MultiBufferContainer) WriteMultiBuffer(b MultiBuffer) error {
mb, _ := MergeMulti(c.MultiBuffer, b)
c.MultiBuffer = mb
return nil
}
// Close implement io.Closer.
// Close implements io.Closer.
func (c *MultiBufferContainer) Close() error {
c.MultiBuffer = ReleaseMulti(c.MultiBuffer)
return nil

2
common/cache/lru.go vendored
View File

@ -25,7 +25,7 @@ type lruElement struct {
value interface{}
}
// NewLru init a lru cache
// NewLru initializes a lru cache
func NewLru(cap int) Lru {
return &lru{
capacity: cap,