summaryrefslogtreecommitdiffstats
path: root/libssh
diff options
context:
space:
mode:
Diffstat (limited to 'libssh')
-rw-r--r--libssh/init.c1
-rw-r--r--libssh/poll.c12
-rw-r--r--libssh/socket.c10
3 files changed, 22 insertions, 1 deletions
diff --git a/libssh/init.c b/libssh/init.c
index bab9cdfb..bf84bc1d 100644
--- a/libssh/init.c
+++ b/libssh/init.c
@@ -65,6 +65,7 @@ int ssh_init(void) {
int ssh_finalize(void) {
ssh_regex_finalize();
ssh_crypto_finalize();
+ ssh_socket_cleanup();
#ifdef HAVE_LIBGCRYPT
gcry_control(GCRYCTL_TERM_SECMEM);
#elif defined HAVE_LIBCRYPTO
diff --git a/libssh/poll.c b/libssh/poll.c
index d74216b0..b6b4a430 100644
--- a/libssh/poll.c
+++ b/libssh/poll.c
@@ -63,6 +63,10 @@ void ssh_poll_init(void) {
return;
}
+void ssh_poll_cleanup(void) {
+ return;
+}
+
int ssh_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) {
return poll((struct pollfd *) fds, nfds, timeout);
}
@@ -234,6 +238,14 @@ void ssh_poll_init(void) {
}
}
+void ssh_poll_cleanup(void) {
+ win_poll = bsd_poll;
+
+ FreeLibrary(hlib);
+
+ hlib = NULL;
+}
+
int ssh_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) {
return win_poll(fds, nfds, timeout);
}
diff --git a/libssh/socket.c b/libssh/socket.c
index 402a5b78..516639c3 100644
--- a/libssh/socket.c
+++ b/libssh/socket.c
@@ -77,7 +77,15 @@ int ssh_socket_init(void) {
return 0;
}
-/*
+
+/**
+ * @brief Cleanup the socket system.
+ */
+void ssh_socket_cleanup(void) {
+ ssh_poll_cleanup();
+}
+
+/**
* \internal
* \brief creates a new Socket object
*/