summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaServerHandle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Bindings/LuaServerHandle.cpp')
-rw-r--r--src/Bindings/LuaServerHandle.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/Bindings/LuaServerHandle.cpp b/src/Bindings/LuaServerHandle.cpp
index c07cd0a82..090e6f000 100644
--- a/src/Bindings/LuaServerHandle.cpp
+++ b/src/Bindings/LuaServerHandle.cpp
@@ -12,9 +12,8 @@
-cLuaServerHandle::cLuaServerHandle(UInt16 a_Port, cLuaState::cTableRefPtr && a_Callbacks):
- m_Callbacks(std::move(a_Callbacks)),
- m_Port(a_Port)
+cLuaServerHandle::cLuaServerHandle(UInt16 a_Port, cLuaState::cTableRefPtr && a_Callbacks) :
+ m_Callbacks(std::move(a_Callbacks)), m_Port(a_Port)
{
}
@@ -62,7 +61,7 @@ void cLuaServerHandle::Close(void)
cCSLock Lock(m_CSConnections);
std::swap(Connections, m_Connections);
}
- for (auto & conn: Connections)
+ for (auto & conn : Connections)
{
conn->Close();
}
@@ -127,10 +126,15 @@ cTCPLink::cCallbacksPtr cLuaServerHandle::OnIncomingConnection(const AString & a
{
// Ask the plugin for link callbacks:
cLuaState::cTableRefPtr LinkCallbacks;
- if (
- !m_Callbacks->CallTableFn("OnIncomingConnection", a_RemoteIPAddress, a_RemotePort, m_Port, cLuaState::Return, LinkCallbacks) ||
- !LinkCallbacks->IsValid()
- )
+ if (!m_Callbacks->CallTableFn(
+ "OnIncomingConnection",
+ a_RemoteIPAddress,
+ a_RemotePort,
+ m_Port,
+ cLuaState::Return,
+ LinkCallbacks
+ ) ||
+ !LinkCallbacks->IsValid())
{
LOGINFO("cNetwork server (port %d) OnIncomingConnection callback failed. Dropping connection.", m_Port);
return nullptr;
@@ -165,8 +169,3 @@ void cLuaServerHandle::OnError(int a_ErrorCode, const AString & a_ErrorMsg)
// Notify the plugin:
m_Callbacks->CallTableFn("OnError", a_ErrorCode, a_ErrorMsg);
}
-
-
-
-
-