mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Added SSL_want
.
This commit is contained in:
12
src/ssl.c
12
src/ssl.c
@ -2857,6 +2857,18 @@ int wolfSSL_get_alert_history(WOLFSSL* ssl, WOLFSSL_ALERT_HISTORY *h)
|
||||
return WOLFSSL_SUCCESS;
|
||||
}
|
||||
|
||||
/* returns SSL_WRITING, SSL_READING or SSL_NOTHING */
|
||||
int wolfSSL_want(WOLFSSL* ssl)
|
||||
{
|
||||
int rw_state = SSL_NOTHING;
|
||||
if (ssl) {
|
||||
if (ssl->error == WANT_READ)
|
||||
rw_state = SSL_READING;
|
||||
else if (ssl->error == WANT_WRITE)
|
||||
rw_state = SSL_WRITING;
|
||||
}
|
||||
return rw_state;
|
||||
}
|
||||
|
||||
/* return TRUE if current error is want read */
|
||||
int wolfSSL_want_read(WOLFSSL* ssl)
|
||||
|
@ -626,6 +626,7 @@ typedef WOLFSSL_ASN1_BIT_STRING ASN1_BIT_STRING;
|
||||
#define SSL_get_peer_certificate wolfSSL_get_peer_certificate
|
||||
#define SSL_get_peer_cert_chain wolfSSL_get_peer_cert_chain
|
||||
|
||||
#define SSL_want wolfSSL_want
|
||||
#define SSL_want_read wolfSSL_want_read
|
||||
#define SSL_want_write wolfSSL_want_write
|
||||
|
||||
|
@ -1625,6 +1625,7 @@ WOLFSSL_API int wolfSSL_CTX_set_session_id_context(WOLFSSL_CTX*,
|
||||
WOLFSSL_API WOLFSSL_X509* wolfSSL_get_peer_certificate(WOLFSSL* ssl);
|
||||
WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509)* wolfSSL_get_peer_cert_chain(const WOLFSSL*);
|
||||
|
||||
WOLFSSL_API int wolfSSL_want(WOLFSSL*);
|
||||
WOLFSSL_API int wolfSSL_want_read(WOLFSSL*);
|
||||
WOLFSSL_API int wolfSSL_want_write(WOLFSSL*);
|
||||
|
||||
|
Reference in New Issue
Block a user