1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-09-29 21:54:10 -04:00

release all adaptive readers and writers

This commit is contained in:
v2ray
2016-04-18 19:01:24 +02:00
parent 7768674df8
commit 44bf412dfc
7 changed files with 52 additions and 13 deletions

View File

@@ -133,13 +133,19 @@ func (this *DokodemoDoor) HandleTCPConnection(conn *hub.TCPConn) {
reader := v2net.NewTimeOutReader(this.config.Timeout, conn)
go func() {
v2io.Pipe(v2io.NewAdaptiveReader(reader), ray.InboundInput())
v2reader := v2io.NewAdaptiveReader(reader)
defer v2reader.Release()
v2io.Pipe(v2reader, ray.InboundInput())
inputFinish.Unlock()
ray.InboundInput().Close()
}()
go func() {
v2io.Pipe(ray.InboundOutput(), v2io.NewAdaptiveWriter(conn))
v2writer := v2io.NewAdaptiveWriter(conn)
defer v2writer.Release()
v2io.Pipe(ray.InboundOutput(), v2writer)
outputFinish.Unlock()
}()