上传redis 解码异常问题
This commit is contained in:
parent
e39d409090
commit
a565e80824
@ -279,7 +279,7 @@ func (this *mapDecoder) Decode(ptr unsafe.Pointer, extra codecore.IReader) {
|
||||
return
|
||||
}
|
||||
if extra.CheckNextIsObjectEnd() {
|
||||
extra.ReadObjectEnd()
|
||||
// extra.ReadObjectEnd()
|
||||
return
|
||||
}
|
||||
key := this.keyType.UnsafeNew()
|
||||
|
@ -307,6 +307,11 @@ func (this *structDecoder) Decode(ptr unsafe.Pointer, r codecore.IReader) {
|
||||
if !r.ReadObjectStart() {
|
||||
return
|
||||
}
|
||||
|
||||
if r.CheckNextIsObjectEnd() { //空对象直接跳出
|
||||
return
|
||||
}
|
||||
|
||||
this.decodeField(ptr, r)
|
||||
for r.ReadMemberSplit() {
|
||||
this.decodeField(ptr, r)
|
||||
|
@ -141,10 +141,10 @@ func (this *JsonReader) ReadObjectStart() (ret bool) {
|
||||
}
|
||||
func (this *JsonReader) CheckNextIsObjectEnd() (ret bool) {
|
||||
c := this.nextToken()
|
||||
this.unreadByte()
|
||||
if c == '}' {
|
||||
return true
|
||||
return this.decrementDepth()
|
||||
}
|
||||
this.unreadByte()
|
||||
return
|
||||
}
|
||||
func (this *JsonReader) ReadObjectEnd() (ret bool) {
|
||||
|
Loading…
Reference in New Issue
Block a user