|
|
@ -165,32 +165,31 @@ func (this *DokodemoDoor) HandleTCPConnection(conn internet.Connection) {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
defer ray.InboundOutput().Release()
|
|
|
|
defer ray.InboundOutput().Release()
|
|
|
|
|
|
|
|
|
|
|
|
var inputFinish, outputFinish sync.Mutex
|
|
|
|
var wg sync.WaitGroup
|
|
|
|
inputFinish.Lock()
|
|
|
|
|
|
|
|
outputFinish.Lock()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reader := v2net.NewTimeOutReader(this.config.Timeout, conn)
|
|
|
|
reader := v2net.NewTimeOutReader(this.config.Timeout, conn)
|
|
|
|
defer reader.Release()
|
|
|
|
defer reader.Release()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wg.Add(1)
|
|
|
|
go func() {
|
|
|
|
go func() {
|
|
|
|
v2reader := v2io.NewAdaptiveReader(reader)
|
|
|
|
v2reader := v2io.NewAdaptiveReader(reader)
|
|
|
|
defer v2reader.Release()
|
|
|
|
defer v2reader.Release()
|
|
|
|
|
|
|
|
|
|
|
|
v2io.Pipe(v2reader, ray.InboundInput())
|
|
|
|
v2io.Pipe(v2reader, ray.InboundInput())
|
|
|
|
inputFinish.Unlock()
|
|
|
|
wg.Done()
|
|
|
|
ray.InboundInput().Close()
|
|
|
|
ray.InboundInput().Close()
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wg.Add(1)
|
|
|
|
go func() {
|
|
|
|
go func() {
|
|
|
|
v2writer := v2io.NewAdaptiveWriter(conn)
|
|
|
|
v2writer := v2io.NewAdaptiveWriter(conn)
|
|
|
|
defer v2writer.Release()
|
|
|
|
defer v2writer.Release()
|
|
|
|
|
|
|
|
|
|
|
|
v2io.Pipe(ray.InboundOutput(), v2writer)
|
|
|
|
v2io.Pipe(ray.InboundOutput(), v2writer)
|
|
|
|
outputFinish.Unlock()
|
|
|
|
wg.Done()
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
outputFinish.Lock()
|
|
|
|
wg.Wait()
|
|
|
|
inputFinish.Lock()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type Factory struct{}
|
|
|
|
type Factory struct{}
|
|
|
|