1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-15 16:56:08 -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) { func (vconn *FreedomConnection) CloseConn(conn net.Conn, finish <-chan bool) {
for i := 0; i < 2; i++ { <-finish
<-finish <-finish
}
conn.Close() 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) { 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) { func (handler *VMessInboundHandler) waitForFinish(finish <-chan bool) {
for i := 0; i < 2; i++ { <-finish
<-finish <-finish
}
} }
type VMessInboundHandlerFactory struct { 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) { func (handler *VMessOutboundHandler) waitForFinish(finish <-chan bool) {
for i := 0; i < 2; i++ { <-finish
<-finish <-finish
}
log.Debug("Finishing waiting for VMessOutbound ending.") log.Debug("Finishing waiting for VMessOutbound ending.")
} }