Use non-blocking send in GNU TLS push callback.
This commit is contained in:
parent
59e635d317
commit
fa399699d5
@ -307,8 +307,14 @@ ssize_t TLSSocket_GnuTLS::gnutlsPushFunc
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
sok->m_wrapped->sendRaw
|
const ssize_t ret = static_cast <ssize_t>
|
||||||
(reinterpret_cast <const byte_t*>(data), len);
|
(sok->m_wrapped->sendRawNonBlocking
|
||||||
|
(reinterpret_cast <const byte_t*>(data), len));
|
||||||
|
|
||||||
|
if (ret == 0 && sok->m_wrapped->getStatus() & socket::STATUS_WOULDBLOCK)
|
||||||
|
return GNUTLS_E_AGAIN;
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
catch (exception& e)
|
catch (exception& e)
|
||||||
{
|
{
|
||||||
@ -317,8 +323,6 @@ ssize_t TLSSocket_GnuTLS::gnutlsPushFunc
|
|||||||
sok->m_ex = e.clone();
|
sok->m_ex = e.clone();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return len;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user