Chore: code style
This commit is contained in:
parent
558ac6b965
commit
68dd0622b8
@ -6,13 +6,13 @@ import (
|
|||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Dreamacro/clash/common/pool"
|
"github.com/Dreamacro/clash/common/pool"
|
||||||
"github.com/Dreamacro/clash/component/ssr/tools"
|
"github.com/Dreamacro/clash/component/ssr/tools"
|
||||||
|
"github.com/Dreamacro/clash/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
type tlsAuthData struct {
|
type tlsAuthData struct {
|
||||||
@ -63,7 +63,7 @@ func (t *tls12Ticket) Decode(b []byte) ([]byte, bool, error) {
|
|||||||
var h [5]byte
|
var h [5]byte
|
||||||
t.recvBuffer.Read(h[:])
|
t.recvBuffer.Read(h[:])
|
||||||
if !bytes.Equal(h[:3], []byte{0x17, 0x3, 0x3}) {
|
if !bytes.Equal(h[:3], []byte{0x17, 0x3, 0x3}) {
|
||||||
log.Println("incorrect magic number", h[:3], ", 0x170303 is expected")
|
log.Warnln("incorrect magic number %x, 0x170303 is expected", h[:3])
|
||||||
return nil, false, errTLS12TicketAuthIncorrectMagicNumber
|
return nil, false, errTLS12TicketAuthIncorrectMagicNumber
|
||||||
}
|
}
|
||||||
size := int(binary.BigEndian.Uint16(h[3:5]))
|
size := int(binary.BigEndian.Uint16(h[3:5]))
|
||||||
|
@ -403,7 +403,7 @@ func parseHosts(cfg *RawConfig) (*trie.DomainTrie, error) {
|
|||||||
|
|
||||||
// add default hosts
|
// add default hosts
|
||||||
if err := tree.Insert("localhost", net.IP{127, 0, 0, 1}); err != nil {
|
if err := tree.Insert("localhost", net.IP{127, 0, 0, 1}); err != nil {
|
||||||
println(err.Error())
|
log.Errorln("insert localhost to host error: %s", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(cfg.Hosts) != 0 {
|
if len(cfg.Hosts) != 0 {
|
||||||
|
Reference in New Issue
Block a user