diff --git a/rtmp/amf/amf.go b/rtmp/amf/amf.go index 0564b04c..a7e41afb 100644 --- a/rtmp/amf/amf.go +++ b/rtmp/amf/amf.go @@ -391,16 +391,6 @@ func PropDecode(prop *Property, data []byte, decodeName bool) (int, error) { return sz - len(data), nil } -func PropReset(prop *Property) { - if prop.dtype == TypeObject || prop.dtype == typeEcmaArray || - prop.dtype == typeStrictArray { - Reset(&prop.obj) - } else { - prop.str = "" - } - prop.dtype = typeInvalid -} - // Encode serializes an Object into its AMF representation. func Encode(obj *Object, dst []byte) ([]byte, error) { if len(dst) < 5 { @@ -505,10 +495,3 @@ func GetProp(obj *Object, name string, idx int32) *Property { } return &Property{} } - -func Reset(obj *Object) { - for i := range obj.Props { - PropReset(&obj.Props[i]) - } - *obj = Object{} -} diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index e78a89f0..fc34809c 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -702,7 +702,7 @@ func handleInvoke(s *Session, body []byte) error { } if methodInvoked == "" { s.log(WarnLevel, pkg+"received result without matching request", "id", txn) - goto leave + return nil } s.log(DebugLevel, pkg+"received result for "+methodInvoked) @@ -806,8 +806,6 @@ func handleInvoke(s *Session, body []byte) error { default: s.log(FatalLevel, pkg+"unknown method "+meth) } -leave: - amf.Reset(&obj) return nil }