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
e88f87b4
Commit
e88f87b4
authored
Sep 24, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polishing
parent
9ba9a8bb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
37 deletions
+18
-37
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_backend.h
bin/varnishd/cache/cache_backend.h
+11
-33
cache_dir.c
bin/varnishd/cache/cache_dir.c
+2
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+4
-2
No files found.
bin/varnishd/cache/cache.h
View file @
e88f87b4
...
...
@@ -695,7 +695,7 @@ void VCA_FailSess(struct worker *w);
void
VBE_UseHealth
(
const
struct
director
*
vdi
);
void
VBE_DiscardHealth
(
const
struct
director
*
vdi
);
/* cache_dir.c */
int
VDI_GetHdr
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
);
struct
vbc
*
VDI_GetFd
(
const
struct
director
*
d
,
struct
worker
*
wrk
,
struct
busyobj
*
);
...
...
bin/varnishd/cache/cache_backend.h
View file @
e88f87b4
...
...
@@ -26,43 +26,21 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This is the central switch-board for backend connections and it is
* slightly complicated by a number of optimizations.
* Backend and Director APIs
*
* The data structures:
* A director ("VDI") is an abstract entity which can either satisfy a
* backend fetch request or select another director for the job.
*
* A vrt_backend is a definition of a backend in a VCL program.
* In theory a director does not have to talk HTTP over TCP, it can satisfy
* the backend request using any means it wants, although this is presently
* not implemented.
*
* A backend is a TCP destination, possibly multi-homed and it has a
* number of associated properties and statistics.
* A backend ("VBE") is a director which talks HTTP over TCP.
*
* A vbc is an open TCP connection to a backend.
*
* A bereq is a memory carrier for handling a HTTP transaction with
* a backend over a vbc.
*
* A director is a piece of code that selects which backend to use,
* by whatever method or metric it chooses.
*
* The relationships:
*
* Backends and directors get instantiated when VCL's are loaded,
* and this always happen in the CLI thread.
*
* When a VCL tries to instantiate a backend, any existing backend
* with the same identity (== definition in VCL) will be used instead
* so that vbc's can be reused across VCL changes.
*
* Directors disapper with the VCL that created them.
*
* Backends disappear when their reference count drop to zero.
*
* Backends have their host/port name looked up to addrinfo structures
* when they are instantiated, and we just cache that result and cycle
* through the entries (for multihomed backends) on failure only.
* XXX: add cli command to redo lookup.
*
* bereq is sort of a step-child here, we just manage the pool of them.
* As you'll notice the terminology is a bit muddled here, but we try to
* keep it clean on the user-facing side, where a "director" is always
* a "pick a backend/director" functionality, and a "backend" is whatever
* satisfies the actual request in the end.
*
*/
...
...
bin/varnishd/cache/cache_dir.c
View file @
e88f87b4
...
...
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*
Handle backend connections and backend request structures.
*
Abstract backend API
*
*/
...
...
@@ -161,5 +161,6 @@ VDI_Healthy(const struct director *d)
{
CHECK_OBJ_NOTNULL
(
d
,
DIRECTOR_MAGIC
);
AN
(
d
->
healthy
);
return
(
d
->
healthy
(
d
,
NULL
));
}
bin/varnishd/cache/cache_fetch.c
View file @
e88f87b4
...
...
@@ -133,7 +133,8 @@ vbf_beresp2obj(struct busyobj *bo)
return
(
-
1
);
if
(
vary
!=
NULL
)
{
b
=
ObjSetattr
(
bo
->
wrk
,
bo
->
fetch_objcore
,
OA_VARY
,
varyl
,
VSB_data
(
vary
));
b
=
ObjSetattr
(
bo
->
wrk
,
bo
->
fetch_objcore
,
OA_VARY
,
varyl
,
VSB_data
(
vary
));
VSB_delete
(
vary
);
}
...
...
@@ -149,7 +150,8 @@ vbf_beresp2obj(struct busyobj *bo)
bo
->
uncacheable
?
HTTPH_R_PASS
:
HTTPH_A_INS
);
if
(
http_GetHdr
(
bo
->
beresp
,
H_Last_Modified
,
&
b
))
AZ
(
ObjSetDouble
(
bo
->
wrk
,
bo
->
fetch_objcore
,
OA_LASTMODIFIED
,
VTIM_parse
(
b
)));
AZ
(
ObjSetDouble
(
bo
->
wrk
,
bo
->
fetch_objcore
,
OA_LASTMODIFIED
,
VTIM_parse
(
b
)));
else
AZ
(
ObjSetDouble
(
bo
->
wrk
,
bo
->
fetch_objcore
,
OA_LASTMODIFIED
,
floor
(
bo
->
fetch_objcore
->
exp
.
t_origin
)));
...
...
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