Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-server
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-server
Commits
be2f801e
Commit
be2f801e
authored
6 years ago
by
armatusmiles
Browse files
Options
Downloads
Patches
Plain Diff
[+] dap_http_simple_module_deinit
parent
c2dbb288
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
http_server/dap_http_simple.c
+9
-3
9 additions, 3 deletions
http_server/dap_http_simple.c
test/http_server/dap_http_simple_test.c
+9
-2
9 additions, 2 deletions
test/http_server/dap_http_simple_test.c
with
18 additions
and
5 deletions
http_server/dap_http_simple.c
+
9
−
3
View file @
be2f801e
...
@@ -73,24 +73,30 @@ user_agents_item_t *user_agents_list = NULL;
...
@@ -73,24 +73,30 @@ user_agents_item_t *user_agents_list = NULL;
static
struct
ev_loop
*
http_simple_loop
;
static
struct
ev_loop
*
http_simple_loop
;
static
ev_async
async_watcher_http_simple
;
static
ev_async
async_watcher_http_simple
;
static
pthread_mutex_t
mutex_on_queue_http_response
=
PTHREAD_MUTEX_INITIALIZER
;
static
pthread_mutex_t
mutex_on_queue_http_response
=
PTHREAD_MUTEX_INITIALIZER
;
static
pthread_t
http_simple_loop_thread
;
// uint64_t s_TTL_session_key=3600;
// uint64_t s_TTL_session_key=3600;
int
dap_http_simple_module_init
()
int
dap_http_simple_module_init
()
{
{
pthread_mutex_init
(
&
mutex_on_queue_http_response
,
NULL
);
http_simple_loop
=
ev_loop_new
(
0
);
http_simple_loop
=
ev_loop_new
(
0
);
TAILQ_INIT
(
&
tailq_head
);
TAILQ_INIT
(
&
tailq_head
);
pthread_t
thread
;
ev_async_init
(
&
async_watcher_http_simple
,
async_control_proc
);
ev_async_init
(
&
async_watcher_http_simple
,
async_control_proc
);
ev_async_start
(
http_simple_loop
,
&
async_watcher_http_simple
);
ev_async_start
(
http_simple_loop
,
&
async_watcher_http_simple
);
pthread_create
(
&
thread
,
NULL
,
loop_http_simple_proc
,
NULL
);
pthread_create
(
&
http_simple_loop_
thread
,
NULL
,
loop_http_simple_proc
,
NULL
);
return
0
;
return
0
;
}
}
void
dap_http_simple_module_deinit
(
void
)
{
ev_async_stop
(
http_simple_loop
,
&
async_watcher_http_simple
);
pthread_mutex_destroy
(
&
mutex_on_queue_http_response
);
pthread_join
(
http_simple_loop_thread
,
NULL
);
ev_loop_destroy
(
http_simple_loop
);
}
static
void
async_control_proc
(
EV_P_
ev_async
*
w
,
int
revents
)
static
void
async_control_proc
(
EV_P_
ev_async
*
w
,
int
revents
)
{
{
...
...
This diff is collapsed.
Click to expand it.
test/http_server/dap_http_simple_test.c
+
9
−
2
View file @
be2f801e
#include
"dap_http_simple_test.h"
#include
"dap_http_simple_test.h"
#include
"dap_http_simple.c"
#include
"dap_http_simple.c"
static
void
test_
init_deini
t
()
static
void
test_
user_agent_suppor
t
()
{
{
dap_http_simple_set_supported_user_agents
(
"DapVpn/2.2"
,
"SecondVpn/3.3"
,
NULL
);
dap_http_simple_set_supported_user_agents
(
"DapVpn/2.2"
,
"SecondVpn/3.3"
,
NULL
);
...
@@ -28,8 +28,15 @@ static void test_init_deinit()
...
@@ -28,8 +28,15 @@ static void test_init_deinit()
_free_user_agents_list
();
_free_user_agents_list
();
}
}
void
dap_http_simple_test_init_deinit
()
{
dap_http_simple_module_init
();
dap_http_simple_module_deinit
();
}
void
dap_http_http_simple_test_run
()
void
dap_http_http_simple_test_run
()
{
{
dap_print_module_name
(
"dap_http_http_simple_test"
);
dap_print_module_name
(
"dap_http_http_simple_test"
);
test_init_deinit
();
test_user_agent_support
();
dap_http_simple_test_init_deinit
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment