summaryrefslogtreecommitdiffstats
path: root/crypto/bio
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/b_addr.c3
-rw-r--r--crypto/bio/bio_lcl.h4
-rw-r--r--crypto/bio/bio_lib.c10
3 files changed, 16 insertions, 1 deletions
diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c
index ed4c1397d9..eed40bf8b5 100644
--- a/crypto/bio/b_addr.c
+++ b/crypto/bio/b_addr.c
@@ -62,7 +62,7 @@
#include <openssl/buffer.h>
#include <ctype.h>
-static CRYPTO_RWLOCK *bio_lookup_lock;
+CRYPTO_RWLOCK *bio_lookup_lock;
static CRYPTO_ONCE bio_lookup_init = CRYPTO_ONCE_STATIC_INIT;
/*
@@ -891,4 +891,5 @@ int BIO_lookup(const char *host, const char *service,
return ret;
}
+
#endif /* OPENSSL_NO_SOCK */
diff --git a/crypto/bio/bio_lcl.h b/crypto/bio/bio_lcl.h
index 7f3b22268a..52c9e79a24 100644
--- a/crypto/bio/bio_lcl.h
+++ b/crypto/bio/bio_lcl.h
@@ -127,6 +127,8 @@ struct bio_st {
typedef unsigned int socklen_t;
# endif
+extern CRYPTO_RWLOCK *bio_lookup_lock;
+
int BIO_ADDR_make(BIO_ADDR *ap, const struct sockaddr *sa);
const struct sockaddr *BIO_ADDR_sockaddr(const BIO_ADDR *ap);
struct sockaddr *BIO_ADDR_sockaddr_noconst(BIO_ADDR *ap);
@@ -135,6 +137,8 @@ socklen_t BIO_ADDRINFO_sockaddr_size(const BIO_ADDRINFO *bai);
const struct sockaddr *BIO_ADDRINFO_sockaddr(const BIO_ADDRINFO *bai);
#endif
+void bio_sock_cleanup_int(void);
+
#if BIO_FLAGS_UPLINK==0
/* Shortcut UPLINK calls on most platforms... */
# define UP_stdin stdin
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c
index ac98cf2402..025869454f 100644
--- a/crypto/bio/bio_lib.c
+++ b/crypto/bio/bio_lib.c
@@ -644,3 +644,13 @@ uint64_t BIO_number_written(BIO *bio)
return bio->num_write;
return 0;
}
+
+
+void bio_cleanup(void)
+{
+#ifndef OPENSSL_NO_SOCK
+ bio_sock_cleanup_int();
+ CRYPTO_THREAD_lock_free(bio_lookup_lock);
+ bio_lookup_lock = NULL;
+#endif
+}