mirror of https://github.com/Icinga/icinga2.git
parent
fbce8e430a
commit
dc4fe38d8f
|
@ -36,7 +36,7 @@ bool I2_EXPORT TlsStream::m_SSLIndexInitialized = false;
|
|||
* @param sslContext The SSL context for the client.
|
||||
*/
|
||||
TlsStream::TlsStream(const Socket::Ptr& socket, ConnectionRole role, const shared_ptr<SSL_CTX>& sslContext)
|
||||
: m_Socket(socket), m_Role(role)
|
||||
: m_Eof(false), m_Socket(socket), m_Role(role)
|
||||
{
|
||||
std::ostringstream msgbuf;
|
||||
char errbuf[120];
|
||||
|
@ -248,6 +248,10 @@ void TlsStream::Write(const void *buffer, size_t count)
|
|||
*/
|
||||
void TlsStream::Close(void)
|
||||
{
|
||||
boost::mutex::scoped_lock alock(m_IOActionLock);
|
||||
|
||||
m_Eof = true;
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
int rc, err;
|
||||
|
||||
|
@ -286,5 +290,5 @@ close_socket:
|
|||
|
||||
bool TlsStream::IsEof(void) const
|
||||
{
|
||||
return (BIO_eof(m_BIO) == 1);
|
||||
return m_Eof;
|
||||
}
|
||||
|
|
|
@ -54,9 +54,9 @@ public:
|
|||
|
||||
private:
|
||||
shared_ptr<SSL> m_SSL;
|
||||
bool m_Eof;
|
||||
mutable boost::mutex m_SSLLock;
|
||||
mutable boost::mutex m_IOActionLock;
|
||||
BIO *m_BIO;
|
||||
|
||||
Socket::Ptr m_Socket;
|
||||
ConnectionRole m_Role;
|
||||
|
|
Loading…
Reference in New Issue