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:
parent
b0c5b816da
commit
88d212eb22
@ -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()
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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.")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user