int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written)
{
- return bio_write_intern(b, data, dlen, written) >= 0;
+ if (dlen == 0) {
+ /* no error */
+ if (written != NULL)
+ *written = 0;
+ return 1;
+ }
+ return bio_write_intern(b, data, dlen, written) > 0;
}
int BIO_puts(BIO *b, const char *buf)
BIO_write_ex() attempts to write I<dlen> bytes from I<data> to BIO I<b>.
If successful then the number of bytes written is stored in I<*written>
-unless I<written> is NULL. No data is written if I<b> is NULL.
+unless I<written> is NULL.
BIO_read() attempts to read I<len> bytes from BIO I<b> and places
the data in I<buf>.
BIO_read_ex() returns 1 if data was successfully read, and 0 otherwise.
BIO_write_ex() returns 1 if no error was encountered writing data, 0 otherwise.
-Write to NULL B<BIO> is not considered as an error.
+Requesting to write 0 bytes is not considered an error.
BIO_write() returns -2 if the "write" operation is not implemented by the BIO
or -1 on other errors.
BIO_get_line() was added in OpenSSL 3.0.
+BIO_write_ex() returns 1 if the size of the data to write is 0 and the
+I<written> parameter of the function can be NULL since OpenSSL 3.0.
+
=head1 COPYRIGHT
Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.