Check if the OpenSSL structure is still valid after getting the mutex lock.

git-svn-id: http://voip.null.ro/svn/yate@3030 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2010-01-25 16:48:47 +00:00
parent 2e749967d4
commit 0a336dee9d
1 changed files with 8 additions and 0 deletions

View File

@ -380,6 +380,10 @@ int SslSocket::writeData(const void* buffer, int length)
if (!buffer)
length = 0;
Lock lock(this);
if (!m_ssl) {
m_error = EINVAL;
return socketError();
}
return sslError(::SSL_write(m_ssl,buffer,length));
}
@ -389,6 +393,10 @@ int SslSocket::readData(void* buffer, int length)
if (!buffer)
length = 0;
Lock lock(this);
if (!m_ssl) {
m_error = EINVAL;
return socketError();
}
return sslError(::SSL_read(m_ssl,buffer,length));
}