mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 19:04:32 +02:00
fixes for assert in Connection and ControlPacket create
This commit is contained in:
parent
1724e3c632
commit
367fa7b07b
2 changed files with 3 additions and 3 deletions
|
@ -76,7 +76,7 @@ void Connection::sendACK(bool wasCausedBySyncTimeout) {
|
|||
auto currentTime = high_resolution_clock::now();
|
||||
|
||||
SequenceNumber nextACKNumber = nextACK();
|
||||
Q_ASSERT_X(nextACKNumber < _lastSentACK, "Connection::sendACK", "Sending lower ACK, something is wrong");
|
||||
Q_ASSERT_X(nextACKNumber >= _lastSentACK, "Connection::sendACK", "Sending lower ACK, something is wrong");
|
||||
|
||||
if (nextACKNumber == _lastSentACK) {
|
||||
// We already sent this ACK, but check if we should re-send it.
|
||||
|
|
|
@ -46,12 +46,12 @@ std::unique_ptr<ControlPacket> ControlPacket::create(Type type, qint64 size) {
|
|||
std::unique_ptr<ControlPacket> controlPacket;
|
||||
|
||||
if (size == -1) {
|
||||
return ControlPacket::create(type);
|
||||
return std::unique_ptr<ControlPacket>(new ControlPacket(type));
|
||||
} else {
|
||||
// Fail with invalid size
|
||||
Q_ASSERT(size >= 0);
|
||||
|
||||
return ControlPacket::create(type, size);
|
||||
return std::unique_ptr<ControlPacket>(new ControlPacket(type, size));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue