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
a7b80c7c
Unverified
Commit
a7b80c7c
authored
Mar 13, 2019
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't assume input buffer is valid after the call
Patch by @phk, test by yours truly.
parent
e4941d2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
8 deletions
+30
-8
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+5
-8
e00032.vtc
bin/varnishtest/tests/e00032.vtc
+25
-0
No files found.
bin/varnishd/cache/cache_esi_deliver.c
View file @
a7b80c7c
...
...
@@ -537,7 +537,7 @@ ved_pretend_gzip_bytes(struct req *req, enum vdp_action act, void **priv,
l
-=
lx
;
p
+=
lx
;
}
/* buf2 is local, have to flush */
/* buf
1 & buf
2 is local, have to flush */
return
(
ved_bytes
(
req
,
ecx
,
VDP_FLUSH
,
NULL
,
0
));
}
...
...
@@ -609,8 +609,6 @@ ved_gzgz_bytes(struct req *req, enum vdp_action act, void **priv,
ssize_t
l
;
CAST_OBJ_NOTNULL
(
foo
,
*
priv
,
VED_FOO_MAGIC
);
(
void
)
req
;
(
void
)
act
;
pp
=
ptr
;
if
(
len
>
0
)
{
/* Skip over the GZIP header */
...
...
@@ -630,7 +628,7 @@ ved_gzgz_bytes(struct req *req, enum vdp_action act, void **priv,
if
(
dl
>
0
)
{
if
(
dl
>
len
)
dl
=
len
;
if
(
ved_bytes
(
req
,
foo
->
ecx
,
VDP_NULL
,
pp
,
dl
))
if
(
ved_bytes
(
req
,
foo
->
ecx
,
act
,
pp
,
dl
))
return
(
-
1
);
foo
->
ll
+=
dl
;
len
-=
dl
;
...
...
@@ -641,7 +639,7 @@ ved_gzgz_bytes(struct req *req, enum vdp_action act, void **priv,
/* Remove the "LAST" bit */
foo
->
dbits
[
0
]
=
*
pp
;
foo
->
dbits
[
0
]
&=
~
(
1U
<<
(
foo
->
last
&
7
));
if
(
ved_bytes
(
req
,
foo
->
ecx
,
VDP_NULL
,
foo
->
dbits
,
1
))
if
(
ved_bytes
(
req
,
foo
->
ecx
,
act
,
foo
->
dbits
,
1
))
return
(
-
1
);
foo
->
ll
++
;
len
--
;
...
...
@@ -653,7 +651,7 @@ ved_gzgz_bytes(struct req *req, enum vdp_action act, void **priv,
if
(
dl
>
0
)
{
if
(
dl
>
len
)
dl
=
len
;
if
(
ved_bytes
(
req
,
foo
->
ecx
,
VDP_NULL
,
pp
,
dl
))
if
(
ved_bytes
(
req
,
foo
->
ecx
,
act
,
pp
,
dl
))
return
(
-
1
);
foo
->
ll
+=
dl
;
len
-=
dl
;
...
...
@@ -715,8 +713,7 @@ ved_gzgz_bytes(struct req *req, enum vdp_action act, void **priv,
default:
WRONG
(
"compiler must be broken"
);
}
if
(
ved_bytes
(
req
,
foo
->
ecx
,
VDP_NULL
,
foo
->
dbits
+
1
,
foo
->
lpad
))
if
(
ved_bytes
(
req
,
foo
->
ecx
,
act
,
foo
->
dbits
+
1
,
foo
->
lpad
))
return
(
-
1
);
}
if
(
len
>
0
)
{
...
...
bin/varnishtest/tests/e00032.vtc
0 → 100644
View file @
a7b80c7c
varnishtest "Exercise ESI+gzip in pass mode"
server s1 {
rxreq
txresp -gzipbody {<esi:include src="/foo"/>}
rxreq
txresp -gzipbody "foo"
} -start
varnish v1 -vcl+backend {
sub vcl_recv {
return (pass);
}
sub vcl_backend_response {
set beresp.do_esi = true;
}
} -start
client c1 {
txreq -hdr "Accept-Encoding: gzip"
rxresp
expect resp.status == 200
gunzip
expect resp.bodylen == 3
} -run
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