Removed unused Session.encoding and sendEncoding.

This commit is contained in:
scruzin 2019-01-13 07:29:36 +10:30
parent 40806d4de7
commit 2219a26890
2 changed files with 6 additions and 15 deletions

View File

@ -312,8 +312,7 @@ func sendConnectPacket(s *Session) error {
}
enc := pkt.body
var err error
enc, err = amf.EncodeString(enc, avConnect)
enc, err := amf.EncodeString(enc, avConnect)
if err != nil {
return err
}
@ -348,7 +347,6 @@ func sendConnectPacket(s *Session) error {
return err
}
}
if s.link.tcUrl != "" {
enc, err = amf.EncodeNamedString(enc, avTcUrl, s.link.tcUrl)
if err != nil {
@ -378,7 +376,6 @@ func sendConnectPacket(s *Session) error {
return err
}
if s.link.pageUrl != "" {
var err error
enc, err = amf.EncodeNamedString(enc, avPageUrl, s.link.pageUrl)
if err != nil {
return err
@ -386,17 +383,13 @@ func sendConnectPacket(s *Session) error {
}
}
if s.encoding != 0.0 || s.sendEncoding {
enc, err = amf.EncodeNamedNumber(enc, avObjectEncoding, s.encoding)
// terminate the AMF object
enc, err = amf.EncodeInt24(enc, amf.TypeObjectEnd)
if err != nil {
return err
}
}
copy(enc, []byte{0, 0, amf.TypeObjectEnd})
enc = enc[3:]
// add auth string
// add auth string, if any
if s.link.auth != "" {
enc, err = amf.EncodeBoolean(enc, s.link.flags&linkAuth != 0)
if err != nil {

View File

@ -54,7 +54,6 @@ type Session struct {
clientBW int32
clientBW2 uint8
isPlaying bool
sendEncoding bool
numInvokes int32
methodCalls []method
channelsAllocatedIn int32
@ -64,7 +63,6 @@ type Session struct {
channelTimestamp []int32
audioCodecs float64
videoCodecs float64
encoding float64
deferred []byte
link link
log Log