mirror of
https://github.com/MetaCubeX/Clash.Meta.git
synced 2025-04-19 16:50:56 +00:00
fix: vision conn read short buffer error
This commit is contained in:
parent
9e0889c02c
commit
a75e570cca
1 changed files with 9 additions and 4 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"crypto/subtle"
|
||||
gotls "crypto/tls"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
|
@ -117,9 +118,11 @@ func (vc *Conn) ReadBuffer(buffer *buf.Buffer) error {
|
|||
case commandPaddingDirect:
|
||||
needReturn := false
|
||||
if vc.input != nil {
|
||||
_, err := buffer.ReadFrom(vc.input)
|
||||
_, err := buffer.ReadOnceFrom(vc.input)
|
||||
if err != nil {
|
||||
return err
|
||||
if !errors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if vc.input.Len() == 0 {
|
||||
needReturn = true
|
||||
|
@ -129,9 +132,11 @@ func (vc *Conn) ReadBuffer(buffer *buf.Buffer) error {
|
|||
}
|
||||
}
|
||||
if vc.rawInput != nil {
|
||||
_, err := buffer.ReadFrom(vc.rawInput)
|
||||
_, err := buffer.ReadOnceFrom(vc.rawInput)
|
||||
if err != nil {
|
||||
return err
|
||||
if !errors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
needReturn = true
|
||||
if vc.rawInput.Len() == 0 {
|
||||
|
|
Loading…
Add table
Reference in a new issue