修复合并企业版遗留的一些bug.

This commit is contained in:
arraykeys@gmail.com
2018-11-01 12:59:56 +08:00
parent e95a1f8ad5
commit 80146fbe0d
13 changed files with 17 additions and 17 deletions

View File

@ -92,7 +92,7 @@ func (s *DNS) InitService() (err error) {
nil,
&net.Dialer{
Timeout: 5 * time.Second,
KeepAlive: 5 * time.Second,
KeepAlive: 2 * time.Second,
},
)
if err != nil {
@ -133,7 +133,7 @@ func (s *DNS) StopService() {
if e != nil {
s.log.Printf("stop dns service crashed,%s", e)
} else {
s.log.Printf("service dns stoped")
s.log.Printf("service dns stopped")
}
}()
Stop(s.serviceKey)

View File

@ -85,8 +85,8 @@ func StartWithLog(serviceID, serviceArgsStr string, loggerCallback LogCallback)
nolog := app.Flag("nolog", "turn off logging").Default("false").Bool()
kcpArgs.Key = app.Flag("kcp-key", "pre-shared secret between client and server").Default("secrect").String()
kcpArgs.Crypt = app.Flag("kcp-method", "encrypt/decrypt method, can be: aes, aes-128, aes-192, salsa20, blowfish, twofish, cast5, 3des, tea, xtea, xor, sm4, none").Default("aes").Enum("aes", "aes-128", "aes-192", "salsa20", "blowfish", "twofish", "cast5", "3des", "tea", "xtea", "xor", "sm4", "none")
kcpArgs.Mode = app.Flag("kcp-mode", "profiles: fast3, fast2, fast, normal, manual").Default("fast").Enum("fast3", "fast2", "fast", "normal", "manual")
kcpArgs.MTU = app.Flag("kcp-mtu", "set maximum transmission unit for UDP packets").Default("450").Int()
kcpArgs.Mode = app.Flag("kcp-mode", "profiles: fast3, fast2, fast, normal, manual").Default("fast3").Enum("fast3", "fast2", "fast", "normal", "manual")
kcpArgs.MTU = app.Flag("kcp-mtu", "set maximum transmission unit for UDP packets").Default("1350").Int()
kcpArgs.SndWnd = app.Flag("kcp-sndwnd", "set send window size(num of packets)").Default("1024").Int()
kcpArgs.RcvWnd = app.Flag("kcp-rcvwnd", "set receive window size(num of packets)").Default("1024").Int()
kcpArgs.DataShard = app.Flag("kcp-ds", "set reed-solomon erasure coding - datashard").Default("10").Int()

View File

@ -238,7 +238,7 @@ func (s *HTTP) StopService() {
if e != nil {
s.log.Printf("stop http(s) service crashed,%s", e)
} else {
s.log.Printf("service http(s) stoped")
s.log.Printf("service http(s) stopped")
}
s.basicAuth = utils.BasicAuth{}
s.cfg = HTTPArgs{}
@ -425,7 +425,7 @@ func (s *HTTP) OutToTCP(useProxy bool, address string, inConn *net.Conn, req *ut
//https或者http,上级是代理,proxy需要转发
outConn.SetDeadline(time.Now().Add(time.Millisecond * time.Duration(*s.cfg.Timeout)))
//直连目标或上级非代理或非SNI,,清理HTTP头部的代理头信息
if !useProxy || *s.cfg.ParentType == "ssh" && !req.IsSNI {
if (!useProxy || *s.cfg.ParentType == "ssh") && !req.IsSNI {
_, err = outConn.Write(utils.RemoveProxyHeaders(req.HeadBuf))
} else {
_, err = outConn.Write(req.HeadBuf)

View File

@ -81,7 +81,7 @@ func (s *MuxBridge) StopService() {
if e != nil {
s.log.Printf("stop bridge service crashed,%s", e)
} else {
s.log.Printf("service bridge stoped")
s.log.Printf("service bridge stopped")
}
s.cfg = MuxBridgeArgs{}
s.clientControlConns = nil

View File

@ -111,7 +111,7 @@ func (s *MuxClient) StopService() {
if e != nil {
s.log.Printf("stop client service crashed,%s", e)
} else {
s.log.Printf("service client stoped")
s.log.Printf("service client stopped")
}
s.cfg = MuxClientArgs{}
s.jumper = nil

View File

@ -207,7 +207,7 @@ func (s *MuxServer) StopService() {
if e != nil {
s.log.Printf("stop server service crashed,%s", e)
} else {
s.log.Printf("service server stoped")
s.log.Printf("service server stopped")
}
s.cfg = MuxServerArgs{}
s.jumper = nil

View File

@ -230,7 +230,7 @@ func (s *Socks) StopService() {
if e != nil {
s.log.Printf("stop socks service crashed,%s", e)
} else {
s.log.Printf("service socks stoped")
s.log.Printf("service socks stopped")
}
s.basicAuth = utils.BasicAuth{}
s.cfg = SocksArgs{}

View File

@ -193,7 +193,7 @@ func (s *SPS) StopService() {
if e != nil {
s.log.Printf("stop sps service crashed,%s", e)
} else {
s.log.Printf("service sps stoped")
s.log.Printf("service sps stopped")
}
s.basicAuth = utils.BasicAuth{}
s.cfg = SPSArgs{}
@ -254,7 +254,7 @@ func (s *SPS) Start(args interface{}, log *logger.Logger) (err error) {
err = sc.ListenTCP(s.callback)
} else if *s.cfg.LocalType == "tls" {
err = sc.ListenTLS(s.cfg.CertBytes, s.cfg.KeyBytes, s.cfg.CaCertBytes, s.callback)
} else if *s.cfg.LocalType == "tcp" {
} else if *s.cfg.LocalType == "kcp" {
err = sc.ListenKCP(s.cfg.KCP, s.callback, s.log)
}
if *s.cfg.ParentServiceType == "socks" {

View File

@ -100,7 +100,7 @@ func (s *TCP) StopService() {
if e != nil {
s.log.Printf("stop tcp service crashed,%s", e)
} else {
s.log.Printf("service tcp stoped")
s.log.Printf("service tcp stopped")
}
s.cfg = TCPArgs{}
s.jumper = nil

View File

@ -72,7 +72,7 @@ func (s *TunnelBridge) StopService() {
if e != nil {
s.log.Printf("stop tbridge service crashed,%s", e)
} else {
s.log.Printf("service tbridge stoped")
s.log.Printf("service tbridge stopped")
}
s.cfg = TunnelBridgeArgs{}
s.clientControlConns = nil

View File

@ -95,7 +95,7 @@ func (s *TunnelClient) StopService() {
if e != nil {
s.log.Printf("stop tclient service crashed,%s", e)
} else {
s.log.Printf("service tclient stoped")
s.log.Printf("service tclient stopped")
}
s.cfg = TunnelClientArgs{}
s.ctrlConn = nil

View File

@ -176,7 +176,7 @@ func (s *TunnelServer) StopService() {
if e != nil {
s.log.Printf("stop server service crashed,%s", e)
} else {
s.log.Printf("service server stoped")
s.log.Printf("service server stopped")
}
s.cfg = TunnelServerArgs{}
s.jumper = nil

View File

@ -94,7 +94,7 @@ func (s *UDP) StopService() {
if e != nil {
s.log.Printf("stop udp service crashed,%s", e)
} else {
s.log.Printf("service udp stoped")
s.log.Printf("service udp stopped")
}
s.cfg = UDPArgs{}
s.log = nil