Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-vslp
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
libvmod-vslp
Commits
6318870a
Commit
6318870a
authored
Jun 12, 2014
by
Julian Wiesener
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update -> v4.0-release
parent
3c513dec
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
21 deletions
+20
-21
Makefile.am
src/Makefile.am
+1
-1
vmod_vslp.c
src/vmod_vslp.c
+1
-1
vmod_vslp.vcc
src/vmod_vslp.vcc
+11
-12
vslp_dir.c
src/vslp_dir.c
+5
-5
vslp_dir.h
src/vslp_dir.h
+2
-2
No files found.
src/Makefile.am
View file @
6318870a
...
@@ -9,7 +9,7 @@ AM_LDFLAGS = $(AM_LT_LDFLAGS)
...
@@ -9,7 +9,7 @@ AM_LDFLAGS = $(AM_LT_LDFLAGS)
vmoddir
=
$(VMODDIR)
vmoddir
=
$(VMODDIR)
vmod_LTLIBRARIES
=
libvmod_vslp.la
vmod_LTLIBRARIES
=
libvmod_vslp.la
vmod_srcdir
=
$(top_srcdir)
/src
vmod_srcdir
=
$(top_srcdir)
/src
vmodtool
=
$(VARNISHSRC)
/lib/libvc
l
/vmodtool.py
vmodtool
=
$(VARNISHSRC)
/lib/libvc
c
/vmodtool.py
libvmod_vslp_la_LDFLAGS
=
$(AM_LDFLAGS)
-module
-export-dynamic
-avoid-version
-shared
libvmod_vslp_la_LDFLAGS
=
$(AM_LDFLAGS)
-module
-export-dynamic
-avoid-version
-shared
...
...
src/vmod_vslp.c
View file @
6318870a
...
@@ -60,7 +60,7 @@ vmod_vslp__init(const struct vrt_ctx *ctx, struct vmod_vslp_vslp **vslpdp, const
...
@@ -60,7 +60,7 @@ vmod_vslp__init(const struct vrt_ctx *ctx, struct vmod_vslp_vslp **vslpdp, const
AN
(
vslpd
);
AN
(
vslpd
);
*
vslpdp
=
vslpd
;
*
vslpdp
=
vslpd
;
vslpdir_new
(
&
vslpd
->
vslpd
,
vcl_name
,
vslpd
);
vslpdir_new
(
&
vslpd
->
vslpd
,
vcl_name
);
}
}
VCL_VOID
__match_proto__
(
td_vslp_vslp__fini
)
VCL_VOID
__match_proto__
(
td_vslp_vslp__fini
)
...
...
src/vmod_vslp.vcc
View file @
6318870a
...
@@ -26,16 +26,15 @@
...
@@ -26,16 +26,15 @@
# SUCH DAMAGE.
# SUCH DAMAGE.
Module vslp
$Module vslp 3
Object vslp() {
$Object vslp()
Method VOID .add_backend(BACKEND)
$Method VOID .add_backend(BACKEND)
Method VOID .set_rampup_ratio(REAL)
$Method VOID .set_rampup_ratio(REAL)
Method VOID .set_rampup_time(DURATION)
$Method VOID .set_rampup_time(DURATION)
Method VOID .set_hash(ENUM { CRC32, SHA256, RS })
$Method VOID .set_hash(ENUM { CRC32, SHA256, RS })
Method VOID .init_hashcircle(INT)
$Method VOID .init_hashcircle(INT)
Method BACKEND .backend()
$Method BACKEND .backend()
Method BACKEND .backend_by_int(INT)
$Method BACKEND .backend_by_int(INT)
Method BACKEND .backend_by_string(STRING)
$Method BACKEND .backend_by_string(STRING)
Method BACKEND .backend_by_string_hash(STRING, ENUM { CRC32, SHA256, RS })
$Method BACKEND .backend_by_string_hash(STRING, ENUM { CRC32, SHA256, RS })
}
src/vslp_dir.c
View file @
6318870a
...
@@ -189,7 +189,7 @@ vslp_choose_next_healthy(struct vslp_state *state, uint32_t n_retry)
...
@@ -189,7 +189,7 @@ vslp_choose_next_healthy(struct vslp_state *state, uint32_t n_retry)
be
=
state
->
vslpd
->
backend
[
chosen
];
be
=
state
->
vslpd
->
backend
[
chosen
];
AN
(
be
);
AN
(
be
);
if
(
be
->
healthy
(
be
,
state
->
ctx
->
bo
->
digest
))
if
(
be
->
healthy
(
be
,
NULL
))
{
{
vslp_be_healthy
(
state
,
chosen
);
vslp_be_healthy
(
state
,
chosen
);
break
;
break
;
...
@@ -202,7 +202,7 @@ vslp_choose_next_healthy(struct vslp_state *state, uint32_t n_retry)
...
@@ -202,7 +202,7 @@ vslp_choose_next_healthy(struct vslp_state *state, uint32_t n_retry)
}
}
void
void
vslpdir_new
(
struct
vslpdir
**
vslpdp
,
const
char
*
vcl_name
,
void
*
priv
)
vslpdir_new
(
struct
vslpdir
**
vslpdp
,
const
char
*
vcl_name
)
{
{
struct
vslpdir
*
vslpd
;
struct
vslpdir
*
vslpd
;
...
@@ -369,7 +369,7 @@ void vslpdir_expand(struct vslpdir *vslpd, unsigned n)
...
@@ -369,7 +369,7 @@ void vslpdir_expand(struct vslpdir *vslpd, unsigned n)
}
}
unsigned
unsigned
vslpdir_any_healthy
(
struct
vslpdir
*
vslpd
,
const
uint8_t
*
digest
)
vslpdir_any_healthy
(
struct
vslpdir
*
vslpd
)
{
{
unsigned
retval
=
0
;
unsigned
retval
=
0
;
VCL_BACKEND
be
;
VCL_BACKEND
be
;
...
@@ -380,7 +380,7 @@ vslpdir_any_healthy(struct vslpdir *vslpd, const uint8_t *digest)
...
@@ -380,7 +380,7 @@ vslpdir_any_healthy(struct vslpdir *vslpd, const uint8_t *digest)
for
(
u
=
0
;
u
<
vslpd
->
n_backend
;
u
++
)
{
for
(
u
=
0
;
u
<
vslpd
->
n_backend
;
u
++
)
{
be
=
vslpd
->
backend
[
u
];
be
=
vslpd
->
backend
[
u
];
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
if
(
be
->
healthy
(
be
,
digest
))
{
if
(
be
->
healthy
(
be
,
NULL
))
{
retval
=
1
;
retval
=
1
;
break
;
break
;
}
}
...
@@ -438,7 +438,7 @@ VCL_BACKEND vslpdir_pick_be(struct vslpdir *vslpd, const struct vrt_ctx *ctx, ui
...
@@ -438,7 +438,7 @@ VCL_BACKEND vslpdir_pick_be(struct vslpdir *vslpd, const struct vrt_ctx *ctx, ui
be
=
vslpd
->
backend
[
chosen
];
be
=
vslpd
->
backend
[
chosen
];
AN
(
be
);
AN
(
be
);
if
(
be
->
healthy
(
be
,
ctx
->
bo
->
digest
))
if
(
be
->
healthy
(
be
,
NULL
))
{
{
if
(
!
vslp_be_healthy
(
&
state
,
chosen
))
if
(
!
vslp_be_healthy
(
&
state
,
chosen
))
be_choice
^=
be_choice
;
be_choice
^=
be_choice
;
...
...
src/vslp_dir.h
View file @
6318870a
...
@@ -61,7 +61,7 @@ struct vslpdir {
...
@@ -61,7 +61,7 @@ struct vslpdir {
VCL_INT
replicas
;
VCL_INT
replicas
;
};
};
void
vslpdir_new
(
struct
vslpdir
**
vslpdp
,
const
char
*
vcl_name
,
void
*
priv
);
void
vslpdir_new
(
struct
vslpdir
**
vslpdp
,
const
char
*
vcl_name
);
void
vslpdir_delete
(
struct
vslpdir
**
vslpdp
);
void
vslpdir_delete
(
struct
vslpdir
**
vslpdp
);
void
vslpdir_add_backend
(
struct
vslpdir
*
vslpd
,
VCL_BACKEND
be
);
void
vslpdir_add_backend
(
struct
vslpdir
*
vslpd
,
VCL_BACKEND
be
);
void
vslpdir_set_rampup_ratio
(
struct
vslpdir
*
vslpd
,
VCL_REAL
ratio
);
void
vslpdir_set_rampup_ratio
(
struct
vslpdir
*
vslpd
,
VCL_REAL
ratio
);
...
@@ -71,5 +71,5 @@ void vslpdir_init_hashcircle(struct vslpdir *vslpd, VCL_INT replicas);
...
@@ -71,5 +71,5 @@ void vslpdir_init_hashcircle(struct vslpdir *vslpd, VCL_INT replicas);
void
vslpdir_lock
(
struct
vslpdir
*
vslpd
);
void
vslpdir_lock
(
struct
vslpdir
*
vslpd
);
void
vslpdir_unlock
(
struct
vslpdir
*
vslpd
);
void
vslpdir_unlock
(
struct
vslpdir
*
vslpd
);
void
vslpdir_expand
(
struct
vslpdir
*
vslpd
,
unsigned
n
);
void
vslpdir_expand
(
struct
vslpdir
*
vslpd
,
unsigned
n
);
unsigned
vslpdir_any_healthy
(
struct
vslpdir
*
vslpd
,
const
uint8_t
*
digest
);
unsigned
vslpdir_any_healthy
(
struct
vslpdir
*
vslpd
);
VCL_BACKEND
vslpdir_pick_be
(
struct
vslpdir
*
vslpd
,
const
struct
vrt_ctx
*
ctx
,
uint32_t
hash
);
VCL_BACKEND
vslpdir_pick_be
(
struct
vslpdir
*
vslpd
,
const
struct
vrt_ctx
*
ctx
,
uint32_t
hash
);
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