diff options
author | Bodo Möller <bodo@openssl.org> | 1999-09-27 13:43:59 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 1999-09-27 13:43:59 +0000 |
commit | e405b8d120a10cedf2775bb1d3d9dab85c3dd0c1 (patch) | |
tree | 67d2516f47f4103a57379c359e79cff8fa320279 /crypto/bio/bss_bio.c | |
parent | 6cc4ee03df4be25f3be44ae20bc8750b90c15705 (diff) | |
download | openssl-e405b8d120a10cedf2775bb1d3d9dab85c3dd0c1.tar.gz |
new control code BIO_C_RESET_READ_REQUEST
Diffstat (limited to 'crypto/bio/bss_bio.c')
-rw-r--r-- | crypto/bio/bss_bio.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/bio/bss_bio.c b/crypto/bio/bss_bio.c index ef4b3454d7..40df575af9 100644 --- a/crypto/bio/bss_bio.c +++ b/crypto/bio/bss_bio.c @@ -493,6 +493,15 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr) ret = (long) b->request; break; + case BIO_C_RESET_READ_REQUEST: + /* Reset request. (Can be useful after read attempts + * at the other side that are meant to be non-blocking, + * e.g. when probing SSL_read to see if any data is + * available.) */ + b->request = 0; + ret = 1; + break; + case BIO_C_SHUTDOWN_WR: /* similar to shutdown(..., SHUT_WR) */ b->closed = 1; @@ -750,6 +759,11 @@ size_t BIO_ctrl_get_read_request(BIO *bio) return BIO_ctrl(bio, BIO_C_GET_READ_REQUEST, 0, NULL); } +int BIO_ctrl_reset_read_request(BIO *bio) + { + return (BIO_ctrl(bio, BIO_C_RESET_READ_REQUEST, 0, NULL) != 0); + } + /* BIO_nread0/nread/nwrite0/nwrite are availabe only for BIO pairs for now * (conceivably some other BIOs could allow non-copying reads and writes too.) |