Merge branch 'protocol' of https://github.com/Atlante45/hifi into atp

This commit is contained in:
Stephen Birarda 2015-07-30 18:14:59 -07:00
commit 036cb8859d
3 changed files with 5 additions and 9 deletions

View file

@ -17,7 +17,7 @@ using namespace udt;
using namespace std;
void LossList::append(SequenceNumber seq) {
assert(_lossList.back().second < seq);
assert(_lossList.empty() || _lossList.back().second < seq);
if (getLength() > 0 && _lossList.back().second + 1 == seq) {
++_lossList.back().second;

View file

@ -45,12 +45,12 @@ public:
}
inline SequenceNumber operator++(int) {
SequenceNumber before = *this;
(*this)++;
++(*this);
return before;
}
inline SequenceNumber operator--(int) {
SequenceNumber before = *this;
(*this)--;
--(*this);
return before;
}

View file

@ -162,12 +162,8 @@ void Socket::readPendingDatagrams() {
if (packet->isReliable()) {
// if this was a reliable packet then signal the matching connection with the sequence number
// assuming it exists
auto it = _connectionsHash.find(senderSockAddr);
if (it != _connectionsHash.end()) {
it->second->processReceivedSequenceNumber(packet->getSequenceNumber());
}
auto connection = findOrCreateConnection(senderSockAddr);
connection->processReceivedSequenceNumber(packet->getSequenceNumber());
}
if (_packetHandler) {