process a handshake if the connection has ever received data

This commit is contained in:
Stephen Birarda 2016-02-16 11:43:06 -08:00 committed by Ryan Huffman
parent 2c7112e9a8
commit 39d9e64ee5
2 changed files with 4 additions and 3 deletions

View file

@ -411,7 +411,7 @@ bool Connection::processReceivedSequenceNumber(SequenceNumber sequenceNumber, in
return false;
}
_isReceivingData = true;
_isReceivingData = _hasReceivedData = true;
// mark our last receive time as now (to push the potential expiry farther)
_lastReceiveTime = p_high_resolution_clock::now();
@ -725,7 +725,7 @@ void Connection::processNAK(std::unique_ptr<ControlPacket> controlPacket) {
void Connection::processHandshake(std::unique_ptr<ControlPacket> controlPacket) {
if (!_hasReceivedHandshake || _isReceivingData) {
if (!_hasReceivedHandshake || _hasReceivedData) {
// server sent us a handshake - we need to assume this means state should be reset
// as long as we haven't received a handshake yet or we have and we've received some data
resetReceiveState();
@ -799,7 +799,7 @@ void Connection::resetReceiveState() {
// the _nakInterval need not be reset, that will happen on loss
// clear sync variables
_isReceivingData = false;
_isReceivingData = _hasReceivedData = false;
_connectionStart = p_high_resolution_clock::now();
_acksDuringSYN = 1;

View file

@ -129,6 +129,7 @@ private:
p_high_resolution_clock::time_point _lastReceiveTime; // holds the last time we received anything from sender
bool _isReceivingData { false }; // flag used for expiry of receipt portion of connection
bool _hasReceivedData { false }; // flag used for reset of connection state on second handshake
bool _isActive { true }; // flag used for inactivity of connection
SequenceNumber _initialReceiveSequenceNumber; // Randomized by peer SendQueue on creation, identifies connection during re-connect requests