aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bio
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-04-28 17:39:26 +0200
committerRichard Levitte <levitte@openssl.org>2016-04-28 18:00:25 +0200
commit68423b146151a15c5373a24506506c588ae08729 (patch)
tree6a6e30497774a85d1d81ef405108627559c6555d /crypto/bio
parentb3bd3d5af8ed31f438db4367ce3a4bd43067e764 (diff)
downloadopenssl-68423b146151a15c5373a24506506c588ae08729.tar.gz
Fix BIO_set_nbio_accept()
The code that implements this control would work when enabling nbio, but the disabling code needed fixing. Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/bss_acpt.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c
index 8cd66fe1ee..70168ecd59 100644
--- a/crypto/bio/bss_acpt.c
+++ b/crypto/bio/bss_acpt.c
@@ -474,16 +474,17 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
data->param_serv = BUF_strdup(ptr);
b->init = 1;
} else if (num == 2) {
- if (ptr != NULL)
- data->bind_mode |= BIO_SOCK_NONBLOCK;
- else
- data->bind_mode &= ~BIO_SOCK_NONBLOCK;
+ data->bind_mode |= BIO_SOCK_NONBLOCK;
} else if (num == 3) {
BIO_free(data->bio_chain);
data->bio_chain = (BIO *)ptr;
} else if (num == 4) {
data->accept_family = *(int *)ptr;
}
+ } else {
+ if (num == 2) {
+ data->bind_mode &= ~BIO_SOCK_NONBLOCK;
+ }
}
break;
case BIO_C_SET_NBIO: