1
0
mirror of https://github.com/lxsang/antd-tunnel-plugin synced 2024-12-27 02:18:20 +01:00

improvement api

This commit is contained in:
lxsang 2021-01-01 15:35:37 +01:00
parent 89b52082d9
commit 4a2b7ca22e
2 changed files with 4 additions and 1 deletions

Binary file not shown.

View File

@ -769,10 +769,13 @@ void destroy()
(void)snprintf(path, BUFFLEN, "%s/%s/%s", __plugin__.tmpdir, SOCK_DIR_NAME, HOT_LINE_SOCKET); (void)snprintf(path, BUFFLEN, "%s/%s/%s", __plugin__.tmpdir, SOCK_DIR_NAME, HOT_LINE_SOCKET);
(void)unlink(path); (void)unlink(path);
} }
pthread_mutex_unlock(&g_tunnel.lock); pthread_cancel(g_tunnel.tid);
LOG("Joining tunnel thread");
(void)pthread_join(g_tunnel.tid, NULL); (void)pthread_join(g_tunnel.tid, NULL);
pthread_mutex_unlock(&g_tunnel.lock);
bst_free(g_tunnel.channels); bst_free(g_tunnel.channels);
pthread_mutex_destroy(&g_tunnel.lock); pthread_mutex_destroy(&g_tunnel.lock);
LOG("Antd tunnel is destroyed");
} }
} }
static void process_client_message(antd_tunnel_msg_t *msg, antd_client_t *client) static void process_client_message(antd_tunnel_msg_t *msg, antd_client_t *client)