summaryrefslogtreecommitdiff
path: root/ecp
diff options
context:
space:
mode:
Diffstat (limited to 'ecp')
-rw-r--r--ecp/server/vlink.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ecp/server/vlink.c b/ecp/server/vlink.c
index d0c865b..6efb654 100644
--- a/ecp/server/vlink.c
+++ b/ecp/server/vlink.c
@@ -145,8 +145,15 @@ void vlink_keyx(ECPSocket *sock, int keyx_period) {
ecp_conn_unlock(conn);
if (is_d) {
+ ECPConnection *_conn = NULL;
+
LOG(LOG_DEBUG, "vlink_keyx: disconnect\n");
- // close all inbound connections;
+ /* close all inbound connections */
+ while ((_conn = ecp_sock_search_gc(conn->sock, &conn->remote.key_perma.public))) {
+ ecp_conn_close(_conn);
+ ecp_conn_refcount_dec(_conn);
+ }
+
pthread_rwlock_wrlock(&vlink_conn_rwlock);
ht_remove_conn(vlink_conn, conn);
pthread_rwlock_unlock(&vlink_conn_rwlock);