|
|
@ -295,28 +295,21 @@ func (this *Server) transport(reader io.Reader, writer io.Writer, session *proxy
|
|
|
|
input := ray.InboundInput()
|
|
|
|
input := ray.InboundInput()
|
|
|
|
output := ray.InboundOutput()
|
|
|
|
output := ray.InboundOutput()
|
|
|
|
|
|
|
|
|
|
|
|
var inputFinish, outputFinish sync.Mutex
|
|
|
|
defer input.Close()
|
|
|
|
inputFinish.Lock()
|
|
|
|
defer output.Release()
|
|
|
|
outputFinish.Lock()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
go func() {
|
|
|
|
go func() {
|
|
|
|
v2reader := v2io.NewAdaptiveReader(reader)
|
|
|
|
v2reader := v2io.NewAdaptiveReader(reader)
|
|
|
|
defer v2reader.Release()
|
|
|
|
defer v2reader.Release()
|
|
|
|
|
|
|
|
|
|
|
|
v2io.Pipe(v2reader, input)
|
|
|
|
v2io.Pipe(v2reader, input)
|
|
|
|
inputFinish.Unlock()
|
|
|
|
|
|
|
|
input.Close()
|
|
|
|
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
go func() {
|
|
|
|
v2writer := v2io.NewAdaptiveWriter(writer)
|
|
|
|
v2writer := v2io.NewAdaptiveWriter(writer)
|
|
|
|
defer v2writer.Release()
|
|
|
|
defer v2writer.Release()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
v2io.Pipe(output, v2writer)
|
|
|
|
v2io.Pipe(output, v2writer)
|
|
|
|
outputFinish.Unlock()
|
|
|
|
output.Release()
|
|
|
|
output.Release()
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
outputFinish.Lock()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ServerFactory struct{}
|
|
|
|
type ServerFactory struct{}
|
|
|
|