summaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'server.c')
-rw-r--r--server.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/server.c b/server.c
index 9ce133a..f317d36 100644
--- a/server.c
+++ b/server.c
@@ -79,6 +79,7 @@ void
server_delete(struct cfg *cfg, struct server *scfg)
{
struct server_local *local, *ltmp;
+ struct server_proxy *proxy, *ptmp;
struct sockaddr_in46 *remote, *rtmp;
struct sockaddr_in46 *rcon, *rctmp;
@@ -87,18 +88,20 @@ server_delete(struct cfg *cfg, struct server *scfg)
idle_delete(cfg, scfg);
rcon_delete(cfg, scfg);
- list_for_each_entry_safe(remote, rtmp, &scfg->remotes, list) {
- list_del(&remote->list);
- xfree(remote);
- }
+ list_for_each_entry_safe(local, ltmp, &scfg->locals, list)
+ uring_cancel(cfg, &local->task);
+
+ list_for_each_entry_safe(proxy, ptmp, &scfg->proxys, list)
+ proxy_delete(cfg, proxy);
list_for_each_entry_safe(rcon, rctmp, &scfg->rcons, list) {
list_del(&rcon->list);
xfree(rcon);
}
- list_for_each_entry_safe(local, ltmp, &scfg->locals, list) {
- uring_cancel(cfg, &local->task);
+ list_for_each_entry_safe(remote, rtmp, &scfg->remotes, list) {
+ list_del(&remote->list);
+ xfree(remote);
}
uring_poll_cancel(cfg, &scfg->exec_task);