|
|
|
@ -48,7 +48,11 @@ const (
|
|
|
|
|
//Amf0TypeMarkerTypedObject = uint8(0x10)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var Amf0TypeMarkerObjectEndBytes = []byte{0, 0, Amf0TypeMarkerObjectEnd}
|
|
|
|
|
var (
|
|
|
|
|
// object-end-type(0x00 0x00 0x09) 表示Object和EcmaArray类型的结束标识
|
|
|
|
|
Amf0TypeMarkerObjectEndBytes = []byte{0, 0, Amf0TypeMarkerObjectEnd}
|
|
|
|
|
Amf0TypeMarkerArrayEndBytes = []byte{0, 0, Amf0TypeMarkerObjectEnd}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
@ -396,10 +400,9 @@ func (amf0) ReadArray(b []byte) (ObjectPairArray, int, error) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if len(b)-index >= 3 && bytes.Equal(b[index:index+3], Amf0TypeMarkerObjectEndBytes) {
|
|
|
|
|
if len(b)-index >= 3 && bytes.Equal(b[index:index+3], Amf0TypeMarkerArrayEndBytes) {
|
|
|
|
|
index += 3
|
|
|
|
|
} else {
|
|
|
|
|
// 测试时发现Array最后也是以00 00 09结束,不确定是否是标准规定的,加个日志在这
|
|
|
|
|
Log.Warn("amf ReadArray without suffix Amf0TypeMarkerObjectEndBytes.")
|
|
|
|
|
}
|
|
|
|
|
return ops, index, nil
|
|
|
|
|