aboutsummaryrefslogtreecommitdiff
path: root/contrib/unbound/util/tcp_conn_limit.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/unbound/util/tcp_conn_limit.c')
-rw-r--r--contrib/unbound/util/tcp_conn_limit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/unbound/util/tcp_conn_limit.c b/contrib/unbound/util/tcp_conn_limit.c
index d7d86a5407b5..284d89076d57 100644
--- a/contrib/unbound/util/tcp_conn_limit.c
+++ b/contrib/unbound/util/tcp_conn_limit.c
@@ -192,3 +192,14 @@ tcl_list_get_mem(struct tcl_list* tcl)
if(!tcl) return 0;
return sizeof(*tcl) + regional_get_mem(tcl->region);
}
+
+void tcl_list_swap_tree(struct tcl_list* tcl, struct tcl_list* data)
+{
+ /* swap tree and region */
+ rbtree_type oldtree = tcl->tree;
+ struct regional* oldregion = tcl->region;
+ tcl->tree = data->tree;
+ tcl->region = data->region;
+ data->tree = oldtree;
+ data->region = oldregion;
+}