1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

int -> int32

This commit is contained in:
RPRX 2020-09-24 12:18:11 +00:00 committed by GitHub
parent 4b0aea1dca
commit f55e05c166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,7 +192,7 @@ func (r *LengthPacketReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
if _, err := io.ReadFull(r.Reader, r.cache); err != nil { // maybe EOF
return nil, newError("failed to read packet length").Base(err)
}
length := int(r.cache[0])<<8 | int(r.cache[1])
length := int32(r.cache[0])<<8 | int32(r.cache[1])
//fmt.Println("Read", length)
mb := make(buf.MultiBuffer, 0, length/buf.Size+1)
for length > 0 {
@ -202,7 +202,7 @@ func (r *LengthPacketReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
}
length -= size
b := buf.New()
if _, err := b.ReadFullFrom(r.Reader, int32(size)); err != nil {
if _, err := b.ReadFullFrom(r.Reader, size); err != nil {
return nil, newError("failed to read packet payload").Base(err)
}
mb = append(mb, b)