add CyaSSL_send()/recv() with flags parameter

This commit is contained in:
toddouska 2012-10-26 15:09:58 -07:00
parent a1e8cd532d
commit 35b4f08049
2 changed files with 36 additions and 0 deletions

View File

@ -190,6 +190,8 @@ CYASSL_API int CyaSSL_accept(CYASSL*);
CYASSL_API void CyaSSL_CTX_free(CYASSL_CTX*);
CYASSL_API void CyaSSL_free(CYASSL*);
CYASSL_API int CyaSSL_shutdown(CYASSL*);
CYASSL_API int CyaSSL_send(CYASSL*, const void*, int sz, int flags);
CYASSL_API int CyaSSL_recv(CYASSL*, void*, int sz, int flags);
CYASSL_API void CyaSSL_CTX_set_quiet_shutdown(CYASSL_CTX*, int);
CYASSL_API void CyaSSL_set_quiet_shutdown(CYASSL*, int);

View File

@ -395,6 +395,40 @@ int CyaSSL_read(CYASSL* ssl, void* data, int sz)
}
int CyaSSL_send(CYASSL* ssl, const void* data, int sz, int flags)
{
int ret;
int oldFlags = ssl->wflags;
CYASSL_ENTER("CyaSSL_send()");
ssl->wflags = flags;
ret = CyaSSL_write(ssl, data, sz);
ssl->wflags = oldFlags;
CYASSL_LEAVE("CyaSSL_send()", ret);
return ret;
}
int CyaSSL_recv(CYASSL* ssl, void* data, int sz, int flags)
{
int ret;
int oldFlags = ssl->rflags;
CYASSL_ENTER("CyaSSL_recv()");
ssl->rflags = flags;
ret = CyaSSL_read(ssl, data, sz);
ssl->rflags = oldFlags;
CYASSL_LEAVE("CyaSSL_recv()", ret);
return ret;
}
int CyaSSL_shutdown(CYASSL* ssl)
{
CYASSL_ENTER("SSL_shutdown()");