|
|
|
@ -148,7 +148,7 @@ func (this *VMessInboundHandler) HandleConnection(connection *hub.TCPConn) {
|
|
|
|
|
defer close(input)
|
|
|
|
|
defer readFinish.Unlock()
|
|
|
|
|
bodyReader := session.DecodeRequestBody(reader)
|
|
|
|
|
var requestReader v2io.ReleasableReader
|
|
|
|
|
var requestReader v2io.Reader
|
|
|
|
|
if request.Option.IsChunkStream() {
|
|
|
|
|
requestReader = vmessio.NewAuthChunkReader(bodyReader)
|
|
|
|
|
} else {
|
|
|
|
@ -179,12 +179,12 @@ func (this *VMessInboundHandler) HandleConnection(connection *hub.TCPConn) {
|
|
|
|
|
|
|
|
|
|
writer.SetCached(false)
|
|
|
|
|
go func(finish *sync.Mutex) {
|
|
|
|
|
var writer v2io.ReleasableWriter = v2io.NewAdaptiveWriter(bodyWriter)
|
|
|
|
|
var writer v2io.Writer = v2io.NewAdaptiveWriter(bodyWriter)
|
|
|
|
|
if request.Option.IsChunkStream() {
|
|
|
|
|
writer = vmessio.NewAuthChunkWriter(writer)
|
|
|
|
|
}
|
|
|
|
|
v2io.ChanToWriter(writer, output)
|
|
|
|
|
writer.Release()
|
|
|
|
|
writer.Release()
|
|
|
|
|
finish.Unlock()
|
|
|
|
|
}(&writeFinish)
|
|
|
|
|
writeFinish.Lock()
|
|
|
|
|