Commit 566dcf4c authored by Nils Goroll's avatar Nils Goroll

move VRT_DirectorResolve to vmod_compat.h

parent 2dc864c5
...@@ -38,29 +38,6 @@ ...@@ -38,29 +38,6 @@
#include "vcc_cluster_if.h" #include "vcc_cluster_if.h"
#include "vmod_compat.h" #include "vmod_compat.h"
/* ------------------------------------------------------------
* workaround missing VRT_DirectorResolve
* Ref https://github.com/varnishcache/varnish-cache/pull/2680
*/
#if ! HAVE_DECL_VRT_DIRECTORRESOLVE
#include <cache/cache_director.h>
static VCL_BACKEND
VRT_DirectorResolve(VRT_CTX, VCL_BACKEND d)
{
VCL_BACKEND d2;
for (; d != NULL && d->vdir->methods->resolve != NULL; d = d2) {
CHECK_OBJ_NOTNULL(d, DIRECTOR_MAGIC);
AN(d->vdir);
d2 = d->vdir->methods->resolve(ctx, d);
}
CHECK_OBJ_ORNULL(d, DIRECTOR_MAGIC);
if (d != NULL)
AN(d->vdir);
return (d);
}
#endif
/* ------------------------------------------------------------ /* ------------------------------------------------------------
*/ */
......
...@@ -7,3 +7,27 @@ ...@@ -7,3 +7,27 @@
#ifndef VARGS #ifndef VARGS
#define VARGS(x) vmod_ ## x ## _arg #define VARGS(x) vmod_ ## x ## _arg
#endif #endif
/* ------------------------------------------------------------
* workaround missing VRT_DirectorResolve
* Ref https://github.com/varnishcache/varnish-cache/pull/2680
*/
#if ! HAVE_DECL_VRT_DIRECTORRESOLVE
#include <cache/cache_director.h>
static inline VCL_BACKEND
VRT_DirectorResolve(VRT_CTX, VCL_BACKEND d)
{
VCL_BACKEND d2;
for (; d != NULL && d->vdir->methods->resolve != NULL; d = d2) {
CHECK_OBJ_NOTNULL(d, DIRECTOR_MAGIC);
AN(d->vdir);
d2 = d->vdir->methods->resolve(ctx, d);
}
CHECK_OBJ_ORNULL(d, DIRECTOR_MAGIC);
if (d != NULL)
AN(d->vdir);
return (d);
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment