diff options
author | madmaxoft <github@xoft.cz> | 2014-05-01 15:08:15 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-05-01 15:08:15 +0200 |
commit | 60850fe3e8da936d5b24460f33a1bf8f4d321ace (patch) | |
tree | 1720c81696ea344517d7d8b7456ca232445e421c /src/HTTPServer/SslHTTPConnection.cpp | |
parent | Added a mention to run as admin. (diff) | |
download | cuberite-60850fe3e8da936d5b24460f33a1bf8f4d321ace.tar cuberite-60850fe3e8da936d5b24460f33a1bf8f4d321ace.tar.gz cuberite-60850fe3e8da936d5b24460f33a1bf8f4d321ace.tar.bz2 cuberite-60850fe3e8da936d5b24460f33a1bf8f4d321ace.tar.lz cuberite-60850fe3e8da936d5b24460f33a1bf8f4d321ace.tar.xz cuberite-60850fe3e8da936d5b24460f33a1bf8f4d321ace.tar.zst cuberite-60850fe3e8da936d5b24460f33a1bf8f4d321ace.zip |
Diffstat (limited to 'src/HTTPServer/SslHTTPConnection.cpp')
-rw-r--r-- | src/HTTPServer/SslHTTPConnection.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/HTTPServer/SslHTTPConnection.cpp b/src/HTTPServer/SslHTTPConnection.cpp index fff96bb2e..b6b222b47 100644 --- a/src/HTTPServer/SslHTTPConnection.cpp +++ b/src/HTTPServer/SslHTTPConnection.cpp @@ -25,7 +25,7 @@ cSslHTTPConnection::cSslHTTPConnection(cHTTPServer & a_HTTPServer, const cX509Ce -void cSslHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) +bool cSslHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) { // If there is outgoing data in the queue, notify the server that it should write it out: if (!m_OutgoingData.empty()) @@ -52,13 +52,17 @@ void cSslHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) int NumRead = m_Ssl.ReadPlain(Buffer, sizeof(Buffer)); if (NumRead > 0) { - super::DataReceived(Buffer, (size_t)NumRead); + if (super::DataReceived(Buffer, (size_t)NumRead)) + { + // The socket has been closed, and the object is already deleted. Bail out. + return true; + } } // If both failed, bail out: if ((BytesWritten == 0) && (NumRead <= 0)) { - return; + return false; } } } |