mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
Chore: fix typo (#1017)
This commit is contained in:
parent
1752566405
commit
4f3d3dbe6e
2
common/cache/lrucache.go
vendored
2
common/cache/lrucache.go
vendored
|
@ -121,7 +121,7 @@ func (c *LruCache) Set(key interface{}, value interface{}) {
|
|||
c.SetWithExpire(key, value, time.Unix(expires, 0))
|
||||
}
|
||||
|
||||
// SetWithExpire stores the interface{} representation of a response for a given key and given exires.
|
||||
// SetWithExpire stores the interface{} representation of a response for a given key and given expires.
|
||||
// The expires time will round to second.
|
||||
func (c *LruCache) SetWithExpire(key interface{}, value interface{}, expires time.Time) {
|
||||
c.mu.Lock()
|
||||
|
|
|
@ -61,7 +61,7 @@ func (alloc *Allocator) Put(buf []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// msb return the pos of most significiant bit
|
||||
// msb return the pos of most significant bit
|
||||
func msb(size int) uint16 {
|
||||
return uint16(bits.Len32(uint32(size)) - 1)
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ type Result struct {
|
|||
Err error
|
||||
}
|
||||
|
||||
// Do single.Do likes sync.singleFilght
|
||||
//lint:ignore ST1008 it likes sync.singleFilght
|
||||
// Do single.Do likes sync.singleFlight
|
||||
//lint:ignore ST1008 it likes sync.singleFlight
|
||||
func (s *Single) Do(fn func() (interface{}, error)) (v interface{}, err error, shared bool) {
|
||||
s.mux.Lock()
|
||||
now := time.Now()
|
||||
|
|
|
@ -23,7 +23,7 @@ func proxyGroupsDagSort(groupsConfig []map[string]interface{}) error {
|
|||
indegree int
|
||||
// topological order
|
||||
topo int
|
||||
// the origional data in `groupsConfig`
|
||||
// the original data in `groupsConfig`
|
||||
data map[string]interface{}
|
||||
// `outdegree` and `from` are used in loop locating
|
||||
outdegree int
|
||||
|
@ -65,7 +65,7 @@ func proxyGroupsDagSort(groupsConfig []map[string]interface{}) error {
|
|||
index := 0
|
||||
queue := make([]string, 0)
|
||||
for name, node := range graph {
|
||||
// in the begning, put nodes that have `node.indegree == 0` into queue.
|
||||
// in the beginning, put nodes that have `node.indegree == 0` into queue.
|
||||
if node.indegree == 0 {
|
||||
queue = append(queue, name)
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ type UDPPacket interface {
|
|||
|
||||
// WriteBack writes the payload with source IP/Port equals addr
|
||||
// - variable source IP/Port is important to STUN
|
||||
// - if addr is not provided, WriteBack will wirte out UDP packet with SourceIP/Prot equals to origional Target,
|
||||
// - if addr is not provided, WriteBack will write out UDP packet with SourceIP/Port equals to original Target,
|
||||
// this is important when using Fake-IP.
|
||||
WriteBack(b []byte, addr net.Addr) (n int, err error)
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ func updateConfigs(w http.ResponseWriter, r *http.Request) {
|
|||
} else {
|
||||
if !filepath.IsAbs(req.Path) {
|
||||
render.Status(r, http.StatusBadRequest)
|
||||
render.JSON(w, r, newError("path is not a absoluted path"))
|
||||
render.JSON(w, r, newError("path is not a absolute path"))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ func (c *packet) Data() []byte {
|
|||
return c.buf
|
||||
}
|
||||
|
||||
// WriteBack opens a new socket binding `addr` to wirte UDP packet back
|
||||
// WriteBack opens a new socket binding `addr` to write UDP packet back
|
||||
func (c *packet) WriteBack(b []byte, addr net.Addr) (n int, err error) {
|
||||
tc, err := dialUDP("udp", addr.(*net.UDPAddr), c.lAddr)
|
||||
if err != nil {
|
||||
|
|
|
@ -18,7 +18,7 @@ func (c *packet) Data() []byte {
|
|||
return c.payload
|
||||
}
|
||||
|
||||
// WriteBack wirtes UDP packet with source(ip, port) = `addr`
|
||||
// WriteBack write UDP packet with source(ip, port) = `addr`
|
||||
func (c *packet) WriteBack(b []byte, addr net.Addr) (n int, err error) {
|
||||
packet, err := socks5.EncodeUDPPacket(socks5.ParseAddrToSocksAddr(addr), b)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user