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
4376215b
Commit
4376215b
authored
Sep 26, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Morph VDI_Healthy() into VRT_Healthy() and move the rest of the
VDI_ functions out of $ABI VRT.
parent
52b51aa1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
31 deletions
+28
-31
cache_director.c
bin/varnishd/cache/cache_director.c
+9
-4
cache_director.h
bin/varnishd/cache/cache_director.h
+0
-21
cache_priv.h
bin/varnishd/cache/cache_priv.h
+8
-0
vrt.h
include/vrt.h
+9
-2
vmod_std.c
lib/libvmod_std/vmod_std.c
+2
-4
No files found.
bin/varnishd/cache/cache_director.c
View file @
4376215b
...
...
@@ -39,6 +39,8 @@
#include "cache_director.h"
#include "vrt.h"
/* Resolve director --------------------------------------------------*/
static
const
struct
director
*
...
...
@@ -172,13 +174,16 @@ VDI_Http1Pipe(struct req *req, struct busyobj *bo)
*/
int
V
DI_Healthy
(
const
struct
director
*
d
,
const
struct
busyobj
*
bo
)
V
RT_Healthy
(
VRT_CTX
,
VCL_BACKEND
be
)
{
CHECK_OBJ_NOTNULL
(
d
,
DIRECTOR_MAGIC
);
if
(
d
->
healthy
==
NULL
)
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
if
(
be
==
NULL
)
return
(
0
);
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
if
(
be
->
healthy
==
NULL
)
return
(
1
);
return
(
d
->
healthy
(
d
,
bo
,
NULL
));
return
(
be
->
healthy
(
be
,
ctx
->
bo
,
NULL
));
}
/* Dump panic info -----------------------------------------------------
...
...
bin/varnishd/cache/cache_director.h
View file @
4376215b
...
...
@@ -37,18 +37,10 @@
*
*/
/*--------------------------------------------------------------------
* A director is a piece of code which selects one of possibly multiple
* backends to use.
*/
typedef
unsigned
vdi_healthy_f
(
const
struct
director
*
,
const
struct
busyobj
*
,
double
*
changed
);
typedef
const
struct
director
*
vdi_resolve_f
(
const
struct
director
*
,
struct
worker
*
,
struct
busyobj
*
);
typedef
int
vdi_gethdrs_f
(
const
struct
director
*
,
struct
worker
*
,
struct
busyobj
*
);
typedef
int
vdi_getbody_f
(
const
struct
director
*
,
struct
worker
*
,
...
...
@@ -79,16 +71,3 @@ struct director {
void
*
priv
;
const
void
*
priv2
;
};
/* cache_director.c */
int
VDI_GetHdr
(
struct
worker
*
,
struct
busyobj
*
);
int
VDI_GetBody
(
struct
worker
*
,
struct
busyobj
*
);
const
struct
suckaddr
*
VDI_GetIP
(
struct
worker
*
,
struct
busyobj
*
);
void
VDI_Finish
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
);
enum
sess_close
VDI_Http1Pipe
(
struct
req
*
,
struct
busyobj
*
);
int
VDI_Healthy
(
const
struct
director
*
,
const
struct
busyobj
*
);
void
VDI_Panic
(
const
struct
director
*
,
struct
vsb
*
,
const
char
*
nm
);
bin/varnishd/cache/cache_priv.h
View file @
4376215b
...
...
@@ -49,6 +49,14 @@ void VBT_Init(void);
/* cache_backend_poll.c */
void
VBP_Init
(
void
);
/* cache_director.c */
int
VDI_GetHdr
(
struct
worker
*
,
struct
busyobj
*
);
int
VDI_GetBody
(
struct
worker
*
,
struct
busyobj
*
);
const
struct
suckaddr
*
VDI_GetIP
(
struct
worker
*
,
struct
busyobj
*
);
void
VDI_Finish
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
);
enum
sess_close
VDI_Http1Pipe
(
struct
req
*
,
struct
busyobj
*
);
void
VDI_Panic
(
const
struct
director
*
,
struct
vsb
*
,
const
char
*
nm
);
/* cache_exp.c */
double
EXP_Ttl
(
const
struct
req
*
,
const
struct
objcore
*
);
void
EXP_Insert
(
struct
worker
*
wrk
,
struct
objcore
*
oc
);
...
...
include/vrt.h
View file @
4376215b
...
...
@@ -48,7 +48,9 @@
* binary/load-time compatible, increment MAJOR version
*
*
* 6.1 (unreleased):
* 6.2 (scheduled for: 2018-03-15)
* VRT_Healthy() added
* 6.1 (2017-09-15 aka 5.2)
* http_CollectHdrSep added
* VRT_purge modified (may fail a transaction, signature changed)
* 6.0 (2017-03-15):
...
...
@@ -77,7 +79,7 @@
#define VRT_MAJOR_VERSION 6U
#define VRT_MINOR_VERSION
1
U
#define VRT_MINOR_VERSION
2
U
/***********************************************************************/
...
...
@@ -355,6 +357,11 @@ void VRT_synth_page(VRT_CTX, const char *, ...);
/* Backend related */
struct
director
*
VRT_new_backend
(
VRT_CTX
,
const
struct
vrt_backend
*
);
void
VRT_delete_backend
(
VRT_CTX
,
struct
director
**
);
int
VRT_backend_healthy
(
VRT_CTX
,
struct
director
*
);
/* cache_director.c */
int
VRT_Healthy
(
VRT_CTX
,
VCL_BACKEND
);
/* Suckaddr related */
int
VRT_VSA_GetPtr
(
const
struct
suckaddr
*
sua
,
const
unsigned
char
**
dst
);
...
...
lib/libvmod_std/vmod_std.c
View file @
4376215b
...
...
@@ -198,10 +198,8 @@ VCL_BOOL __match_proto__(td_std_healthy)
vmod_healthy
(
VRT_CTX
,
VCL_BACKEND
be
)
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
if
(
be
==
NULL
)
return
(
0
);
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
return
(
VDI_Healthy
(
be
,
ctx
->
bo
));
CHECK_OBJ_ORNULL
(
be
,
DIRECTOR_MAGIC
);
return
(
VRT_Healthy
(
ctx
,
be
));
}
VCL_INT
__match_proto__
(
td_std_port
)
...
...
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