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
28902ab9
Commit
28902ab9
authored
Aug 20, 2021
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert VRT_l_* to "const char *, VCL_STRANDS" format.
parent
211c6960
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
38 deletions
+24
-38
cache_vrt_filter.c
bin/varnishd/cache/cache_vrt_filter.c
+3
-5
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+14
-25
generate.py
lib/libvcc/generate.py
+2
-3
vcc_action.c
lib/libvcc/vcc_action.c
+5
-5
No files found.
bin/varnishd/cache/cache_vrt_filter.c
View file @
28902ab9
...
...
@@ -406,15 +406,13 @@ resp_Get_Filter_List(struct req *req)
} \
\
VCL_VOID \
VRT_l_##vcl##_filters(VRT_CTX, const char *str,
...)
\
VRT_l_##vcl##_filters(VRT_CTX, const char *str,
VCL_STRANDS s)
\
{ \
va_list ap; \
const char *b; \
\
(void)str; \
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
va_start(ap, str); \
b = VRT_String(ctx->in->ws, NULL, str, ap); \
va_end(ap); \
b = VRT_StrandsWS(ctx->in->ws, str, s); \
if (b == NULL) \
WS_MarkOverflow(ctx->in->ws); \
else \
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
28902ab9
...
...
@@ -50,14 +50,14 @@ static char vrt_hostname[255] = "";
*/
static
void
vrt_do_str
ing
(
VRT_CTX
,
struct
http
*
hp
,
int
fld
,
const
char
*
err
,
const
char
*
p
,
va_list
ap
)
vrt_do_str
ands
(
VRT_CTX
,
struct
http
*
hp
,
int
fld
,
const
char
*
err
,
const
char
*
str
,
VCL_STRANDS
s
)
{
const
char
*
b
;
CHECK_OBJ_NOTNULL
(
hp
,
HTTP_MAGIC
);
b
=
VRT_Str
ing
(
hp
->
ws
,
NULL
,
p
,
ap
);
b
=
VRT_Str
andsWS
(
hp
->
ws
,
str
,
s
);
if
(
b
==
NULL
)
{
VRT_fail
(
ctx
,
"Workspace overflow (%s)"
,
err
);
WS_MarkOverflow
(
hp
->
ws
);
...
...
@@ -72,14 +72,11 @@ vrt_do_string(VRT_CTX, struct http *hp, int fld,
#define VRT_HDR_L(obj, hdr, fld) \
VCL_VOID \
VRT_l_##obj##_##hdr(VRT_CTX, const char *
p, ...)
\
VRT_l_##obj##_##hdr(VRT_CTX, const char *
str, VCL_STRANDS s)
\
{ \
va_list ap; \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
va_start(ap, p); \
vrt_do_string(ctx, ctx->http_##obj, fld, #obj "." #hdr, p, ap); \
va_end(ap); \
vrt_do_strands(ctx, ctx->http_##obj, fld, #obj "." #hdr, str, s); \
}
#define VRT_HDR_R(obj, hdr, fld) \
...
...
@@ -316,16 +313,13 @@ VRT_r_client_identity(VRT_CTX)
}
VCL_VOID
VRT_l_client_identity
(
VRT_CTX
,
const
char
*
str
,
...
)
VRT_l_client_identity
(
VRT_CTX
,
const
char
*
str
,
VCL_STRANDS
s
)
{
va_list
ap
;
const
char
*
b
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
req
,
REQ_MAGIC
);
va_start
(
ap
,
str
);
b
=
VRT_String
(
ctx
->
req
->
http
->
ws
,
NULL
,
str
,
ap
);
va_end
(
ap
);
b
=
VRT_StrandsWS
(
ctx
->
req
->
http
->
ws
,
str
,
s
);
if
(
b
==
NULL
)
{
VSLb
(
ctx
->
vsl
,
SLT_LostHeader
,
"client.identity"
);
WS_MarkOverflow
(
ctx
->
req
->
http
->
ws
);
...
...
@@ -441,24 +435,18 @@ VRT_r_beresp_storage_hint(VRT_CTX)
}
VCL_VOID
VRT_l_beresp_storage_hint
(
VRT_CTX
,
const
char
*
str
,
...
)
VRT_l_beresp_storage_hint
(
VRT_CTX
,
const
char
*
str
,
VCL_STRANDS
s
)
{
const
char
*
p
;
va_list
ap
;
uintptr_t
sn
;
VCL_STEVEDORE
stv
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
bo
,
BUSYOBJ_MAGIC
);
sn
=
WS_Snapshot
(
ctx
->
ws
);
va_start
(
ap
,
str
);
p
=
VRT_String
(
ctx
->
ws
,
NULL
,
str
,
ap
);
va_end
(
ap
);
p
=
VRT_StrandsWS
(
ctx
->
ws
,
str
,
s
);
if
(
p
==
NULL
)
{
VSLb
(
ctx
->
vsl
,
SLT_LostHeader
,
"storage_hint"
);
WS_Reset
(
ctx
->
ws
,
sn
);
WS_MarkOverflow
(
ctx
->
ws
);
return
;
}
...
...
@@ -466,8 +454,6 @@ VRT_l_beresp_storage_hint(VRT_CTX, const char *str, ...)
stv
=
VRT_stevedore
(
p
);
if
(
stv
!=
NULL
)
ctx
->
bo
->
storage
=
stv
;
WS_Reset
(
ctx
->
ws
,
sn
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -950,7 +936,8 @@ VRT_r_resp_do_esi(VRT_CTX)
#define VRT_BODY_L(which) \
VCL_VOID \
VRT_l_##which##_body(VRT_CTX, enum lbody_e type, VCL_STRANDS s) \
VRT_l_##which##_body(VRT_CTX, enum lbody_e type, \
const char *str, VCL_STRANDS s) \
{ \
int n; \
struct vsb *vsb; \
...
...
@@ -959,7 +946,9 @@ VRT_l_##which##_body(VRT_CTX, enum lbody_e type, VCL_STRANDS s) \
assert(type == LBODY_SET || type == LBODY_ADD); \
if (type == LBODY_SET) \
VSB_clear(vsb); \
for (n = 0; n < s->n; n++) \
if (str != NULL) \
VSB_cat(vsb, str); \
for (n = 0; s != NULL && n < s->n; n++) \
if (s->p[n] != NULL) \
VSB_cat(vsb, s->p[n]); \
}
...
...
lib/libvcc/generate.py
View file @
28902ab9
...
...
@@ -217,10 +217,9 @@ class vardef(object):
fo
.
write
(
'
\t
sym->lname = "VRT_l_
%
s(ctx, ";
\n
'
%
cnam
)
s
=
"void VRT_l_
%
s(VRT_CTX, "
%
cnam
if
self
.
typ
==
"STRING"
:
s
+=
ctyp
.
c
+
",
...
)"
s
+=
ctyp
.
c
+
",
VCL_STRANDS
)"
elif
self
.
typ
==
"BODY"
:
#s += "enum lbody_e, " + ctyp.c + ", VCL_STRANDS)"
s
+=
"enum lbody_e, VCL_STRANDS)"
s
+=
"enum lbody_e, "
+
ctyp
.
c
+
", VCL_STRANDS)"
else
:
s
+=
"VCL_"
+
self
.
typ
+
")"
varproto
(
s
)
...
...
lib/libvcc/vcc_action.c
View file @
28902ab9
...
...
@@ -117,12 +117,12 @@ static const struct assign {
{
DURATION
,
T_DIV
,
REAL
,
"
\v
/ "
},
{
DURATION
,
'='
,
DURATION
},
{
DURATION
,
0
,
DURATION
},
{
STRING
,
T_INCR
,
STR
ING_LIST
,
"
\v
,
\n
"
},
{
STRING
,
'='
,
STR
ING_LIST
},
{
STRING
,
T_INCR
,
STR
ANDS
,
"
\v
,
\n
"
},
{
STRING
,
'='
,
STR
ANDS
,
"0,
\n
"
},
{
HEADER
,
T_INCR
,
STRANDS
,
"VRT_GetHdr(ctx,
\v
),
\n
"
},
{
HEADER
,
'='
,
STRANDS
,
"
NULL
,
\n
"
},
{
BODY
,
'='
,
STRANDS
,
"LBODY_SET,
\n
"
},
{
BODY
,
T_INCR
,
STRANDS
,
"LBODY_ADD,
\n
"
},
{
HEADER
,
'='
,
STRANDS
,
"
0
,
\n
"
},
{
BODY
,
'='
,
STRANDS
,
"LBODY_SET,
0,
\n
"
},
{
BODY
,
T_INCR
,
STRANDS
,
"LBODY_ADD,
0,
\n
"
},
{
VOID
,
'='
,
VOID
}
};
...
...
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