mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
bugfix(raft): When the length of the data is 0, return directly without further decoding
Signed-off-by: chihe <chi.he@oppo.com> (cherry picked from commit 5fdfe4eb5c31fbd028e1b00c2f228d26a683fd06)
This commit is contained in:
parent
9da5608432
commit
d05405ef73
@ -4,7 +4,7 @@
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@ -241,6 +241,9 @@ func (m *Message) Decode(r *util.BufferReader) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(datas) == 0 {
|
||||
return nil
|
||||
}
|
||||
ver := datas[0]
|
||||
if ver == version1 {
|
||||
m.Type = MsgType(datas[1])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user