Compare commits

...

No commits in common. "c8-stream-6" and "fa5fc0216bd08c2f2d4adf55bae478a11d86d726" have entirely different histories.

11 changed files with 3535 additions and 5 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
SOURCES/varnish-modules-0.15.0.tar.gz
/varnish-modules-0.15.0.tar.gz

View File

@ -1 +1 @@
6c8c86fa749cbade9627f71ac9b51ec016f7e006 SOURCES/varnish-modules-0.15.0.tar.gz
6c8c86fa749cbade9627f71ac9b51ec016f7e006 varnish-modules-0.15.0.tar.gz

9
gating.yaml Normal file
View File

@ -0,0 +1,9 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier2.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier3.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.acceptance-tier.functional}

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (varnish-modules-0.15.0.tar.gz) = f24bc7e00db8eb53e4730b9b6d9adb9442d26ad5b07f3e09541b686e41d437113b8bca75f9ac47bc0ec54475fafb0eefc46b98ccee92d9360aaf660b4826ec9e

View File

@ -0,0 +1,44 @@
--- /dev/null 2019-09-18 14:09:23.308277474 +0200
+++ bootstrap 2019-09-24 09:55:24.218322744 +0200
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+warn() {
+ echo "WARNING: $@" 1>&2
+}
+
+case `uname -s` in
+Darwin)
+ LIBTOOLIZE=glibtoolize
+ ;;
+FreeBSD)
+ LIBTOOLIZE=libtoolize
+ ;;
+Linux)
+ LIBTOOLIZE=libtoolize
+ ;;
+SunOS)
+ LIBTOOLIZE=libtoolize
+ ;;
+*)
+ warn "unrecognized platform:" `uname -s`
+ LIBTOOLIZE=libtoolize
+esac
+
+# check for varnishapi.m4 in custom paths
+dataroot=$(pkg-config --variable=datarootdir varnishapi 2>/dev/null)
+if [ -z "$dataroot" ] ; then
+ cat >&2 <<'EOF'
+Package varnishapi was not found in the pkg-config search path.
+Perhaps you should add the directory containing `varnishapi.pc'
+to the PKG_CONFIG_PATH environment variable
+EOF
+ exit 1
+fi
+set -ex
+mkdir -p m4
+aclocal -I m4 -I ${dataroot}/aclocal
+$LIBTOOLIZE --copy --force
+autoheader
+automake --add-missing --copy --foreign
+autoconf

View File

@ -0,0 +1,44 @@
--- /dev/null 2019-09-28 14:48:27.937320545 +0200
+++ bootstrap 2019-09-29 00:35:05.782099759 +0200
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+warn() {
+ echo "WARNING: $@" 1>&2
+}
+
+case `uname -s` in
+Darwin)
+ LIBTOOLIZE=glibtoolize
+ ;;
+FreeBSD)
+ LIBTOOLIZE=libtoolize
+ ;;
+Linux)
+ LIBTOOLIZE=libtoolize
+ ;;
+SunOS)
+ LIBTOOLIZE=libtoolize
+ ;;
+*)
+ warn "unrecognized platform:" `uname -s`
+ LIBTOOLIZE=libtoolize
+esac
+
+# check for varnishapi.m4 in custom paths
+dataroot=$(pkg-config --variable=datarootdir varnishapi 2>/dev/null)
+if [ -z "$dataroot" ] ; then
+ cat >&2 <<'EOF'
+Package varnishapi was not found in the pkg-config search path.
+Perhaps you should add the directory containing `varnishapi.pc'
+to the PKG_CONFIG_PATH environment variable
+EOF
+ exit 1
+fi
+set -ex
+mkdir -p m4
+aclocal -I m4 -I ${dataroot}/aclocal
+$LIBTOOLIZE --copy --force
+autoheader
+automake --add-missing --copy --foreign
+autoconf

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,268 @@
From 918057c889d850940b0c8d6f2b14dc94d543bae4 Mon Sep 17 00:00:00 2001
From: Nils Goroll <nils.goroll@uplex.de>
Date: Wed, 25 Apr 2018 17:02:04 +0200
Subject: [PATCH 1/4] update for master
a11939eb64427847ec11571d328696ba162f8c6a
---
src/vmod_saintmode.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/vmod_saintmode.c b/src/vmod_saintmode.c
index 26191cc..4b4b874 100644
--- a/src/vmod_saintmode.c
+++ b/src/vmod_saintmode.c
@@ -43,6 +43,11 @@
#include "vcc_saintmode_if.h"
+static unsigned
+healthy(const struct director *, const struct busyobj *, double *);
+static const struct director *
+resolve(const struct director *, struct worker *, struct busyobj *);
+
struct trouble {
unsigned magic;
#define TROUBLE_MAGIC 0x4211ab21
@@ -63,6 +68,14 @@ struct vmod_saintmode_saintmode {
VTAILQ_HEAD(, trouble) troublelist;
};
+static const struct director_methods vmod_saintmode_methods[1] = {{
+ .magic = DIRECTOR_METHODS_MAGIC,
+ .type = "saintmode",
+ .healthy = healthy,
+ .resolve = resolve
+}};
+
+
struct saintmode_objs {
unsigned magic;
#define SAINTMODE_OBJS_MAGIC 0x9aa7beec
@@ -269,7 +282,7 @@ healthy(const struct director *dir, const struct busyobj *bo, double *changed)
/* Saintmode is disabled, or list is empty */
if (sm->threshold == 0 || sm->n_trouble == 0)
- return (sm->be->healthy(sm->be, bo, changed));
+ return (sm->be->methods->healthy(sm->be, bo, changed));
if (!bo) {
digest = NULL;
@@ -282,7 +295,7 @@ healthy(const struct director *dir, const struct busyobj *bo, double *changed)
}
retval = is_digest_healthy(dir, digest, t_prev, vsl);
- return (retval ? sm->be->healthy(sm->be, bo, changed) : 0);
+ return (retval ? sm->be->methods->healthy(sm->be, bo, changed) : 0);
}
VCL_BOOL
@@ -343,13 +356,11 @@ vmod_saintmode__init(VRT_CTX, struct vmod_saintmode_saintmode **smp,
VTAILQ_INIT(&sm->troublelist);
sm->sdir->magic = DIRECTOR_MAGIC;
- sm->sdir->resolve = resolve;
- sm->sdir->healthy = healthy;
+ sm->sdir->methods = vmod_saintmode_methods;
#ifdef HAVE_DIRECTOR_ADMIN_HEALTH
sm->sdir->admin_health = VDI_AH_HEALTHY;
#endif
REPLACE(sm->sdir->vcl_name, vcl_name);
- sm->sdir->name = "saintmode";
sm->sdir->priv = sm;
if (!priv->priv) {
From 2141fd9d37f435b4875c07c8fcc3fb1ea5968d74 Mon Sep 17 00:00:00 2001
From: Nils Goroll <nils.goroll@uplex.de>
Date: Thu, 26 Apr 2018 14:50:30 +0200
Subject: [PATCH 2/4] Output the health state as baseline information
---
src/tests/saintmode/test02.vtc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/tests/saintmode/test02.vtc b/src/tests/saintmode/test02.vtc
index aa97734..bd8b537 100644
--- a/src/tests/saintmode/test02.vtc
+++ b/src/tests/saintmode/test02.vtc
@@ -51,6 +51,8 @@ varnish v1 -vcl+backend {
} -start
+varnish v1 -cliok "backend.list"
+
client c1 {
txreq -url "/a"
rxresp
From 1e704bfd7d8aa8b1e20d918788f0c7c65488713e Mon Sep 17 00:00:00 2001
From: Nils Goroll <nils.goroll@uplex.de>
Date: Thu, 26 Apr 2018 14:50:49 +0200
Subject: [PATCH 3/4] changes required for latest varnish-cache
The director API has changed and, in particular, the director healthy
callback is now only queried for AH_PROBE.
---
src/vmod_saintmode.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/vmod_saintmode.c b/src/vmod_saintmode.c
index 4b4b874..95de050 100644
--- a/src/vmod_saintmode.c
+++ b/src/vmod_saintmode.c
@@ -43,10 +43,10 @@
#include "vcc_saintmode_if.h"
-static unsigned
-healthy(const struct director *, const struct busyobj *, double *);
-static const struct director *
-resolve(const struct director *, struct worker *, struct busyobj *);
+static VCL_BOOL v_matchproto_(vdi_healthy_f)
+healthy(VRT_CTX, VCL_BACKEND, VCL_TIME *);
+static VCL_BACKEND v_matchproto_(vdi_resolve_f)
+resolve(VRT_CTX, VCL_BACKEND);
struct trouble {
unsigned magic;
@@ -266,23 +266,26 @@ is_digest_healthy(const struct director *dir,
}
/* All adapted from PHK's saintmode implementation in Varnish 3.0 */
-static unsigned
-healthy(const struct director *dir, const struct busyobj *bo, double *changed)
+static VCL_BOOL v_matchproto_(vdi_healthy_f)
+healthy(VRT_CTX, VCL_BACKEND dir, VCL_TIME *changed)
{
struct vmod_saintmode_saintmode *sm;
+ const struct busyobj *bo;
unsigned retval;
const uint8_t* digest;
double t_prev;
struct vsl_log* vsl;
+ CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(dir, DIRECTOR_MAGIC);
CAST_OBJ_NOTNULL(sm, dir->priv, VMOD_SAINTMODE_MAGIC);
CHECK_OBJ_NOTNULL(sm->be, DIRECTOR_MAGIC);
+ bo = ctx->bo;
CHECK_OBJ_ORNULL(bo, BUSYOBJ_MAGIC);
/* Saintmode is disabled, or list is empty */
if (sm->threshold == 0 || sm->n_trouble == 0)
- return (sm->be->methods->healthy(sm->be, bo, changed));
+ return (VRT_Healthy(ctx, sm->be, changed));
if (!bo) {
digest = NULL;
@@ -295,7 +298,7 @@ healthy(const struct director *dir, const struct busyobj *bo, double *changed)
}
retval = is_digest_healthy(dir, digest, t_prev, vsl);
- return (retval ? sm->be->methods->healthy(sm->be, bo, changed) : 0);
+ return (retval ? VRT_Healthy(ctx, sm->be, changed) : 0);
}
VCL_BOOL
@@ -316,19 +319,17 @@ vmod_saintmode_is_healthy(VRT_CTX, struct vmod_saintmode_saintmode *sm)
return is_digest_healthy(sm->sdir, digest,
ctx->req->t_prev, ctx->req->vsl);
} else
- return healthy(sm->sdir, ctx->bo, NULL);
+ return healthy(ctx, sm->sdir, NULL);
}
-static const struct director *
-resolve(const struct director *dir, struct worker *wrk, struct busyobj *bo) {
+static VCL_BACKEND v_matchproto_(vdi_resolve_f)
+resolve(VRT_CTX, VCL_BACKEND dir) {
struct vmod_saintmode_saintmode *sm;
- double changed = 0.0;
CHECK_OBJ_NOTNULL(dir, DIRECTOR_MAGIC);
CAST_OBJ_NOTNULL(sm, dir->priv, VMOD_SAINTMODE_MAGIC);
- (void)wrk;
- if (!healthy(dir, bo, &changed))
+ if (!healthy(ctx, dir, NULL))
return (NULL);
return (sm->be);
@@ -358,7 +359,7 @@ vmod_saintmode__init(VRT_CTX, struct vmod_saintmode_saintmode **smp,
sm->sdir->magic = DIRECTOR_MAGIC;
sm->sdir->methods = vmod_saintmode_methods;
#ifdef HAVE_DIRECTOR_ADMIN_HEALTH
- sm->sdir->admin_health = VDI_AH_HEALTHY;
+ sm->sdir->admin_health = VDI_AH_PROBE;
#endif
REPLACE(sm->sdir->vcl_name, vcl_name);
sm->sdir->priv = sm;
From c1c9b6ff4652c34aeff68f209d983be684caeb32 Mon Sep 17 00:00:00 2001
From: Nils Goroll <nils.goroll@uplex.de>
Date: Tue, 1 May 2018 18:48:59 +0200
Subject: [PATCH 4/4] reflect latest changes to the director API
---
src/vmod_saintmode.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/src/vmod_saintmode.c b/src/vmod_saintmode.c
index 95de050..b0e4ac6 100644
--- a/src/vmod_saintmode.c
+++ b/src/vmod_saintmode.c
@@ -35,9 +35,6 @@
#include "vmod_config.h"
-#include "cache/cache_director.h"
-#include "cache/cache_backend.h"
-
#include "vsb.h"
#include "vtim.h"
@@ -59,7 +56,7 @@ struct trouble {
struct vmod_saintmode_saintmode {
unsigned magic;
#define VMOD_SAINTMODE_MAGIC 0xa03756e4
- struct director sdir[1];
+ const struct director *sdir;
const struct director *be;
pthread_mutex_t mtx;
unsigned threshold;
@@ -68,8 +65,8 @@ struct vmod_saintmode_saintmode {
VTAILQ_HEAD(, trouble) troublelist;
};
-static const struct director_methods vmod_saintmode_methods[1] = {{
- .magic = DIRECTOR_METHODS_MAGIC,
+static const struct vdi_methods vmod_saintmode_methods[1] = {{
+ .magic = VDI_METHODS_MAGIC,
.type = "saintmode",
.healthy = healthy,
.resolve = resolve
@@ -356,13 +353,7 @@ vmod_saintmode__init(VRT_CTX, struct vmod_saintmode_saintmode **smp,
sm->be = be;
VTAILQ_INIT(&sm->troublelist);
- sm->sdir->magic = DIRECTOR_MAGIC;
- sm->sdir->methods = vmod_saintmode_methods;
-#ifdef HAVE_DIRECTOR_ADMIN_HEALTH
- sm->sdir->admin_health = VDI_AH_PROBE;
-#endif
- REPLACE(sm->sdir->vcl_name, vcl_name);
- sm->sdir->priv = sm;
+ sm->sdir = VRT_AddDirector(ctx, vmod_saintmode_methods, sm, "%s", vcl_name);
if (!priv->priv) {
ALLOC_OBJ(sm_objs, SAINTMODE_OBJS_MAGIC);
@@ -392,7 +383,7 @@ vmod_saintmode__fini(struct vmod_saintmode_saintmode **smp) {
FREE_OBJ(tr);
}
- free(sm->sdir->vcl_name);
+ VRT_DelDirector(&sm->sdir);
AZ(pthread_mutex_destroy(&sm->mtx));
/* We can no longer refer to the sm_objs after this

View File

@ -0,0 +1,23 @@
From 40a8cc063b2819fdd325061a1cb48a3adc3ec910 Mon Sep 17 00:00:00 2001
From: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Wed, 17 Oct 2018 12:42:22 +0200
Subject: [PATCH] 32bit-friendly format in vmod-tcp
Fixes #122
---
src/vmod_tcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/vmod_tcp.c b/src/vmod_tcp.c
index fee4bd3..570be45 100644
--- a/src/vmod_tcp.c
+++ b/src/vmod_tcp.c
@@ -174,7 +174,7 @@ vmod_set_socket_pace(VRT_CTX, VCL_INT rate)
sizeof(pacerate)) != 0)
VSLb(ctx->vsl, SLT_VCL_Error, "set_socket_pace(): Error setting pace rate.");
else
- VSLb(ctx->vsl, SLT_VCL_Log, "vmod-tcp: Socket paced to %lu KB/s.", rate);
+ VSLb(ctx->vsl, SLT_VCL_Log, "vmod-tcp: Socket paced to %jd KB/s.", (intmax_t)rate);
# ifndef NDEBUG
int retval;

View File

@ -9,7 +9,7 @@
Name: varnish-modules
Version: 0.15.0
Release: 6%{?dist}
Release: 5%{?dist}
Summary: A collection of modules ("vmods") extending Varnish VCL
Group: System Environment/Daemons
@ -85,9 +85,6 @@ make check VERBOSE=1
%changelog
* Mon Jul 26 2021 Luboš Uhliarik <luhliari@redhat.com> - 0.15.0-6
- Related: #1982862 - rebuild for new varnish version
* Thu Apr 16 2020 Lubos Uhliarik <luhliari@redhat.com> - 0.15.0-5
- Related: #1795673 - RFE: rebase varnish:6 to latest 6.0.x LTS