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; using namespace std;
void LossList::append(SequenceNumber seq) { 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) { if (getLength() > 0 && _lossList.back().second + 1 == seq) {
++_lossList.back().second; ++_lossList.back().second;

View file

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

View file

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