From ca934091c1cd159c05f2492f306788d4268697cd Mon Sep 17 00:00:00 2001 From: hev Date: Sun, 14 Jan 2024 13:13:37 +0800 Subject: [PATCH] HevSocks5Server: Use object base class in HevTaskSystem. --- src/hev-socks5-proxy.c | 4 ---- src/hev-socks5-session.c | 4 ++-- src/hev-socks5-user-mark.c | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/hev-socks5-proxy.c b/src/hev-socks5-proxy.c index d223f81a8..620965436 100644 --- a/src/hev-socks5-proxy.c +++ b/src/hev-socks5-proxy.c @@ -67,7 +67,6 @@ hev_socks5_proxy_load_file (HevSocks5Authenticator *auth, const char *file) nlen = strlen (name); plen = strlen (pass); user = hev_socks5_user_mark_new (name, nlen, pass, plen, mark); - hev_object_set_atomic (HEV_OBJECT (user), 1); res = hev_socks5_authenticator_add (auth, HEV_SOCKS5_USER (user)); if (res < 0) { LOG_E ("socks5 proxy user conflict"); @@ -99,8 +98,6 @@ hev_socks5_proxy_load (void) if (!auth) return; - hev_object_set_atomic (HEV_OBJECT (auth), 1); - if (file) { hev_socks5_proxy_load_file (auth, file); } else { @@ -109,7 +106,6 @@ hev_socks5_proxy_load (void) user = hev_socks5_user_mark_new (name, strlen (name), pass, strlen (pass), 0); hev_socks5_authenticator_add (auth, HEV_SOCKS5_USER (user)); - hev_object_set_atomic (HEV_OBJECT (user), 1); } for (i = 0; i < workers; i++) { diff --git a/src/hev-socks5-session.c b/src/hev-socks5-session.c index 895eebeec..389434b13 100644 --- a/src/hev-socks5-session.c +++ b/src/hev-socks5-session.c @@ -126,7 +126,7 @@ hev_socks5_session_destruct (HevObject *base) LOG_D ("%p socks5 session destruct", self); - HEV_SOCKS5_SERVER_TYPE->finalizer (base); + HEV_SOCKS5_SERVER_TYPE->destruct (base); } HevObjectClass * @@ -142,7 +142,7 @@ hev_socks5_session_class (void) memcpy (kptr, HEV_SOCKS5_SERVER_TYPE, sizeof (HevSocks5ServerClass)); okptr->name = "HevSocks5Session"; - okptr->finalizer = hev_socks5_session_destruct; + okptr->destruct = hev_socks5_session_destruct; skptr = HEV_SOCKS5_CLASS (kptr); skptr->binder = hev_socks5_session_bind; diff --git a/src/hev-socks5-user-mark.c b/src/hev-socks5-user-mark.c index 535a14e31..549a0658a 100644 --- a/src/hev-socks5-user-mark.c +++ b/src/hev-socks5-user-mark.c @@ -66,7 +66,7 @@ hev_socks5_user_mark_destruct (HevObject *base) LOG_D ("%p socks5 user mark destruct", self); - HEV_SOCKS5_USER_TYPE->finalizer (base); + HEV_SOCKS5_USER_TYPE->destruct (base); } HevObjectClass * @@ -80,7 +80,7 @@ hev_socks5_user_mark_class (void) memcpy (kptr, HEV_SOCKS5_USER_TYPE, sizeof (HevSocks5UserClass)); okptr->name = "HevSocks5UserMark"; - okptr->finalizer = hev_socks5_user_mark_destruct; + okptr->destruct = hev_socks5_user_mark_destruct; } return okptr;