From f4518a79aaab387fa7a6a4b21e28db8c2eef6774 Mon Sep 17 00:00:00 2001 From: nareix Date: Sat, 23 Jul 2016 18:05:12 +0800 Subject: [PATCH] rtmp: add debug --- format/rtmp/rtmp.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/format/rtmp/rtmp.go b/format/rtmp/rtmp.go index f081df8..7981ef6 100644 --- a/format/rtmp/rtmp.go +++ b/format/rtmp/rtmp.go @@ -493,22 +493,26 @@ func (self *Conn) readConnect() (err error) { } func (self *Conn) checkConnectResult() (ok bool, errmsg string) { - errmsg = "params invalid" if len(self.commandparams) < 1 { + errmsg = "params length < 1" return } obj, _ := self.commandparams[0].(flvio.AMFMap) if obj == nil { + errmsg = "params[0] not object" return } _code, _ := obj["code"] if _code == nil { + errmsg = "code invalid" return } + code, _ := _code.(string) if code != "NetConnection.Connect.Success" { + errmsg = "code != NetConnection.Connect.Success" return }