Use $Restrict

parent cff18a7b
.. ..
.. NB: This file is machine generated, DO NOT EDIT! .. NB: This file is machine generated, DO NOT EDIT!
.. ..
.. Edit vmod.vcc and run make instead .. Edit ./vfp_brotli.vcc and run make instead
.. ..
.. role:: ref(emphasis) .. role:: ref(emphasis)
=========== ===========
VMOD brotli vmod_brotli
=========== ===========
-------------------------------------------------- --------------------------------------------------
...@@ -198,7 +198,7 @@ Note that (unlike gzip) brotli compression does not work together with ...@@ -198,7 +198,7 @@ Note that (unlike gzip) brotli compression does not work together with
Edge Side Includes (ESI). See `LIMITATIONS`_ below for a discussion of Edge Side Includes (ESI). See `LIMITATIONS`_ below for a discussion of
this issue, and of possible solutions with VCL. this issue, and of possible solutions with VCL.
.. _vmod_brotli.encoder: .. _brotli.encoder():
new xencoder = brotli.encoder(STRING name, BYTES buffer, INT quality, BOOL large_win, INT lgwin, ENUM mode) new xencoder = brotli.encoder(STRING name, BYTES buffer, INT quality, BOOL large_win, INT lgwin, ENUM mode)
----------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------
...@@ -284,7 +284,7 @@ Example:: ...@@ -284,7 +284,7 @@ Example::
} }
} }
.. _vmod_brotli.encoder.create_stats: .. _xencoder.create_stats():
VOID xencoder.create_stats() VOID xencoder.create_stats()
---------------------------- ----------------------------
...@@ -294,10 +294,7 @@ the custom compression filter. These are the same as the counters ...@@ -294,10 +294,7 @@ the custom compression filter. These are the same as the counters
created for the standard ``"br"`` filter. See `STATISTICS`_ below for created for the standard ``"br"`` filter. See `STATISTICS`_ below for
details. details.
The ``.create_stats()`` method MAY NOT be called in any VCL subroutine Restricted to: ``vcl_init``.
besides ``vcl_init``. If it is called in another subroutine, then VCL
failure is invoked -- ordinarily, the request fails with a "503 VCL
failed" response.
Example:: Example::
...@@ -309,7 +306,7 @@ Example:: ...@@ -309,7 +306,7 @@ Example::
mybr.create_stats(); mybr.create_stats();
} }
.. _vmod_brotli.decoder: .. _brotli.decoder():
new xdecoder = brotli.decoder(STRING name, BYTES buffer, BOOL large_win) new xdecoder = brotli.decoder(STRING name, BYTES buffer, BOOL large_win)
------------------------------------------------------------------------ ------------------------------------------------------------------------
...@@ -359,7 +356,7 @@ Example:: ...@@ -359,7 +356,7 @@ Example::
} }
} }
.. _vmod_brotli.decoder.create_stats: .. _xdecoder.create_stats():
VOID xdecoder.create_stats() VOID xdecoder.create_stats()
---------------------------- ----------------------------
...@@ -371,7 +368,7 @@ for details. ...@@ -371,7 +368,7 @@ for details.
As with ``encoder.create_stats()``, this method MAY NOT be called in As with ``encoder.create_stats()``, this method MAY NOT be called in
any VCL subroutine besides ``vcl_init``, otherwise VCL failure is invoked. any VCL subroutine besides ``vcl_init``, otherwise VCL failure is invoked.
.. _vmod_brotli.encoder_version: .. _brotli.encoder_version():
STRING encoder_version() STRING encoder_version()
------------------------ ------------------------
...@@ -382,7 +379,7 @@ Example:: ...@@ -382,7 +379,7 @@ Example::
std.log("Using brotli encoder version: " + brotli.encoder_version()); std.log("Using brotli encoder version: " + brotli.encoder_version());
.. _vmod_brotli.decoder_version: .. _brotli.decoder_version():
STRING decoder_version() STRING decoder_version()
------------------------ ------------------------
...@@ -393,7 +390,7 @@ Example:: ...@@ -393,7 +390,7 @@ Example::
std.log("Using brotli decoder version: " + brotli.decoder_version()); std.log("Using brotli decoder version: " + brotli.decoder_version());
.. _vmod_brotli.version: .. _brotli.version():
STRING version() STRING version()
---------------- ----------------
......
...@@ -753,11 +753,7 @@ create_stats(VRT_CTX, const struct vfp *vfp, const char *vcl_name) ...@@ -753,11 +753,7 @@ create_stats(VRT_CTX, const struct vfp *vfp, const char *vcl_name)
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
AN(vcl_name); AN(vcl_name);
if ((ctx->method & VCL_MET_INIT) == 0) { assert(ctx->method == VCL_MET_INIT);
VFAIL(ctx, "%s.create_stats() may only be called in vcl_init",
vcl_name);
return;
}
AN(vfp); AN(vfp);
CAST_OBJ_NOTNULL(vfp_priv, TRUST_ME(vfp->priv1), VFP_PRIV_MAGIC); CAST_OBJ_NOTNULL(vfp_priv, TRUST_ME(vfp->priv1), VFP_PRIV_MAGIC);
......
...@@ -281,10 +281,7 @@ the custom compression filter. These are the same as the counters ...@@ -281,10 +281,7 @@ the custom compression filter. These are the same as the counters
created for the standard ``"br"`` filter. See `STATISTICS`_ below for created for the standard ``"br"`` filter. See `STATISTICS`_ below for
details. details.
The ``.create_stats()`` method MAY NOT be called in any VCL subroutine $Restrict vcl_init
besides ``vcl_init``. If it is called in another subroutine, then VCL
failure is invoked -- ordinarily, the request fails with a "503 VCL
failed" response.
Example:: Example::
......
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