Fixed packetTypeBytesReadReport case in handlePacket and added debug logging.

This commit is contained in:
scruzin 2019-01-19 11:30:59 +10:30
parent 35d63f664f
commit 974d9a484b
1 changed files with 5 additions and 1 deletions

View File

@ -250,17 +250,21 @@ func handlePacket(s *Session, pkt *packet) error {
switch pkt.packetType {
case packetTypeChunkSize:
s.inChunkSize = amf.DecodeInt32(pkt.body[:4])
s.log(DebugLevel, pkg+"set inChunkSize", "size", int(s.inChunkSize))
case packetTypeBytesReadReport:
s.serverBW = amf.DecodeInt32(pkt.body[:4])
s.log(DebugLevel, pkg+"received packetTypeBytesReadReport")
case packetTypeServerBW:
s.serverBW = amf.DecodeInt32(pkt.body[:4])
s.log(DebugLevel, pkg+"set serverBW", "size", int(s.serverBW))
case packetTypeClientBW:
s.clientBW = amf.DecodeInt32(pkt.body[:4])
s.log(DebugLevel, pkg+"set clientBW", "size", int(s.clientBW))
if pkt.bodySize > 4 {
s.clientBW2 = pkt.body[4]
s.log(DebugLevel, pkg+"set clientBW2", "size", int(s.clientBW2))
} else {
s.clientBW2 = 0xff
}