Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
kareldonk committed Oct 30, 2021
2 parents 9a1fc12 + 8174beb commit 3b745e9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
15 changes: 11 additions & 4 deletions QuantumGateLib/Core/UDP/UDPConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ namespace QuantumGate::Implementation::Core::UDP::Connection

void Connection::OnLocalIPInterfaceChanged() noexcept
{
// MTU needs to be checked again on IP/Network change
ResetMTU();

// Send immediate keepalive to let the peer know of
Expand Down Expand Up @@ -806,7 +807,7 @@ namespace QuantumGate::Implementation::Core::UDP::Connection
if (m_DelayedSendQueue.empty())
{
// Release memory
DelayedSendItemQueue tmp;
DelayedSendItemQueue tmp(&DelayedSendItem::Compare);
m_DelayedSendQueue.swap(tmp);
}
}
Expand Down Expand Up @@ -1286,7 +1287,7 @@ namespace QuantumGate::Implementation::Core::UDP::Connection
bool Connection::ProcessReceivedMessageConnected(const IPEndpoint& endpoint, Message&& msg) noexcept
{
auto success = false;
auto endpoint_check = true;
auto endpoint_check = false;

switch (msg.GetType())
{
Expand Down Expand Up @@ -1314,6 +1315,7 @@ namespace QuantumGate::Implementation::Core::UDP::Connection
{
m_ReceiveQueue.emplace(msg.GetMessageSequenceNumber(), std::move(msg));
success = true;
endpoint_check = true;
}
catch (...) {}
}
Expand All @@ -1324,6 +1326,7 @@ namespace QuantumGate::Implementation::Core::UDP::Connection
// send an ack (again) and drop message
m_LastInOrderReceivedSequenceNumber.ResetAcked();
success = AckReceivedMessage(msg.GetMessageSequenceNumber());
endpoint_check = success;
break;
}
case ReceiveWindow::Unknown:
Expand Down Expand Up @@ -1355,6 +1358,7 @@ namespace QuantumGate::Implementation::Core::UDP::Connection

m_SendQueue.ProcessReceivedAcks(msg.GetAckRanges());
success = true;
endpoint_check = true;
break;
}
case Message::Type::MTUD:
Expand All @@ -1368,6 +1372,7 @@ namespace QuantumGate::Implementation::Core::UDP::Connection
if (m_MTUDiscovery) m_MTUDiscovery->ProcessReceivedAck(msg.GetMessageAckNumber());
}
success = true;
endpoint_check = true;
break;
}
case Message::Type::Reset:
Expand All @@ -1386,6 +1391,7 @@ namespace QuantumGate::Implementation::Core::UDP::Connection
Message::TypeToString(msg.GetType()), endpoint.GetString().c_str(), GetID());

success = true;
endpoint_check = true;
break;
}
case Message::Type::Syn:
Expand All @@ -1407,7 +1413,6 @@ namespace QuantumGate::Implementation::Core::UDP::Connection
}

success = true;
endpoint_check = false;
break;
}
default:
Expand All @@ -1431,7 +1436,6 @@ namespace QuantumGate::Implementation::Core::UDP::Connection
success = true;
}

endpoint_check = false;
break;
}
}
Expand Down Expand Up @@ -1470,6 +1474,9 @@ namespace QuantumGate::Implementation::Core::UDP::Connection
m_PeerEndpoint.GetString().c_str(), endpoint.GetString().c_str(), GetID());

m_PeerEndpoint = endpoint;

// MTU needs to be checked again on IP/Network change
ResetMTU();
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion QuantumGateLib/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 3
#define VERSION_REVISION 0
#define VERSION_BUILD 880
#define VERSION_BUILD 893

#define FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD
#define FILE_VERSION_STR STR(VERSION_MAJOR) "." STR(VERSION_MINOR) "." STR(VERSION_REVISION) "." STR(VERSION_BUILD)
Expand Down
8 changes: 4 additions & 4 deletions Test/TestApp/CTabCtrlEx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ CTabCtrlPage* CTabCtrlEx::GetTab(const CRuntimeClass* rclass) const noexcept

CTabCtrlPage* CTabCtrlEx::GetTab(const int idx) const noexcept
{
if (idx >= 0 && idx < m_TabPages.size())
if (idx >= 0 && idx < static_cast<int>(m_TabPages.size()))
{
return m_TabPages[idx]->TabWnd.get();
}
Expand All @@ -123,11 +123,11 @@ int CTabCtrlEx::SetCurSel(const int idx) noexcept

int CTabCtrlEx::SetCurSel(const CTabCtrlPage* obj) noexcept
{
for (int idx = 0; idx < m_TabPages.size(); ++idx)
for (TabPages::size_type idx = 0; idx < m_TabPages.size(); ++idx)
{
if (m_TabPages[idx]->TabWnd.get() == obj)
{
return SetCurSel(idx);
return SetCurSel(static_cast<int>(idx));
}
}

Expand All @@ -139,7 +139,7 @@ void CTabCtrlEx::UpdateSelection() noexcept
const auto cursel = GetCurSel();
if (cursel != -1)
{
for (int idx = 0; idx < m_TabPages.size(); ++idx)
for (TabPages::size_type idx = 0; idx < m_TabPages.size(); ++idx)
{
CTabCtrlPage* tabpage = m_TabPages[idx]->TabWnd.get();
if (cursel == idx) tabpage->ShowWindow(SW_SHOW);
Expand Down

0 comments on commit 3b745e9

Please sign in to comment.