Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-SMF
Commits
cac0624f
Commit
cac0624f
authored
Nov 24, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sign handler for HTTP servers
parent
1fb86a55
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
7 deletions
+22
-7
src/api-server/smf-http2-server.cpp
src/api-server/smf-http2-server.cpp
+5
-0
src/api-server/smf-http2-server.h
src/api-server/smf-http2-server.h
+1
-0
src/oai_smf/main.cpp
src/oai_smf/main.cpp
+16
-7
No files found.
src/api-server/smf-http2-server.cpp
View file @
cac0624f
...
...
@@ -593,3 +593,8 @@ void smf_http2_server::release_sm_context_handler(
response
.
write_head
(
sm_context_response
.
get_http_code
());
response
.
end
();
}
//------------------------------------------------------------------------------
void
smf_http2_server
::
stop
()
{
server
.
stop
();
}
src/api-server/smf-http2-server.h
View file @
cac0624f
...
...
@@ -65,6 +65,7 @@ class smf_http2_server {
const
std
::
string
&
smf_ref
,
const
SmContextReleaseData
&
smContextReleaseData
,
const
response
&
response
);
void
stop
();
private:
util
::
uint_generator
<
uint32_t
>
m_promise_id_generator
;
...
...
src/oai_smf/main.cpp
View file @
cac0624f
...
...
@@ -45,8 +45,9 @@ itti_mw *itti_inst = nullptr;
async_shell_cmd
*
async_shell_cmd_inst
=
nullptr
;
smf_app
*
smf_app_inst
=
nullptr
;
smf_config
smf_cfg
;
//SMFApiServer *smf_api_server_1 = nullptr;
//smf_http2_server *smf_api_server_2 = nullptr;
SMFApiServer
*
smf_api_server_1
=
nullptr
;
smf_http2_server
*
smf_api_server_2
=
nullptr
;
void
send_heartbeat_to_tasks
(
const
uint32_t
sequence
);
...
...
@@ -71,9 +72,16 @@ void my_app_signal_handler(int s)
std
::
cout
<<
"Freeing Allocated memory..."
<<
std
::
endl
;
if
(
async_shell_cmd_inst
)
delete
async_shell_cmd_inst
;
async_shell_cmd_inst
=
nullptr
;
std
::
cout
<<
"Async Shell CMD memory done."
<<
std
::
endl
;
//smf_api_server_1->shutdown();
//if (smf_api_server_1) delete smf_api_server_1; smf_api_server_1 = nullptr;
//if (smf_api_server_2) delete smf_api_server_2; smf_api_server_2 = nullptr;
if
(
smf_api_server_1
)
{
smf_api_server_1
->
shutdown
();
delete
smf_api_server_1
;
smf_api_server_1
=
nullptr
;
}
if
(
smf_api_server_2
)
{
smf_api_server_2
->
stop
();
delete
smf_api_server_2
;
smf_api_server_2
=
nullptr
;
}
std
::
cout
<<
"SMF API Server memory done."
<<
std
::
endl
;
if
(
itti_inst
)
delete
itti_inst
;
itti_inst
=
nullptr
;
std
::
cout
<<
"ITTI memory done."
<<
std
::
endl
;
...
...
@@ -129,14 +137,15 @@ int main(int argc, char **argv)
//SMF Pistache API server (HTTP1)
Pistache
::
Address
addr
(
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
smf_cfg
.
sbi
.
addr4
)))
,
Pistache
::
Port
(
smf_cfg
.
sbi
.
port
));
SMFApiServer
*
smf_api_server_1
=
new
SMFApiServer
(
addr
,
smf_app_inst
);
smf_api_server_1
=
new
SMFApiServer
(
addr
,
smf_app_inst
);
smf_api_server_1
->
init
(
2
);
//smf_api_server_1->start();
std
::
thread
smf_http1_manager
(
&
SMFApiServer
::
start
,
smf_api_server_1
);
//SMF NGHTTP API server (HTTP2)
smf_
http2_server
*
smf_
api_server_2
=
new
smf_http2_server
(
conv
::
toString
(
smf_cfg
.
sbi
.
addr4
),
smf_cfg
.
sbi_http2_port
,
smf_app_inst
);
smf_api_server_2
=
new
smf_http2_server
(
conv
::
toString
(
smf_cfg
.
sbi
.
addr4
),
smf_cfg
.
sbi_http2_port
,
smf_app_inst
);
//smf_api_server_2->start();
std
::
thread
smf_http2_manager
(
&
smf_http2_server
::
start
,
smf_api_server_2
);
smf_http1_manager
.
join
();
smf_http2_manager
.
join
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment