Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
25c5f2ed
Commit
25c5f2ed
authored
Mar 07, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move more policy stuff to rfc2616.c
parent
85594125
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
20 deletions
+16
-20
cache_center.c
bin/varnishd/cache_center.c
+0
-18
rfc2616.c
bin/varnishd/rfc2616.c
+16
-2
No files found.
bin/varnishd/cache_center.c
View file @
25c5f2ed
...
...
@@ -530,24 +530,6 @@ cnt_fetch(struct sess *sp)
EXP_Clr
(
&
sp
->
wrk
->
exp
);
sp
->
wrk
->
exp
.
ttl
=
RFC2616_Ttl
(
sp
);
/*
* Initial cacheability determination per [RFC2616, 13.4]
* We do not support ranges yet, so 206 is out.
*/
switch
(
sp
->
err_code
)
{
case
200
:
/* OK */
case
203
:
/* Non-Authoritative Information */
case
300
:
/* Multiple Choices */
case
301
:
/* Moved Permanently */
case
302
:
/* Moved Temporarily */
case
410
:
/* Gone */
case
404
:
/* Not Found */
break
;
default:
sp
->
wrk
->
exp
.
ttl
=
-
1
.;
break
;
}
/* pass from vclrecv{} has negative TTL */
if
(
sp
->
objcore
==
NULL
)
sp
->
wrk
->
exp
.
ttl
=
-
1
.;
...
...
bin/varnishd/rfc2616.c
View file @
25c5f2ed
...
...
@@ -87,8 +87,22 @@ RFC2616_Ttl(const struct sess *sp)
h_expires
=
0
;
h_date
=
0
;
do
{
/* Allows us to break when we want out */
/*
* Initial cacheability determination per [RFC2616, 13.4]
* We do not support ranges yet, so 206 is out.
*/
switch
(
sp
->
err_code
)
{
default
:
sp
->
wrk
->
exp
.
ttl
=
-
1
.;
break
;
case
200
:
/* OK */
case
203
:
/* Non-Authoritative Information */
case
300
:
/* Multiple Choices */
case
301
:
/* Moved Permanently */
case
302
:
/* Moved Temporarily */
case
410
:
/* Gone */
case
404
:
/* Not Found */
/*
* First find any relative specification from the backend
* These take precedence according to RFC2616, 13.2.4
...
...
@@ -150,7 +164,7 @@ RFC2616_Ttl(const struct sess *sp)
ttl
=
(
int
)(
h_expires
-
h_date
);
}
}
while
(
0
);
}
/* calculated TTL, Our time, Date, Expires, max-age, age */
WSP
(
sp
,
SLT_TTL
,
"%u RFC %g %g %g %g %u %u"
,
sp
->
xid
,
...
...
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