上传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
|
return
|
||||||
}
|
}
|
||||||
if extra.CheckNextIsObjectEnd() {
|
if extra.CheckNextIsObjectEnd() {
|
||||||
extra.ReadObjectEnd()
|
// extra.ReadObjectEnd()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
key := this.keyType.UnsafeNew()
|
key := this.keyType.UnsafeNew()
|
||||||
|
@ -307,6 +307,11 @@ func (this *structDecoder) Decode(ptr unsafe.Pointer, r codecore.IReader) {
|
|||||||
if !r.ReadObjectStart() {
|
if !r.ReadObjectStart() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if r.CheckNextIsObjectEnd() { //空对象直接跳出
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
this.decodeField(ptr, r)
|
this.decodeField(ptr, r)
|
||||||
for r.ReadMemberSplit() {
|
for r.ReadMemberSplit() {
|
||||||
this.decodeField(ptr, r)
|
this.decodeField(ptr, r)
|
||||||
|
@ -141,10 +141,10 @@ func (this *JsonReader) ReadObjectStart() (ret bool) {
|
|||||||
}
|
}
|
||||||
func (this *JsonReader) CheckNextIsObjectEnd() (ret bool) {
|
func (this *JsonReader) CheckNextIsObjectEnd() (ret bool) {
|
||||||
c := this.nextToken()
|
c := this.nextToken()
|
||||||
this.unreadByte()
|
|
||||||
if c == '}' {
|
if c == '}' {
|
||||||
return true
|
return this.decrementDepth()
|
||||||
}
|
}
|
||||||
|
this.unreadByte()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
func (this *JsonReader) ReadObjectEnd() (ret bool) {
|
func (this *JsonReader) ReadObjectEnd() (ret bool) {
|
||||||
|
Loading…
Reference in New Issue
Block a user