Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
ae140082
Commit
ae140082
authored
Nov 07, 2011
by
Tollef Fog Heen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify json callback
parent
ac387cf0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
varnishstat.c
bin/varnishstat/varnishstat.c
+6
-12
No files found.
bin/varnishstat/varnishstat.c
View file @
ae140082
...
...
@@ -90,8 +90,6 @@ do_json_cb(void *priv, const struct VSC_point * const pt)
{
uint64_t
val
;
int
*
jp
;
char
jsonkey
[
255
];
char
jsontmp
[
255
];
jp
=
priv
;
...
...
@@ -99,18 +97,14 @@ do_json_cb(void *priv, const struct VSC_point * const pt)
val
=
*
(
const
volatile
uint64_t
*
)
pt
->
ptr
;
if
(
*
jp
)
*
jp
=
0
;
else
printf
(
",
\n
"
);
jsonkey
[
0
]
=
'\0'
;
printf
(
"
\t\"
"
);
/* build the JSON key name. */
if
(
strcmp
(
pt
->
ident
,
""
)
&&
strcmp
(
pt
->
class
,
""
))
sprintf
(
jsonkey
,
"%s.%s"
,
pt
->
class
,
pt
->
ident
);
if
(
strcmp
(
pt
->
ident
,
""
)
&&
!
strcmp
(
pt
->
class
,
""
))
sprintf
(
jsonkey
,
"%s"
,
pt
->
ident
);
if
(
!
strcmp
(
pt
->
ident
,
""
)
&&
strcmp
(
pt
->
class
,
""
))
sprintf
(
jsonkey
,
"%s"
,
pt
->
class
);
strcpy
(
jsontmp
,
jsonkey
);
if
(
strcmp
(
jsonkey
,
""
))
sprintf
(
jsonkey
,
"%s.%s"
,
jsontmp
,
pt
->
name
);
else
strcpy
(
jsonkey
,
pt
->
name
);
printf
(
"
\t\"
%s
\"
: {"
,
jsonkey
);
if
(
pt
->
class
[
0
])
printf
(
"%s."
,
pt
->
class
);
if
(
pt
->
ident
[
0
])
printf
(
"%s."
,
pt
->
ident
);
printf
(
"%s
\"
: {"
,
pt
->
name
);
if
(
strcmp
(
pt
->
class
,
""
))
printf
(
"
\"
type
\"
:
\"
%s
\"
, "
,
pt
->
class
);
if
(
strcmp
(
pt
->
ident
,
""
))
printf
(
"
\"
ident
\"
:
\"
%s
\"
, "
,
pt
->
ident
);
...
...
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