Commit af9bd2dd by xiongguangjie

fix streamid zero error

parent 91aa9c49
......@@ -81,7 +81,9 @@ bool HSExtStreamID::loadFromData(uint8_t *buf, size_t len) {
ptr+=4;
}
char zero = 0x00;
if(streamid.back() == zero){
streamid.erase(streamid.find_first_of(zero),streamid.size());
}
return true;
}
......
......@@ -10,7 +10,10 @@ using namespace mediakit;
SrtSession::SrtSession(const Socket::Ptr &sock)
: UdpSession(sock) {
socklen_t addr_len = sizeof(_peer_addr);
memset(&_peer_addr,0,addr_len);
TraceL<<"before addr len "<<addr_len;
getpeername(sock->rawFD(), (struct sockaddr *)&_peer_addr, &addr_len);
TraceL<<"after addr len "<<addr_len<<" family "<<_peer_addr.ss_family;
}
SrtSession::~SrtSession() {
......
#include "Util/onceToken.h"
#include <stdlib.h>
#include "Util/onceToken.h"
#include "SrtTransport.hpp"
#include "Packet.hpp"
......@@ -297,7 +298,7 @@ void SrtTransport::handleACKACK(uint8_t *buf, int len, struct sockaddr_storage *
pkt->loadFromData(buf,len);
uint32_t rtt = DurationCountMicroseconds(_now - _ack_send_timestamp[pkt->ack_number]);
_rtt_variance = (3*_rtt_variance+abs(_rtt - rtt))/4;
_rtt_variance = (3*_rtt_variance+abs((long)(_rtt - rtt)))/4;
_rtt = (7*rtt+_rtt)/8;
_ack_send_timestamp.erase(pkt->ack_number);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论