Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
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
lizhongxiao
OpenXG-RAN
Commits
9dbcab30
Commit
9dbcab30
authored
Apr 07, 2022
by
frtabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
json boolean fix
parent
24e87814
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
common/utils/websrv/websrv.c
common/utils/websrv/websrv.c
+5
-6
No files found.
common/utils/websrv/websrv.c
View file @
9dbcab30
...
...
@@ -280,10 +280,10 @@ int websrv_callback_get_softmodemvar(const struct _u_request * request, struct _
for
(
int
j
=
0
;
modulestruct
->
var
[
j
].
varvalptr
!=
NULL
;
j
++
)
{
char
*
strval
=
telnet_getvarvalue
(
modulestruct
->
var
,
j
);
char
*
strbool
=
"true"
;
int
modifiable
=
1
;
if
(
modulestruct
->
var
[
j
].
checkval
&
TELNET_CHECKVAL_RDONLY
)
strbool
=
"false"
;
json_t
*
oneaction
=
json_pack
(
"{s:s,s:s,s:s,s:
s}"
,
"type"
,
"string"
,
"name"
,
modulestruct
->
var
[
j
].
varname
,
"value"
,
strval
,
"modifiable"
,
strbool
);
modifiable
=
0
;
json_t
*
oneaction
=
json_pack
(
"{s:s,s:s,s:s,s:
b}"
,
"type"
,
"string"
,
"name"
,
modulestruct
->
var
[
j
].
varname
,
"value"
,
strval
,
"modifiable"
,
modifiable
);
if
(
oneaction
==
NULL
)
{
LOG_E
(
UTIL
,
"[websrv] cannot encode oneaction %s/%s
\n
"
,
modulestruct
->
module
,
modulestruct
->
var
[
j
].
varname
);
}
else
{
...
...
@@ -370,17 +370,16 @@ int websrv_callback_get_softmodemmodules(const struct _u_request * request, stru
int
websrv_callback_get_softmodemstatus
(
const
struct
_u_request
*
request
,
struct
_u_response
*
response
,
void
*
user_data
)
{
char
*
cfgfile
=
CONFIG_GETCONFFILE
;
char
*
execfunc
=
get_softmodem_function
(
NULL
);
char
*
strbool
=
"false"
;
char
*
strtype
=
"string"
;
json_t
*
moduleactions
=
json_array
();
json_t
*
body1
=
json_pack
(
"{s:s,s:s,s:s,s:
s}"
,
"name"
,
"config_file"
,
"value"
,
cfgfile
,
"type"
,
strtype
,
"modifiable"
,
strbool
);
json_t
*
body1
=
json_pack
(
"{s:s,s:s,s:s,s:
b}"
,
"name"
,
"config_file"
,
"value"
,
cfgfile
,
"type"
,
strtype
,
"modifiable"
,
0
);
if
(
body1
==
NULL
)
{
LOG_E
(
UTIL
,
"[websrv] cannot encode status body1 response
\n
"
);
}
else
{
websrv_printjson
(
"status body1"
,
body1
);
}
json_t
*
body2
=
json_pack
(
"{s:s,s:s,s:s,s:
s}"
,
"name"
,
"exec_function"
,
"value"
,
execfunc
,
"type"
,
strtype
,
"modifiable"
,
strbool
);
json_t
*
body2
=
json_pack
(
"{s:s,s:s,s:s,s:
b}"
,
"name"
,
"exec_function"
,
"value"
,
execfunc
,
"type"
,
strtype
,
"modifiable"
,
0
);
if
(
body2
==
NULL
)
{
LOG_E
(
UTIL
,
"[websrv] cannot encode status body1 response
\n
"
);
}
else
{
...
...
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