we must only return io.EOF to progress to the next file in auto.Group

since we never write msg partially, if we've encountered io.EOF in the
middle of the msg, we must abort
This commit is contained in:
Anton Kaliaev
2018-05-22 15:53:33 +04:00
parent 68f6226bea
commit f3f5c7f472

View File

@ -273,9 +273,6 @@ func (dec *WALDecoder) Decode() (*TimedWALMessage, error) {
b = make([]byte, 4)
_, err = dec.rd.Read(b)
if err == io.EOF {
return nil, err
}
if err != nil {
return nil, fmt.Errorf("failed to read length: %v", err)
}
@ -287,9 +284,6 @@ func (dec *WALDecoder) Decode() (*TimedWALMessage, error) {
data := make([]byte, length)
_, err = dec.rd.Read(data)
if err == io.EOF {
return nil, err
}
if err != nil {
return nil, fmt.Errorf("failed to read data: %v", err)
}