Removed used Session.checkCounter and link.token.

This commit is contained in:
scruzin 2019-01-13 13:04:05 +10:30
parent 60af77017d
commit bef7177c5a
2 changed files with 6 additions and 16 deletions

View File

@ -609,6 +609,9 @@ func handleInvoke(s *Session, body []byte) error {
s.log(DebugLevel, pkg+"invoking method "+meth) s.log(DebugLevel, pkg+"invoking method "+meth)
switch meth { switch meth {
case av_result: case av_result:
if (s.link.protocol & featureWrite) == 0 {
return errNotWritable
}
var methodInvoked string var methodInvoked string
for i, m := range s.methodCalls { for i, m := range s.methodCalls {
if float64(m.num) == txn { if float64(m.num) == txn {
@ -625,12 +628,6 @@ func handleInvoke(s *Session, body []byte) error {
switch methodInvoked { switch methodInvoked {
case avConnect: 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) err := sendReleaseStream(s)
if err != nil { if err != nil {
return err return err
@ -650,9 +647,6 @@ func handleInvoke(s *Session, body []byte) error {
return err return err
} }
s.streamID = int32(n) s.streamID = int32(n)
if s.link.protocol&featureWrite == 0 {
return errNotWritable
}
err = sendPublish(s) err = sendPublish(s)
if err != nil { if err != nil {
return err return err
@ -663,12 +657,10 @@ func handleInvoke(s *Session, body []byte) error {
} }
case avOnBWDone: case avOnBWDone:
if s.checkCounter == 0 { // ToDo: why is this always zero?
err := sendCheckBW(s) err := sendCheckBW(s)
if err != nil { if err != nil {
return err return err
} }
}
case avOnStatus: case avOnStatus:
obj2, err := obj.ObjectProperty("", 3) obj2, err := obj.ObjectProperty("", 3)

View File

@ -46,7 +46,6 @@ type Session struct {
url string url string
inChunkSize int32 inChunkSize int32
outChunkSize int32 outChunkSize int32
checkCounter int32
nBytesIn int32 nBytesIn int32
nBytesInSent int32 nBytesInSent int32
streamID int32 streamID int32
@ -75,7 +74,6 @@ type link struct {
url string url string
app string app string
auth string auth string
token string
flags int32 flags int32
protocol int32 protocol int32
timeout uint timeout uint