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
ff2647b2
Commit
ff2647b2
authored
Oct 17, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't do conditional processing for hit-for-pass objects.
Fixes #1206 Found & Fixed by: DocWilco
parent
881ebc72
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
1 deletion
+52
-1
cache_response.c
bin/varnishd/cache/cache_response.c
+4
-1
r01206.vtc
bin/varnishtest/tests/r01206.vtc
+48
-0
No files found.
bin/varnishd/cache/cache_response.c
View file @
ff2647b2
...
...
@@ -108,6 +108,7 @@ RES_BuildHttp(struct req *req)
char
time_str
[
30
];
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
obj
,
OBJECT_MAGIC
);
http_ClrHeader
(
req
->
resp
);
http_FilterResp
(
req
->
obj
->
http
,
req
->
resp
,
0
);
...
...
@@ -122,7 +123,9 @@ RES_BuildHttp(struct req *req)
if
(
req
->
res_mode
&
RES_GUNZIP
)
http_Unset
(
req
->
resp
,
H_Content_Encoding
);
if
(
req
->
obj
->
response
==
200
if
(
req
->
obj
->
objcore
!=
NULL
&&
!
(
req
->
obj
->
objcore
->
flags
&
OC_F_PASS
)
&&
req
->
obj
->
response
==
200
&&
req
->
http
->
conds
&&
RFC2616_Do_Cond
(
req
))
{
req
->
wantbody
=
0
;
http_SetResp
(
req
->
resp
,
"HTTP/1.1"
,
304
,
"Not Modified"
);
...
...
bin/varnishtest/tests/r01206.vtc
0 → 100644
View file @
ff2647b2
varnishtest "Pass shouldn't honor IMS/INM if the backend doesn't"
server s1 {
rxreq
txresp -bodylen 6
rxreq
txresp -hdr "ETag: 123456789" \
-bodylen 7
rxreq
txresp -hdr "Last-Modified: Thu, 26 Jun 2008 12:00:01 GMT" \
-bodylen 8
} -start
varnish v1 -vcl+backend {
sub vcl_recv {
return(pass);
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.bodylen == 6
txreq -hdr "If-None-Match: 123456789"
rxresp
expect resp.status == 200
expect resp.bodylen == 7
txreq -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT"
rxresp
expect resp.status == 200
expect resp.bodylen == 8
} -run
server s1 -start
varnish v1 -vcl+backend {
sub vcl_fetch {
set beresp.do_pass = true;
}
}
client c1 -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