Recover BIO_number_{read|written}.
Android needs it. These functions were removed in the move to BoringSSL. Change-Id: Ice24a0a1c390930cf07dbd00f72a3e12e6c241f9 Reviewed-on: https://boringssl-review.googlesource.com/1510 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
parent
1b96526c6f
commit
e2c4d26214
@ -144,7 +144,7 @@ void BIO_free_all(BIO *bio) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int bio_io(BIO *bio, void *buf, int len, size_t method_offset,
|
static int bio_io(BIO *bio, void *buf, int len, size_t method_offset,
|
||||||
int callback_flags, unsigned long *num) {
|
int callback_flags, size_t *num) {
|
||||||
int i;
|
int i;
|
||||||
typedef int (*io_func_t)(BIO *, char *, int);
|
typedef int (*io_func_t)(BIO *, char *, int);
|
||||||
io_func_t io_func = NULL;
|
io_func_t io_func = NULL;
|
||||||
@ -371,6 +371,14 @@ char *BIO_get_callback_arg(const BIO *bio) {
|
|||||||
return bio->cb_arg;
|
return bio->cb_arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OPENSSL_EXPORT size_t BIO_number_read(const BIO *bio) {
|
||||||
|
return bio->num_read;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPENSSL_EXPORT size_t BIO_number_written(const BIO *bio) {
|
||||||
|
return bio->num_write;
|
||||||
|
}
|
||||||
|
|
||||||
BIO *BIO_push(BIO *bio, BIO *appended_bio) {
|
BIO *BIO_push(BIO *bio, BIO *appended_bio) {
|
||||||
BIO *last_bio;
|
BIO *last_bio;
|
||||||
|
|
||||||
|
@ -256,6 +256,14 @@ OPENSSL_EXPORT void BIO_set_callback_arg(BIO *bio, char *arg);
|
|||||||
* set by |BIO_set_callback_arg|. */
|
* set by |BIO_set_callback_arg|. */
|
||||||
OPENSSL_EXPORT char *BIO_get_callback_arg(const BIO *bio);
|
OPENSSL_EXPORT char *BIO_get_callback_arg(const BIO *bio);
|
||||||
|
|
||||||
|
/* BIO_number_read returns the number of bytes that have been read from
|
||||||
|
* |bio|. */
|
||||||
|
OPENSSL_EXPORT size_t BIO_number_read(const BIO *bio);
|
||||||
|
|
||||||
|
/* BIO_number_written returns the number of bytes that have been written to
|
||||||
|
* |bio|. */
|
||||||
|
OPENSSL_EXPORT size_t BIO_number_written(const BIO *bio);
|
||||||
|
|
||||||
|
|
||||||
/* Managing chains of BIOs.
|
/* Managing chains of BIOs.
|
||||||
*
|
*
|
||||||
@ -709,9 +717,7 @@ struct bio_st {
|
|||||||
/* next_bio points to the next |BIO| in a chain. This |BIO| owns a reference
|
/* next_bio points to the next |BIO| in a chain. This |BIO| owns a reference
|
||||||
* to |next_bio|. */
|
* to |next_bio|. */
|
||||||
struct bio_st *next_bio; /* used by filter BIOs */
|
struct bio_st *next_bio; /* used by filter BIOs */
|
||||||
/* TODO(fork): either bring back BIO_number_read and write or remove these. */
|
size_t num_read, num_write;
|
||||||
unsigned long num_read;
|
|
||||||
unsigned long num_write;
|
|
||||||
|
|
||||||
CRYPTO_EX_DATA ex_data;
|
CRYPTO_EX_DATA ex_data;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user