1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

Clean up code

This commit is contained in:
V2Ray 2015-09-13 00:25:50 +02:00
parent b0c5b816da
commit 88d212eb22
4 changed files with 8 additions and 12 deletions

View File

@ -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()
}

View File

@ -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
}

View File

@ -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 {

View File

@ -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.")
}