mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-02 23:35:40 -05:00
discard bad connections
This commit is contained in:
@@ -169,7 +169,11 @@ func (this *VMessInboundHandler) HandleConnection(connection *hub.Connection) {
|
||||
} else {
|
||||
requestReader = v2io.NewAdaptiveReader(bodyReader)
|
||||
}
|
||||
v2io.Pipe(requestReader, input)
|
||||
err := v2io.Pipe(requestReader, input)
|
||||
if err != vmessio.ErrorStreamCompleted {
|
||||
connection.SetReusable(false)
|
||||
}
|
||||
|
||||
requestReader.Release()
|
||||
input.Close()
|
||||
readFinish.Unlock()
|
||||
@@ -197,7 +201,11 @@ func (this *VMessInboundHandler) HandleConnection(connection *hub.Connection) {
|
||||
|
||||
writer.SetCached(false)
|
||||
|
||||
v2io.Pipe(output, v2writer)
|
||||
err = v2io.Pipe(output, v2writer)
|
||||
if err != vmessio.ErrorStreamCompleted {
|
||||
connection.SetReusable(false)
|
||||
}
|
||||
|
||||
output.Release()
|
||||
if request.Option.IsChunkStream() {
|
||||
v2writer.Write(alloc.NewSmallBuffer().Clear())
|
||||
|
||||
Reference in New Issue
Block a user