-.\" $OpenBSD: BIO_get_data.3,v 1.6 2022/12/18 21:45:47 schwarze Exp $
+.\" $OpenBSD: BIO_get_data.3,v 1.7 2022/12/19 14:40:14 schwarze Exp $
.\" full merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
.\"
.\" This file is a derived work.
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: December 18 2022 $
+.Dd $Mdocdate: December 19 2022 $
.Dt BIO_GET_DATA 3
.Os
.Sh NAME
.Nm BIO_set_retry_special ,
.Nm BIO_clear_retry_flags ,
.Nm BIO_get_retry_flags ,
+.Nm BIO_copy_next_retry ,
.Nm BIO_set_init ,
.Nm BIO_get_init ,
.Nm BIO_set_shutdown ,
.Fa "BIO *a"
.Fc
.Ft void
+.Fo BIO_copy_next_retry
+.Fa "BIO *a"
+.Fc
+.Ft void
.Fo BIO_set_init
.Fa "BIO *a"
.Fa "int init"
and
.Dv BIO_FLAGS_IO_SPECIAL
flag bit in
-.Fa b ,
+.Fa a ,
respectively.
They all set the
.Dv BIO_FLAGS_SHOULD_RETRY
and
.Dv BIO_FLAGS_SHOULD_RETRY
in
-.Fa b .
+.Fa a .
+.Pp
+.Fn BIO_copy_next_retry
+copies retry-related state data from the BIO that follows
+.Fa a
+in its chain to
+.Fa a ,
+that is, the data accessible with
+.Fn BIO_get_retry_flags
+and
+.Xr BIO_get_retry_reason 3 .
+Flags which are already set in
+.Fa a
+are not cleared.
+Before calling
+.Fn BIO_copy_next_retry ,
+making sure that
+.Fa a
+is not the last BIO in its chain is the responsibility of the caller,
+for example by checking that
+.Xr BIO_next 3
+does not return
+.Dv NULL .
.Pp
The
.Fn BIO_set_init
.Fn BIO_clear_retry_flags ,
and
.Fn BIO_get_retry_flags
-first appeared in SSLeay 0.8.0 and
+first appeared in SSLeay 0.8.0,
+.Fn BIO_copy_next_retry
+in SSLeay 0.8.1, and
.Fn BIO_get_flags
in SSLeay 0.9.0.
These functions have been available since