summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-02-21 10:44:13 +0100
committerMattes D <github@xoft.cz>2016-02-21 10:44:34 +0100
commit98d3bdebb4031ce4b293f4924d76354bc5159739 (patch)
tree1c08c7f6f7ce8e1700efc9fb79264af0dc66afb3 /src
parentMerge pull request #3035 from marvinkopf/hotfix-parentchunk (diff)
downloadcuberite-98d3bdebb4031ce4b293f4924d76354bc5159739.tar
cuberite-98d3bdebb4031ce4b293f4924d76354bc5159739.tar.gz
cuberite-98d3bdebb4031ce4b293f4924d76354bc5159739.tar.bz2
cuberite-98d3bdebb4031ce4b293f4924d76354bc5159739.tar.lz
cuberite-98d3bdebb4031ce4b293f4924d76354bc5159739.tar.xz
cuberite-98d3bdebb4031ce4b293f4924d76354bc5159739.tar.zst
cuberite-98d3bdebb4031ce4b293f4924d76354bc5159739.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/LuaTCPLink.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Bindings/LuaTCPLink.cpp b/src/Bindings/LuaTCPLink.cpp
index d88c41120..deaba9d86 100644
--- a/src/Bindings/LuaTCPLink.cpp
+++ b/src/Bindings/LuaTCPLink.cpp
@@ -416,9 +416,10 @@ void cLuaTCPLink::OnReceivedData(const char * a_Data, size_t a_Length)
}
// If we're running in SSL mode, put the data into the SSL decryptor:
- if (m_SslContext != nullptr)
+ auto sslContext = m_SslContext;
+ if (sslContext != nullptr)
{
- m_SslContext->StoreReceivedData(a_Data, a_Length);
+ sslContext->StoreReceivedData(a_Data, a_Length);
return;
}
@@ -442,6 +443,13 @@ void cLuaTCPLink::OnRemoteClosed(void)
return;
}
+ // If running in SSL mode and there's data left in the SSL contect, report it:
+ auto sslContext = m_SslContext;
+ if (sslContext != nullptr)
+ {
+ sslContext->FlushBuffers();
+ }
+
// Call the callback:
cPluginLua::cOperation Op(m_Plugin);
if (!Op().Call(cLuaState::cTableRef(m_Callbacks, "OnRemoteClosed"), this))