diff options
author | Rich Salz <rsalz@akamai.com> | 2016-01-30 18:04:25 +0100 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-02-11 18:40:32 +0100 |
commit | f3f1cf8444f439c0be9de04bf3821a20d00fd956 (patch) | |
tree | 50d0fc624d4680e6cd734328126cd60a9dc128be /crypto/bio | |
parent | RT3495: Add a hash for faster dup detection. (diff) | |
download | openssl-f3f1cf8444f439c0be9de04bf3821a20d00fd956.tar.xz openssl-f3f1cf8444f439c0be9de04bf3821a20d00fd956.zip |
Move to REF_DEBUG, for consistency.
Add utility macros REF_ASSERT_NOT and REF_PRINT_COUNT
This is also RT 4181
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bio_err.c | 2 | ||||
-rw-r--r-- | crypto/bio/bio_lib.c | 11 |
2 files changed, 4 insertions, 9 deletions
diff --git a/crypto/bio/bio_err.c b/crypto/bio/bio_err.c index 5b2eb952f8..36b9dfe62c 100644 --- a/crypto/bio/bio_err.c +++ b/crypto/bio/bio_err.c @@ -1,3 +1,4 @@ +/* crypto/bio/bio_err.c */ /* ==================================================================== * Copyright (c) 1999-2016 The OpenSSL Project. All rights reserved. * @@ -96,6 +97,7 @@ static ERR_STRING_DATA BIO_str_functs[] = { {ERR_FUNC(BIO_F_BIO_PUTS), "BIO_puts"}, {ERR_FUNC(BIO_F_BIO_READ), "BIO_read"}, {ERR_FUNC(BIO_F_BIO_SOCKET), "BIO_socket"}, + {ERR_FUNC(BIO_F_BIO_SOCKET_NBIO), "BIO_socket_nbio"}, {ERR_FUNC(BIO_F_BIO_SOCK_INFO), "BIO_sock_info"}, {ERR_FUNC(BIO_F_BIO_SOCK_INIT), "BIO_sock_init"}, {ERR_FUNC(BIO_F_BIO_WRITE), "BIO_write"}, diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c index ef68dbb774..ee8d622b20 100644 --- a/crypto/bio/bio_lib.c +++ b/crypto/bio/bio_lib.c @@ -110,17 +110,10 @@ int BIO_free(BIO *a) return (0); i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_BIO); -#ifdef REF_PRINT - REF_PRINT("BIO", a); -#endif + REF_PRINT_COUNT("BIO", a); if (i > 0) return (1); -#ifdef REF_CHECK - if (i < 0) { - fprintf(stderr, "BIO_free, bad reference count\n"); - abort(); - } -#endif + REF_ASSERT_ISNT(i < 0); if ((a->callback != NULL) && ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0)) return (i); |