diff options
author | Daniel Fiala <daniel@openssl.org> | 2022-10-03 05:19:25 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-10-04 19:04:02 +1100 |
commit | 47cd0e5b1f98fb88d6d8337f7ec0e16bb83cea32 (patch) | |
tree | 28201282a4f46ebb9c0eee66284fd590c7795380 /doc/man3/BIO_f_ssl.pod | |
parent | 511c49189ef600d41f44cd7c5d204e9ea27b5f48 (diff) |
Fix examples related to BIO_do_accept
Fixes openssl#8825
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19329)
Diffstat (limited to 'doc/man3/BIO_f_ssl.pod')
-rw-r--r-- | doc/man3/BIO_f_ssl.pod | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/man3/BIO_f_ssl.pod b/doc/man3/BIO_f_ssl.pod index c6dc53c105..365168646a 100644 --- a/doc/man3/BIO_f_ssl.pod +++ b/doc/man3/BIO_f_ssl.pod @@ -243,13 +243,20 @@ a client and also echoes the request to standard output. BIO_set_accept_bios(acpt, sbio); out = BIO_new_fp(stdout, BIO_NOCLOSE); - /* Setup accept BIO */ + /* First call to BIO_do_accept() sets up accept BIO */ if (BIO_do_accept(acpt) <= 0) { fprintf(stderr, "Error setting up accept BIO\n"); ERR_print_errors_fp(stderr); exit(1); } +/* Second call to BIO_do_accept() waits for incoming connection */ + if (BIO_do_accept(acpt) <= 0) { + fprintf(stderr, "Error accepting connection\n"); + ERR_print_errors_fp(stderr); + exit(1); + } + /* We only want one connection so remove and free accept BIO */ sbio = BIO_pop(acpt); BIO_free_all(acpt); |