Skip to content

Commit

Permalink
refactor: refcnt part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuyan committed Nov 15, 2024
1 parent 64837de commit 2fb4843
Show file tree
Hide file tree
Showing 19 changed files with 515 additions and 387 deletions.
20 changes: 10 additions & 10 deletions c_src/quicer_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ get_stream_opt(ErlNifEnv *env,
{
res = get_level_param(env,
s_ctx->Stream,
s_ctx->c_ctx->config_resource->Configuration,
s_ctx->c_ctx->config_ctx->Configuration,
optname,
elevel);
goto Exit;
Expand Down Expand Up @@ -1448,7 +1448,7 @@ set_stream_opt(ErlNifEnv *env,
{
res = set_level_param(env,
s_ctx->Stream,
s_ctx->c_ctx->config_resource->Configuration,
s_ctx->c_ctx->config_ctx->Configuration,
optname,
optval,
elevel);
Expand Down Expand Up @@ -1521,13 +1521,13 @@ get_connection_opt(ErlNifEnv *env,

if (!IS_SAME_TERM(ATOM_FALSE, elevel))
{
if (!c_ctx->config_resource)
if (!c_ctx->config_ctx)
{
goto Exit;
}
res = get_level_param(env,
c_ctx->Connection,
c_ctx->config_resource->Configuration,
c_ctx->config_ctx->Configuration,
optname,
elevel);
goto Exit;
Expand Down Expand Up @@ -1714,13 +1714,13 @@ set_connection_opt(ErlNifEnv *env,

if (!IS_SAME_TERM(ATOM_FALSE, elevel))
{
if (!c_ctx->config_resource)
if (!c_ctx->config_ctx)
{
goto Exit;
}
res = set_level_param(env,
c_ctx->Connection,
c_ctx->config_resource->Configuration,
c_ctx->config_ctx->Configuration,
optname,
optval,
elevel);
Expand Down Expand Up @@ -2052,13 +2052,13 @@ get_listener_opt(ErlNifEnv *env,
{
return ERROR_TUPLE_2(ATOM_CLOSED);
}
enif_keep_resource(l_ctx);
get_listener_handle(l_ctx);

if (!IS_SAME_TERM(ATOM_FALSE, elevel))
{
res = get_level_param(env,
l_ctx->Listener,
l_ctx->config_resource->Configuration,
l_ctx->config_ctx->Configuration,
optname,
elevel);
goto Exit;
Expand Down Expand Up @@ -2113,7 +2113,7 @@ get_listener_opt(ErlNifEnv *env,
res = ERROR_TUPLE_2(ATOM_STATUS(status));
}
Exit:
enif_release_resource(l_ctx);
put_listener_handle(l_ctx);
return res;
}

Expand Down Expand Up @@ -2147,7 +2147,7 @@ set_listener_opt(ErlNifEnv *env,
{
res = set_level_param(env,
l_ctx->Listener,
l_ctx->config_resource->Configuration,
l_ctx->config_ctx->Configuration,
optname,
optval,
elevel);
Expand Down
Loading

0 comments on commit 2fb4843

Please sign in to comment.