Commit 74e0b928 authored by Nils Goroll's avatar Nils Goroll

add direct argument to .backend and .*_selected

parent eadac954
...@@ -595,9 +595,11 @@ cluster_choose(VRT_CTX, ...@@ -595,9 +595,11 @@ cluster_choose(VRT_CTX,
.valid_deny = arg->valid_deny, \ .valid_deny = arg->valid_deny, \
.valid_real = arg->valid_real, \ .valid_real = arg->valid_real, \
.valid_uncacheable_direct = arg->valid_uncacheable_direct, \ .valid_uncacheable_direct = arg->valid_uncacheable_direct, \
.valid_direct = arg->valid_direct, \
.deny = arg->deny, \ .deny = arg->deny, \
.real = arg->real, \ .real = arg->real, \
.uncacheable_direct = arg->uncacheable_direct \ .uncacheable_direct = arg->uncacheable_direct, \
.direct = arg->direct \
}} }}
......
...@@ -189,7 +189,7 @@ See :ref:`meth_ctx` for limitations. ...@@ -189,7 +189,7 @@ See :ref:`meth_ctx` for limitations.
$Method BACKEND .backend(ENUM {LAZY, SHALLOW, DEEP, CLD} resolve=LAZY, $Method BACKEND .backend(ENUM {LAZY, SHALLOW, DEEP, CLD} resolve=LAZY,
[ BACKEND deny ], [ BACKEND real ], [ BACKEND deny ], [ BACKEND real ],
[ BOOL uncacheable_direct ]) [ BOOL uncacheable_direct ], [ BOOL direct ])
Return a backend by the method described in the rest of this Return a backend by the method described in the rest of this
documentation: documentation:
...@@ -209,25 +209,27 @@ documentation: ...@@ -209,25 +209,27 @@ documentation:
`cluster` was selected with ``resolve=DEEP`` and a reference to the `cluster` was selected with ``resolve=DEEP`` and a reference to the
`real` backend otherwise. `real` backend otherwise.
The optional `deny`, `real` and `uncacheable_direct` arguments behave The optional `deny`, `real`, `uncacheable_direct` and `direct`
differently depending on context: arguments behave differently depending on context:
* in ``vcl_backend_fetch {}`` and ``vcl_init {}``, they have the same * in ``vcl_backend_fetch {}`` and ``vcl_init {}``, they have the same
effect as calling the methods :ref:`func_cluster.deny`, effect as calling the methods :ref:`func_cluster.deny`,
:ref:`func_cluster.set_real` and :ref:`func_cluster.set_real`,
:ref:`func_cluster.set_uncacheable_direct` before the `.backend()` :ref:`func_cluster.set_uncacheable_direct` or
method - in other words, they affect future method calls on the same :ref:`func_cluster.set_direct`, before the `.backend()` method - in
cluster object also. other words, they affect future method calls on the same cluster
object also.
* Outside ``vcl_backend_fetch {}`` and ``vcl_init {}``, the `deny`, * Outside ``vcl_backend_fetch {}`` and ``vcl_init {}``, the `deny`,
`real` and `uncacheable_direct` arguments only affect the current `real` and `uncacheable_direct` and `direct` arguments only affect
return value. the current return value.
Also, they cannot be used together with ``resolve=LAZY``. Also, in these contexts they cannot be used together with
``resolve=LAZY``.
$Method BOOL .cluster_selected( $Method BOOL .cluster_selected(
[ BACKEND deny ], [ BACKEND real ], [ BACKEND deny ], [ BACKEND real ],
[ BOOL uncacheable_direct ]) [ BOOL uncacheable_direct ], [ BOOL direct ])
The indended use case is:: The indended use case is::
...@@ -252,7 +254,7 @@ the vcl otherwise. ...@@ -252,7 +254,7 @@ the vcl otherwise.
$Method BOOL .real_selected( $Method BOOL .real_selected(
[ BACKEND deny ], [ BACKEND real ], [ BACKEND deny ], [ BACKEND real ],
[ BOOL uncacheable_direct ]) [ BOOL uncacheable_direct ], [ BOOL direct ])
mirrors :ref:`func_cluster.cluster_selected`, but returns true if the mirrors :ref:`func_cluster.cluster_selected`, but returns true if the
real backend is selected. real backend is selected.
......
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