Skip to content

Commit

Permalink
HevSocks5Server: Use object base class in HevTaskSystem.
Browse files Browse the repository at this point in the history
  • Loading branch information
heiher committed Jan 14, 2024
1 parent 97b33ae commit ca93409
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/hev-socks5-proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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 {
Expand All @@ -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++) {
Expand Down
4 changes: 2 additions & 2 deletions src/hev-socks5-session.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/hev-socks5-user-mark.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand All @@ -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;
Expand Down

0 comments on commit ca93409

Please sign in to comment.