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
476f14bb
Commit
476f14bb
authored
Jun 03, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor update for SBI
parent
a064ebd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/smf_app/smf_sbi.cpp
src/smf_app/smf_sbi.cpp
+7
-7
No files found.
src/smf_app/smf_sbi.cpp
View file @
476f14bb
...
@@ -681,7 +681,6 @@ CURL* smf_sbi::curl_create_handle(
...
@@ -681,7 +681,6 @@ CURL* smf_sbi::curl_create_handle(
Logger
::
smf_sbi
().
debug
(
"Send notification to NF with URI: %s"
,
url
);
Logger
::
smf_sbi
().
debug
(
"Send notification to NF with URI: %s"
,
url
);
curl_easy_setopt
(
curl
,
CURLOPT_HTTPHEADER
,
headers
);
curl_easy_setopt
(
curl
,
CURLOPT_HTTPHEADER
,
headers
);
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
url
.
c_str
());
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
url
.
c_str
());
// curl_easy_setopt(curl, CURLOPT_PRIVATE, str);
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
curl_easy_setopt
(
curl
,
CURLOPT_HTTPGET
,
1
);
curl_easy_setopt
(
curl
,
CURLOPT_HTTPGET
,
1
);
curl_easy_setopt
(
curl
,
CURLOPT_TIMEOUT_MS
,
100L
);
curl_easy_setopt
(
curl
,
CURLOPT_TIMEOUT_MS
,
100L
);
...
@@ -1177,7 +1176,6 @@ CURL* smf_sbi::curl_create_handle(
...
@@ -1177,7 +1176,6 @@ CURL* smf_sbi::curl_create_handle(
if
(
curl
)
{
if
(
curl
)
{
curl_easy_setopt
(
curl
,
CURLOPT_HTTPHEADER
,
headers
);
curl_easy_setopt
(
curl
,
CURLOPT_HTTPHEADER
,
headers
);
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
uri
.
c_str
());
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
uri
.
c_str
());
// curl_easy_setopt(curl, CURLOPT_PRIVATE, str);
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
curl_easy_setopt
(
curl
,
CURLOPT_HTTPGET
,
1
);
curl_easy_setopt
(
curl
,
CURLOPT_HTTPGET
,
1
);
curl_easy_setopt
(
curl
,
CURLOPT_TIMEOUT_MS
,
NF_CURL_TIMEOUT_MS
);
curl_easy_setopt
(
curl
,
CURLOPT_TIMEOUT_MS
,
NF_CURL_TIMEOUT_MS
);
...
@@ -1326,11 +1324,15 @@ void smf_sbi::send_n1n2_message_transfer_request_curl_multi(
...
@@ -1326,11 +1324,15 @@ void smf_sbi::send_n1n2_message_transfer_request_curl_multi(
Logger
::
smf_sbi
().
debug
(
Logger
::
smf_sbi
().
debug
(
"Send Communication_N1N2MessageTransfer to AMF, body %s"
,
body
.
c_str
());
"Send Communication_N1N2MessageTransfer to AMF, body %s"
,
body
.
c_str
());
uint32_t
str_len
=
body
.
length
();
uint32_t
str_len
=
body
.
length
();
char
*
data
=
(
char
*
)
malloc
(
str_len
+
1
);
char
data_str
[
str_len
+
1
]
=
{};
char
*
data
=
(
char
*
)
malloc
(
str_len
+
1
);
memset
(
data
,
0
,
str_len
+
1
);
memset
(
data
,
0
,
str_len
+
1
);
memcpy
((
void
*
)
data
,
(
void
*
)
body
.
c_str
(),
str_len
);
memcpy
((
void
*
)
data
,
(
void
*
)
body
.
c_str
(),
str_len
);
body
.
copy
(
data_str
,
str_len
);
data_str
[
str_len
]
=
'\0'
;
std
::
string
response_data
;
std
::
string
response_data
;
// send_curl_multi(sm_context_res->res.get_amf_url(), body, response_data);
// send_curl_multi(sm_context_res->res.get_amf_url(), body, response_data);
...
@@ -1341,15 +1343,13 @@ void smf_sbi::send_n1n2_message_transfer_request_curl_multi(
...
@@ -1341,15 +1343,13 @@ void smf_sbi::send_n1n2_message_transfer_request_curl_multi(
curl_multi_add_handle
(
curl_multi
,
tmp
);
curl_multi_add_handle
(
curl_multi
,
tmp
);
handles
.
push_back
(
tmp
);
handles
.
push_back
(
tmp
);
// Create and store the promise
boost
::
shared_ptr
<
boost
::
promise
<
uint32_t
>>
p
=
boost
::
shared_ptr
<
boost
::
promise
<
uint32_t
>>
p
=
boost
::
make_shared
<
boost
::
promise
<
uint32_t
>>
();
boost
::
make_shared
<
boost
::
promise
<
uint32_t
>>
();
boost
::
shared_future
<
uint32_t
>
f
;
boost
::
shared_future
<
uint32_t
>
f
;
f
=
p
->
get_future
();
f
=
p
->
get_future
();
// Generate ID for this promise (to be used in SMF-APP)
// uint32_t promise_id = 1; // generate_promise_id();
// Logger::smf_sbi().debug("Promise ID generated %d", promise_id);
add_promise
(
sm_context_res
->
res
.
get_amf_url
(),
p
);
add_promise
(
sm_context_res
->
res
.
get_amf_url
(),
p
);
perform_curl_multi
(
perform_curl_multi
(
...
...
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