Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Sep 12, 2015
1 parent b0c5b81 commit 88d212e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
5 changes: 2 additions & 3 deletions net/freedom/freedom.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ func (vconn *FreedomConnection) DumpOutput(conn net.Conn, output chan<- []byte,
}

func (vconn *FreedomConnection) CloseConn(conn net.Conn, finish <-chan bool) {
for i := 0; i < 2; i++ {
<-finish
}
<-finish
<-finish
conn.Close()
}
5 changes: 2 additions & 3 deletions net/socks/socks.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ func (server *SocksServer) dumpOutput(conn net.Conn, output <-chan []byte, finis
}

func (server *SocksServer) waitForFinish(finish <-chan bool) {
for i := 0; i < 2; i++ {
<-finish
}
<-finish
<-finish
}
5 changes: 2 additions & 3 deletions net/vmess/vmessin.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ func (handler *VMessInboundHandler) dumpOutput(writer io.Writer, output <-chan [
}

func (handler *VMessInboundHandler) waitForFinish(finish <-chan bool) {
for i := 0; i < 2; i++ {
<-finish
}
<-finish
<-finish
}

type VMessInboundHandlerFactory struct {
Expand Down
5 changes: 2 additions & 3 deletions net/vmess/vmessout.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ func (handler *VMessOutboundHandler) dumpInput(writer io.Writer, input <-chan []
}

func (handler *VMessOutboundHandler) waitForFinish(finish <-chan bool) {
for i := 0; i < 2; i++ {
<-finish
}
<-finish
<-finish
log.Debug("Finishing waiting for VMessOutbound ending.")
}

Expand Down

0 comments on commit 88d212e

Please sign in to comment.