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
c2a51235
Commit
c2a51235
authored
Feb 10, 2020
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it possible to get the length from WS_VSB_finish() (ie: H2 headers).
parent
4454f75d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+1
-1
cache_ws.c
bin/varnishd/cache/cache_ws.c
+6
-2
No files found.
bin/varnishd/cache/cache.h
View file @
c2a51235
...
...
@@ -796,7 +796,7 @@ int WS_Inside(const struct ws *, const void *, const void *);
void
WS_Assert_Allocated
(
const
struct
ws
*
ws
,
const
void
*
ptr
,
ssize_t
len
);
void
WS_VSB_new
(
struct
vsb
*
,
struct
ws
*
);
char
*
WS_VSB_finish
(
struct
vsb
*
,
struct
ws
*
);
char
*
WS_VSB_finish
(
struct
vsb
*
,
struct
ws
*
,
size_t
*
);
static
inline
char
*
WS_Front
(
const
struct
ws
*
ws
)
...
...
bin/varnishd/cache/cache_vrt.c
View file @
c2a51235
...
...
@@ -474,7 +474,7 @@ VRT_StrandsWS(struct ws *ws, const char *h, VCL_STRANDS s)
if
(
s
->
p
[
i
]
!=
NULL
&&
*
s
->
p
[
i
]
!=
'\0'
)
VSB_cat
(
vsb
,
s
->
p
[
i
]);
}
return
(
WS_VSB_finish
(
vsb
,
ws
));
return
(
WS_VSB_finish
(
vsb
,
ws
,
NULL
));
}
/*--------------------------------------------------------------------
...
...
bin/varnishd/cache/cache_ws.c
View file @
c2a51235
...
...
@@ -352,7 +352,7 @@ WS_Overflowed(const struct ws *ws)
*
* WS_VSB_new(vsb, ctx->ws);
* VSB_printf(vsb, "blablabla");
* p = WS_VSB_finish(vsb);
* p = WS_VSB_finish(vsb
, NULL
);
* if (p == NULL)
* return (FAILURE);
*/
...
...
@@ -375,7 +375,7 @@ WS_VSB_new(struct vsb *vsb, struct ws *ws)
}
char
*
WS_VSB_finish
(
struct
vsb
*
vsb
,
struct
ws
*
ws
)
WS_VSB_finish
(
struct
vsb
*
vsb
,
struct
ws
*
ws
,
size_t
*
szp
)
{
char
*
p
;
...
...
@@ -384,11 +384,15 @@ WS_VSB_finish(struct vsb *vsb, struct ws *ws)
p
=
VSB_data
(
vsb
);
if
(
p
==
WS_Front
(
ws
))
{
WS_Release
(
ws
,
VSB_len
(
vsb
)
+
1
);
if
(
szp
!=
NULL
)
*
szp
=
VSB_len
(
vsb
);
VSB_delete
(
vsb
);
return
(
p
);
}
}
VSB_delete
(
vsb
);
WS_Release
(
ws
,
0
);
if
(
szp
)
*
szp
=
0
;
return
(
NULL
);
}
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