Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
0474080d
Commit
0474080d
authored
Jun 28, 2022
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polishing VMOD JSON handling
parent
892264e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
vcc_vmod.c
lib/libvcc/vcc_vmod.c
+4
-4
vmodtool.py
lib/libvcc/vmodtool.py
+2
-2
No files found.
lib/libvcc/vcc_vmod.c
View file @
0474080d
...
...
@@ -77,7 +77,7 @@ static int
vcc_path_open
(
void
*
priv
,
const
char
*
fn
)
{
struct
vmod_import
*
vim
;
const
char
*
magic
=
"VMOD_JSON_SPEC
\x0
3
"
,
*
p
;
const
char
*
magic
=
"VMOD_JSON_SPEC
\x0
2
"
,
*
p
;
int
c
;
FILE
*
f
;
...
...
@@ -114,10 +114,10 @@ vcc_path_open(void *priv, const char *fn)
c
=
getc
(
f
);
if
(
c
==
EOF
)
{
AZ
(
fclose
(
f
));
vim
->
err
=
"
No VMOD JSON found
"
;
vim
->
err
=
"
Truncated VMOD JSON
"
;
return
(
-
1
);
}
if
(
c
==
'\
0
'
)
if
(
c
==
'\
x03
'
)
break
;
VSB_putc
(
vim
->
json
,
c
);
}
...
...
@@ -442,7 +442,7 @@ vcc_ParseImport(struct vcc *tl)
"Could not open VMOD %.*s
\n
"
,
PF
(
mod
));
VSB_printf
(
tl
->
sb
,
"
\t
File name: %s
\n
"
,
vim
->
path
!=
NULL
?
vim
->
path
:
fn
);
VSB_printf
(
tl
->
sb
,
"
\t
dle
rror: %s
\n
"
,
vim
->
err
);
VSB_printf
(
tl
->
sb
,
"
\t
E
rror: %s
\n
"
,
vim
->
err
);
}
vcc_ErrWhere
(
tl
,
mod
);
vcc_vim_destroy
(
&
vim
);
...
...
lib/libvcc/vmodtool.py
View file @
0474080d
...
...
@@ -1105,7 +1105,7 @@ class vcc(object):
def
json
(
self
,
fo
,
fnx
):
fo
.
write
(
'#define STRINGIFY(arg) #arg
\n
'
)
fo
.
write
(
"
\n
static const char Vmod_Json[] = {
\n
"
)
fo
.
write
(
'
\t
"VMOD_JSON_SPEC
\
\
x03
"
\n
'
)
fo
.
write
(
'
\t
"VMOD_JSON_SPEC
\
x02
"
\n
'
)
for
n
,
i
in
enumerate
(
self
.
iter_json
(
fnx
)):
fo
.
write
(
'
\t
"'
)
...
...
@@ -1121,7 +1121,7 @@ class vcc(object):
fo
.
write
(
'
\t
STRINGIFY(
%
s)
\n
'
%
self
.
vrt_minor
)
else
:
fo
.
write
(
'"
\n
'
)
fo
.
write
(
'
\t\"\\
n
\"\n
};
\n
'
)
fo
.
write
(
'
\t\"\\
n
\
\
x03
\
"\n
};
\n
'
)
fo
.
write
(
'#undef STRINGIFY
\n
'
)
...
...
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