Skip to content

Commit

Permalink
Merge pull request #93 from qzhuyan/dev/william/handle-listen-stop-compl
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuyan authored Jun 8, 2022
2 parents fb9619a + d005728 commit 562bf32
Show file tree
Hide file tree
Showing 25 changed files with 926 additions and 441 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,15 @@ $ make test

# Documentation

[API DOC](./docs/API.org)
``` sh
$ make doc
```

Then check the doc in browser:

[TODO LIST](./docs/todo.org)
``` sh
$ firefox doc/index.html
```

# License
Apache License Version 2.0
Expand Down
29 changes: 4 additions & 25 deletions c_src/quicer_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,11 +1011,6 @@ get_stream_opt(ErlNifEnv *env,
res = ERROR_TUPLE_2(ATOM_STATUS(QUIC_STATUS_NOT_SUPPORTED));
goto Exit;
}
else if (s_ctx->c_ctx)
{
res = get_connection_opt(env, s_ctx->c_ctx, optname, elevel);
goto Exit;
}
else
{
res = ERROR_TUPLE_2(ATOM_PARAM_ERROR);
Expand Down Expand Up @@ -1124,11 +1119,6 @@ set_stream_opt(ErlNifEnv *env,
return ERROR_TUPLE_2(ATOM_PARAM_ERROR);
}
}
else if (s_ctx->c_ctx)
{
res = set_connection_opt(env, s_ctx->c_ctx, optname, optval, elevel);
goto Exit;
}
else
{
res = ERROR_TUPLE_2(ATOM_PARAM_ERROR);
Expand Down Expand Up @@ -1294,11 +1284,6 @@ get_connection_opt(ErlNifEnv *env,
res = ERROR_TUPLE_2(ATOM_STATUS(QUIC_STATUS_NOT_SUPPORTED));
goto Exit;
}
else if (c_ctx->l_ctx)
{
res = get_listener_opt(env, c_ctx->l_ctx, optname, elevel);
goto Exit;
}
else
{
res = ERROR_TUPLE_2(ATOM_PARAM_ERROR);
Expand Down Expand Up @@ -1523,11 +1508,6 @@ set_connection_opt(ErlNifEnv *env,
res = ERROR_TUPLE_2(ATOM_STATUS(QUIC_STATUS_NOT_SUPPORTED));
goto Exit;
}
else if (c_ctx->l_ctx)
{ // Server
res = set_listener_opt(env, c_ctx->l_ctx, optname, optval, elevel);
goto Exit;
}
else
{
res = ERROR_TUPLE_2(ATOM_PARAM_ERROR);
Expand Down Expand Up @@ -1649,13 +1629,12 @@ set_listener_opt(ErlNifEnv *env,
}

enif_mutex_lock(l_ctx->lock);

if (l_ctx->is_closed)
{
enif_mutex_unlock(l_ctx->lock);
return ERROR_TUPLE_2(ATOM_CLOSED);
res = ERROR_TUPLE_2(ATOM_CLOSED);
goto Exit;
}
enif_keep_resource(l_ctx);
enif_mutex_unlock(l_ctx->lock);

if (!IS_SAME_TERM(ATOM_FALSE, elevel))
{
Expand Down Expand Up @@ -1694,7 +1673,7 @@ set_listener_opt(ErlNifEnv *env,
res = ERROR_TUPLE_2(ATOM_STATUS(status));
}
Exit:
enif_release_resource(l_ctx);
enif_mutex_unlock(l_ctx->lock);
return res;
}

Expand Down
Loading

0 comments on commit 562bf32

Please sign in to comment.