Pass TestDecodeMessageBErr
This commit is contained in:
@@ -2,6 +2,7 @@ package hopp
|
||||
|
||||
import "io"
|
||||
import "net"
|
||||
import "errors"
|
||||
import "context"
|
||||
import "git.tebibyte.media/sashakoshka/hopp/tape"
|
||||
|
||||
@@ -148,7 +149,10 @@ func decodeMessageB(
|
||||
) {
|
||||
headerBuffer := [10]byte { }
|
||||
_, err = io.ReadFull(reader, headerBuffer[:])
|
||||
if err != nil { return 0, 0, nil, err }
|
||||
if err != nil {
|
||||
if errors.Is(err, io.EOF) { return 0, 0, nil, io.ErrUnexpectedEOF }
|
||||
return 0, 0, nil, err
|
||||
}
|
||||
method, err = tape.DecodeI16[uint16](headerBuffer[:2])
|
||||
if err != nil { return 0, 0, nil, err }
|
||||
length, err := tape.DecodeI64[uint64](headerBuffer[2:10])
|
||||
|
||||
Reference in New Issue
Block a user