add CyaSSL_send()/recv() with flags parameter
This commit is contained in:
parent
a1e8cd532d
commit
35b4f08049
@ -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);
|
||||
|
34
src/ssl.c
34
src/ssl.c
@ -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()");
|
||||
|
Loading…
Reference in New Issue
Block a user