-/* $OpenBSD: bio.h,v 1.38 2018/02/20 18:17:17 tb Exp $ */
+/* $OpenBSD: bio.h,v 1.39 2018/02/22 16:38:43 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
BIO * BIO_new(BIO_METHOD *type);
int BIO_set(BIO *a, BIO_METHOD *type);
int BIO_free(BIO *a);
+int BIO_up_ref(BIO *bio);
void *BIO_get_data(BIO *a);
void BIO_set_data(BIO *a, void *ptr);
void BIO_set_init(BIO *a, int init);
-/* $OpenBSD: bio_lib.c,v 1.26 2018/02/20 17:55:26 tb Exp $ */
+/* $OpenBSD: bio_lib.c,v 1.27 2018/02/22 16:38:43 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
BIO_free(a);
}
+int
+BIO_up_ref(BIO *bio)
+{
+ int refs = CRYPTO_add(&bio->references, 1, CRYPTO_LOCK_BIO);
+ return (refs > 1) ? 1 : 0;
+}
+
void *
BIO_get_data(BIO *a)
{