clion, your formatting is pissing me off

This commit is contained in:
DarthArgus
2016-09-29 03:48:11 +00:00
parent ce705d4df5
commit af9701a816
2 changed files with 21 additions and 25 deletions
@@ -579,28 +579,22 @@ void Connection::onConnectionOverflowing(unsigned int totalBytes)
void Connection::onConnectionClosed(Connection *)
{
bool triggerOnConnectionClosed = true; // default - trigger the callback
if (getService())
{
getService()->onConnectionClosed(this);
}
if (udpConnection)
{
UdpConnection::DisconnectReason reason = udpConnection->GetDisconnectReason();
if (reason == UdpConnection::cDisconnectDosAsshole) {
triggerOnConnectionClosed = false; // no need - hopefully the destructor is just called
}
UdpConnection::DisconnectReason reason = udpConnection->GetDisconnectReason();
setDisconnectReason("Connection::onConnectionClosed (udplibrary:%s)", UdpConnection::DisconnectReasonText(reason));
FATAL(ConfigSharedNetwork::getFatalOnConnectionClosed(), ("Connection closed %s", UdpConnection::DisconnectReasonText(reason)));
}
else
{
setDisconnectReason("Connection::onConnectionClosed called");
}
if (triggerOnConnectionClosed && getService())
{
getService()->onConnectionClosed(this);
}
{
setDisconnectReason("Connection::onConnectionClosed called");
}
if (ConfigSharedNetwork::getLogConnectionOpenedClosed())
{
@@ -192,7 +192,7 @@ Service::~Service()
}
//-----------------------------------------------------------------------
void Service::onConnectionClosed(Connection * c)
{
if (c)
@@ -201,7 +201,9 @@ void Service::onConnectionClosed(Connection * c)
if (f != connections.end())
{
if (m_tcpServer)
{
m_tcpServer->onConnectionClosed(c->getTcpClient());
}
connections.erase(f);
}
c->setService(0);
@@ -214,16 +216,16 @@ void Service::onConnectionOpened(Connection * c)
{
if (c)
{
if (connections.size() < static_cast<size_t>(m_maxConnections))
{
c->setService(this);
c->onConnectionOpened();
connections.insert(c);
if (connections.size() < static_cast<size_t>(m_maxConnections))
{
c->setService(this);
c->onConnectionOpened();
connections.insert(c);
}
else
{
WARNING(true, ("Service has reached it's maximum connection count (%d).", m_maxConnections));
}
else
{
WARNING(true, ("Service has reached it's maximum connection count (%d).", m_maxConnections));
}
}
}