Skip to content

Commit c6d5a88

Browse files
author
Sven Göthel
committed
StreamSocket::checkRemoval: Fix TO criteria local-var names, drop useless now < getCreationTime() criteria.
Signed-off-by: Sven Göthel <[email protected]> Change-Id: I035ab196e57588513b69894ccc669d88cec488c2
1 parent 55905f9 commit c6d5a88

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

net/Socket.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,21 +1507,19 @@ bool StreamSocket::checkRemoval(std::chrono::steady_clock::time_point now)
15071507
const auto durLast =
15081508
std::chrono::duration_cast<std::chrono::milliseconds>(now - getLastSeenTime());
15091509
const double bytesPerSecIn = durTotal.count() > 0 ? (double)bytesRcvd() / ((double)durTotal.count() / 1000.0) : 0.0;
1510-
/// TO Criteria: Violate creation time? (invalid passed now)
1511-
const bool cNow = now < getCreationTime();
15121510
/// TO Criteria: Violate maximum idle (_pollTimeout default 64s)
1513-
const bool cIDLE = _pollTimeout > std::chrono::microseconds::zero() &&
1511+
const bool isIDLE = _pollTimeout > std::chrono::microseconds::zero() &&
15141512
durLast > _pollTimeout;
15151513
/// TO Criteria: Violate minimum bytes-per-sec throughput? (_minBytesPerSec default 0, disabled)
1516-
const bool cMinThroughput = _minBytesPerSec > std::numeric_limits<double>::epsilon() &&
1514+
const bool isMinThroughput = _minBytesPerSec > std::numeric_limits<double>::epsilon() &&
15171515
bytesPerSecIn > std::numeric_limits<double>::epsilon() &&
15181516
bytesPerSecIn < _minBytesPerSec;
15191517
/// TO Criteria: Shall terminate?
1520-
const bool cTermination = SigUtil::getTerminationFlag();
1521-
if (cNow || cIDLE || cMinThroughput || cTermination )
1518+
const bool isTermination = SigUtil::getTerminationFlag();
1519+
if (isIDLE || isMinThroughput || isTermination )
15221520
{
1523-
LOG_WRN("CheckRemoval: Timeout: {Now " << cNow << ", IDLE " << cIDLE
1524-
<< ", MinThroughput " << cMinThroughput << ", Termination " << cTermination << "}, "
1521+
LOG_WRN("CheckRemoval: Timeout: {IDLE " << isIDLE
1522+
<< ", MinThroughput " << isMinThroughput << ", Termination " << isTermination << "}, "
15251523
<< getStatsString(now) << ", "
15261524
<< *this);
15271525
if (_socketHandler)

0 commit comments

Comments
 (0)