mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
avoid writing empty payload in bytesToBufferWriter
This commit is contained in:
parent
cf080e8061
commit
3d2fd372e1
@ -90,11 +90,10 @@ func (w *bytesToBufferWriter) WriteMultiBuffer(mb MultiBuffer) error {
|
||||
func (w *bytesToBufferWriter) ReadFrom(reader io.Reader) (int64, error) {
|
||||
mbReader := NewReader(reader)
|
||||
totalBytes := int64(0)
|
||||
eof := false
|
||||
for !eof {
|
||||
for {
|
||||
mb, err := mbReader.Read()
|
||||
if err == io.EOF {
|
||||
eof = true
|
||||
if errors.Cause(err) == io.EOF {
|
||||
break
|
||||
} else if err != nil {
|
||||
return totalBytes, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user