From bef7177c5a7166e81483e8ea6d6ca852915a89cf Mon Sep 17 00:00:00 2001 From: scruzin Date: Sun, 13 Jan 2019 13:04:05 +1030 Subject: [PATCH] Removed used Session.checkCounter and link.token. --- rtmp/rtmp.go | 20 ++++++-------------- rtmp/session.go | 2 -- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 7e75ff91..e10657ef 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -609,6 +609,9 @@ func handleInvoke(s *Session, body []byte) error { s.log(DebugLevel, pkg+"invoking method "+meth) switch meth { case av_result: + if (s.link.protocol & featureWrite) == 0 { + return errNotWritable + } var methodInvoked string for i, m := range s.methodCalls { if float64(m.num) == txn { @@ -625,12 +628,6 @@ func handleInvoke(s *Session, body []byte) error { switch methodInvoked { case avConnect: - if s.link.token != "" { - s.log(FatalLevel, pkg+"no support for link token") - } - if (s.link.protocol & featureWrite) == 0 { - return errNotWritable - } err := sendReleaseStream(s) if err != nil { return err @@ -650,9 +647,6 @@ func handleInvoke(s *Session, body []byte) error { return err } s.streamID = int32(n) - if s.link.protocol&featureWrite == 0 { - return errNotWritable - } err = sendPublish(s) if err != nil { return err @@ -663,11 +657,9 @@ func handleInvoke(s *Session, body []byte) error { } case avOnBWDone: - if s.checkCounter == 0 { // ToDo: why is this always zero? - err := sendCheckBW(s) - if err != nil { - return err - } + err := sendCheckBW(s) + if err != nil { + return err } case avOnStatus: diff --git a/rtmp/session.go b/rtmp/session.go index 7452b9db..610cb484 100644 --- a/rtmp/session.go +++ b/rtmp/session.go @@ -46,7 +46,6 @@ type Session struct { url string inChunkSize int32 outChunkSize int32 - checkCounter int32 nBytesIn int32 nBytesInSent int32 streamID int32 @@ -75,7 +74,6 @@ type link struct { url string app string auth string - token string flags int32 protocol int32 timeout uint