Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AUSF
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-AUSF
Commits
4b299810
Commit
4b299810
authored
Jun 28, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove hardcoded value for http response code
parent
6faa7cb6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
src/ausf_app/ausf_client.cpp
src/ausf_app/ausf_client.cpp
+3
-3
src/ausf_app/ausf_config.cpp
src/ausf_app/ausf_config.cpp
+1
-1
src/common/ausf.h
src/common/ausf.h
+27
-0
No files found.
src/ausf_app/ausf_client.cpp
View file @
4b299810
...
...
@@ -138,8 +138,9 @@ void ausf_client::curl_http_client(
nlohmann
::
json
response_data
=
{};
if
(
httpCode
!=
200
&&
httpCode
!=
201
&&
httpCode
!=
204
)
{
// TODO: remove hardcoded values
if
(
httpCode
!=
HTTP_RESPONSE_CODE_OK
&&
httpCode
!=
HTTP_RESPONSE_CODE_CREATED
&&
httpCode
!=
HTTP_RESPONSE_CODE_NO_CONTENT
)
{
is_response_ok
=
false
;
if
(
response
.
size
()
<
1
)
{
Logger
::
ausf_app
().
info
(
"There's no content in the response"
);
...
...
@@ -176,6 +177,5 @@ void ausf_client::curl_http_client(
free
(
body_data
);
body_data
=
NULL
;
}
// fflush(stdout);
return
;
}
src/ausf_app/ausf_config.cpp
View file @
4b299810
...
...
@@ -55,7 +55,7 @@ using namespace libconfig;
namespace
config
{
//------------------------------------------------------------------------------
ausf_config
::
ausf_config
()
:
sbi
()
{
ausf_config
::
ausf_config
()
:
sbi
()
,
ausf_name
(),
pid_dir
(),
instance
()
{
udm_addr
.
ipv4_addr
.
s_addr
=
INADDR_ANY
;
udm_addr
.
port
=
80
;
udm_addr
.
api_version
=
"v1"
;
...
...
src/common/ausf.h
View file @
4b299810
...
...
@@ -83,4 +83,31 @@ typedef struct {
typedef
uint64_t
supi64_t
;
// 3GPP TS 29.571 (Common data)
enum
http_response_codes_e
{
HTTP_RESPONSE_CODE_OK
=
200
,
HTTP_RESPONSE_CODE_CREATED
=
201
,
HTTP_RESPONSE_CODE_ACCEPTED
=
202
,
HTTP_RESPONSE_CODE_NO_CONTENT
=
204
,
HTTP_RESPONSE_CODE_BAD_REQUEST
=
400
,
HTTP_RESPONSE_CODE_UNAUTHORIZED
=
401
,
HTTP_RESPONSE_CODE_FORBIDDEN
=
403
,
HTTP_RESPONSE_CODE_NOT_FOUND
=
404
,
HTTP_RESPONSE_CODE_METHOD_NOT_ALLOWED
=
405
,
HTTP_RESPONSE_CODE_REQUEST_TIMEOUT
=
408
,
HTTP_RESPONSE_CODE_406_NOT_ACCEPTED
=
406
,
HTTP_RESPONSE_CODE_CONFLICT
=
409
,
HTTP_RESPONSE_CODE_GONE
=
410
,
HTTP_RESPONSE_CODE_LENGTH_REQUIRED
=
411
,
HTTP_RESPONSE_CODE_PRECONDITION_FAILED
=
412
,
HTTP_RESPONSE_CODE_PAYLOAD_TOO_LARGE
=
413
,
HTTP_RESPONSE_CODE_URI_TOO_LONG
=
414
,
HTTP_RESPONSE_CODE_UNSUPPORTED_MEDIA_TYPE
=
415
,
HTTP_RESPONSE_CODE_TOO_MANY_REQUESTS
=
429
,
HTTP_RESPONSE_CODE_INTERNAL_SERVER_ERROR
=
500
,
HTTP_RESPONSE_CODE_NOT_IMPLEMENTED
=
501
,
HTTP_RESPONSE_CODE_SERVICE_UNAVAILABLE
=
503
,
HTTP_RESPONSE_CODE_GATEWAY_TIMEOUT
=
504
};
#endif
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