rtmp: add debug

This commit is contained in:
nareix 2016-07-23 18:05:12 +08:00
parent bc5e321c39
commit f4518a79aa

View File

@ -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
}