mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 18:17:52 -05:00
properly handle error case
This commit is contained in:
parent
61a1cce972
commit
2b675335bd
@ -203,7 +203,11 @@ func (m *Client) handleStatusKeep(meta *FrameMetadata, reader *buf.BufferedReade
|
|||||||
}
|
}
|
||||||
|
|
||||||
if s, found := m.sessionManager.Get(meta.SessionID); found {
|
if s, found := m.sessionManager.Get(meta.SessionID); found {
|
||||||
return buf.Copy(s.NewReader(reader), s.output, buf.IgnoreWriterError())
|
if err := buf.Copy(s.NewReader(reader), s.output); err != nil {
|
||||||
|
drain(reader)
|
||||||
|
s.input.CloseError()
|
||||||
|
return s.Close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return drain(reader)
|
return drain(reader)
|
||||||
}
|
}
|
||||||
@ -359,7 +363,11 @@ func (w *ServerWorker) handleStatusKeep(meta *FrameMetadata, reader *buf.Buffere
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if s, found := w.sessionManager.Get(meta.SessionID); found {
|
if s, found := w.sessionManager.Get(meta.SessionID); found {
|
||||||
return buf.Copy(s.NewReader(reader), s.output, buf.IgnoreWriterError())
|
if err := buf.Copy(s.NewReader(reader), s.output); err != nil {
|
||||||
|
drain(reader)
|
||||||
|
s.input.CloseError()
|
||||||
|
return s.Close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return drain(reader)
|
return drain(reader)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user