Skip to content

Commit

Permalink
FIX shadowsocks#417 shadowsocks#418, switch should be changed into se…
Browse files Browse the repository at this point in the history
…lect
  • Loading branch information
arthurkiller committed Jul 23, 2018
1 parent 3748388 commit 323704e
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions cmd/shadowsocks-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ const (
typeDm = 3 // type is domain address
typeIPv6 = 4 // type is ipv6 address

lenIPv4 = net.IPv4len + 2 // ipv4 + 2port
lenIPv6 = net.IPv6len + 2 // ipv6 + 2port
lenDmBase = 2 // 1addrLen + 2port, plus addrLen
lenIPv4 = net.IPv4len + 2 // ipv4 + 2port
lenIPv6 = net.IPv6len + 2 // ipv6 + 2port
lenDmBase = 2 // 1addrLen + 2port, plus addrLen
// lenHmacSha1 = 10
)

Expand Down Expand Up @@ -99,11 +99,11 @@ var connCnt int
var nextLogConnCnt = logCntDelta

func sanitizeAddr(addr net.Addr) string {
if sanitizeIps {
return "x.x.x.x:zzzz"
} else {
return addr.String()
}
if sanitizeIps {
return "x.x.x.x:zzzz"
} else {
return addr.String()
}
}

func handleConnection(conn *ss.Conn, port string) {
Expand Down Expand Up @@ -513,11 +513,10 @@ func managerDaemon(conn *net.UDPConn) {
go func() {
timer := time.Tick(10 * time.Second)
for {
<-timer
switch {
select {
case <-ctx:
return
default:
case <-timer:
for _, addr := range reportconnSet {
res := reportStat()
if len(res) == 0 {
Expand Down

0 comments on commit 323704e

Please sign in to comment.