mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 00:49:46 +02:00
fix(NetSSL): Non-blocking sockets support #4773
This commit is contained in:
@@ -332,22 +332,6 @@ void SecureSocketImpl::close()
|
||||
}
|
||||
|
||||
|
||||
void SecureSocketImpl::setBlocking(bool flag)
|
||||
{
|
||||
poco_check_ptr (_pSocket);
|
||||
|
||||
_pSocket->setBlocking(flag);
|
||||
}
|
||||
|
||||
|
||||
bool SecureSocketImpl::getBlocking() const
|
||||
{
|
||||
poco_check_ptr (_pSocket);
|
||||
|
||||
return _pSocket->getBlocking();
|
||||
}
|
||||
|
||||
|
||||
int SecureSocketImpl::sendBytes(const void* buffer, int length, int flags)
|
||||
{
|
||||
poco_assert (_pSocket->initialized());
|
||||
@@ -409,7 +393,14 @@ int SecureSocketImpl::receiveBytes(void* buffer, int length, int flags)
|
||||
Poco::Timestamp tsStart;
|
||||
while (true)
|
||||
{
|
||||
rc = ::SSL_read(_pSSL, buffer, length);
|
||||
if (flags & MSG_PEEK)
|
||||
{
|
||||
rc = SSL_peek(_pSSL, buffer, length);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = SSL_read(_pSSL, buffer, length);
|
||||
}
|
||||
if (!mustRetry(rc))
|
||||
break;
|
||||
|
||||
|
||||
@@ -225,4 +225,28 @@ int SecureStreamSocketImpl::completeHandshake()
|
||||
}
|
||||
|
||||
|
||||
void SecureStreamSocketImpl::setBlocking(bool flag)
|
||||
{
|
||||
_impl.socket()->setBlocking(flag);
|
||||
}
|
||||
|
||||
|
||||
bool SecureStreamSocketImpl::getBlocking() const
|
||||
{
|
||||
return _impl.socket()->getBlocking();
|
||||
}
|
||||
|
||||
|
||||
void SecureStreamSocketImpl::setRawOption(int level, int option, const void* value, poco_socklen_t length)
|
||||
{
|
||||
_impl.socket()->setRawOption(level, option, value, length);
|
||||
}
|
||||
|
||||
|
||||
void SecureStreamSocketImpl::getRawOption(int level, int option, void* value, poco_socklen_t& length)
|
||||
{
|
||||
_impl.socket()->getRawOption(level, option, value, length);
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Net
|
||||
|
||||
Reference in New Issue
Block a user