You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2018/01/17 22:31:49 UTC
svn commit: r1821429 [7/9] - in /tcl/site/rivet: ./ html/ manual3.0/
manual3.0/images/
Added: tcl/site/rivet/manual3.0/lazybridge.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/lazybridge.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/lazybridge.html (added)
+++ tcl/site/rivet/manual3.0/lazybridge.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,198 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Example: the âLazyâ bridge</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="index.html" title="Apache Rivet 3.0"><link rel="prev" href="internals.html" title="Rivet Internals"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Example: the <span class="quote">â<span class="quote">Lazy</span>â</span> bridge</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="internals.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Â </th><td width="20%" align="right">Â </td></tr></table></div><div class="section"><div class="titlepage"><div>
<div><hr><h2 class="title" style="clear: both"><a name="lazybridge"></a>Example: the <span class="quote">â<span class="quote">Lazy</span>â</span> bridge</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idm4481"></a>The rationale of threaded bridges</h3></div></div></div><p style="width:90%">
+ The 'bridge' concept was introduced to cope with the ability of
+ the Apache HTTP web server to adopt different multiprocessing
+ models by loading one of the available MPMs (Multi Processing Modules).
+ A bridge's task is to let mod_rivet fit the selected multiprocessing
+ model in the first place. Still separating mod_rivet core
+ functions from the MPM machinery provided also a solution for
+ implementing a flexible and extensible design that enables
+ a programmer to develop alternative approaches to workload and
+ resource management.
+ </p><p style="width:90%">
+ The Apache HTTP web server demands its modules to
+ run with any MPM irrespective of its internal architecture and its
+ a general design constrain to make no assumptions about the MPM.
+ This clashes with some requirements of threaded builds of Tcl.
+ First of all Tcl is itself threaded (unless threads are disabled
+ at compile time) and many of the basic Tcl data structures (namely Tcl_Obj)
+ cannot be safely shared among threads.
+ This demands a Tcl interpreters be run
+ on separated threads communicating with the HTTP web server
+ through suitable methods.
+ </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idm4485"></a>Lazy bridge data structures</h3></div></div></div><p style="width:90%">
+ The lazy bridge was initially developed to outline the basic tasks
+ carried out by each function making a rivet MPM bridge.
+ The lazy bridge attempts to be minimalist
+ but it's nearly fully functional, only a few configuration
+ directives (SeparateVirtualInterps and SeparateChannel)
+ are ignored because fundamentally incompatible.
+ The bridge is experimental but perfectly fit for many applications,
+ for example it's good on development machines where server restarts
+ are frequent.
+ </p><p style="width:90%">
+ This is the lazy bridge jump table, as such it defines the functions
+ implemented by the bridge.
+ </p><pre class="programlisting">RIVET_MPM_BRIDGE {
+ NULL,
+ Lazy_MPM_ChildInit,
+ Lazy_MPM_Request,
+ Lazy_MPM_Finalize,
+ Lazy_MPM_ExitHandler,
+ Lazy_MPM_Interp
+};</pre><p style="width:90%">
+ After the server initialization stage, child processes read the configuration
+ and modules build their own configuration representation. MPM bridges hooks into
+ this stage to store and/or build data structures relevant to their design.
+ A fundamental information built during this stage is the database of virtual hosts.
+ The lazy bridge keeps an array of virtual host descriptor pointers
+ each of them referencing an instance of the following structure.
+ </p><pre class="programlisting">/* virtual host descriptor */
+
+typedef struct vhost_iface {
+ int idle_threads_cnt; /* idle threads for the virtual hosts */
+ int threads_count; /* total number of running and idle threads */
+ apr_thread_mutex_t* mutex; /* mutex protecting 'array' */
+ apr_array_header_t* array; /* LIFO array of lazy_tcl_worker pointers */
+} vhost;</pre><p style="width:90%">
+ A pointer to this array is stored in the bridge status structure which a basic
+ structure that likely every bridge has to create.
+ </p><pre class="programlisting">/* Lazy bridge internal status data */
+
+typedef struct mpm_bridge_status {
+ apr_thread_mutex_t* mutex;
+ int exit_command;
+ int exit_command_status;
+ int server_shutdown; /* the child process is shutting down */
+ vhost* vhosts; /* array of vhost descriptors */
+} mpm_bridge_status;</pre><p style="width:90%">
+ By design the bridge must create exactly one instance of this structure and store its pointer
+ in <span style="font-family:monospace"><span class="command"><strong>module_globals->mpm</strong></span></span>. This is usually done
+ at the very beginning of the child init script function pointed by
+ <span style="font-family:monospace"><span class="command"><strong>mpm_child_init</strong></span></span> in
+ the <span style="font-family:monospace"><span class="command"><strong>rivet_bridge_table</strong></span></span> structure. For the lazy bridge this field
+ in the jump table points to <span style="font-family:monospace"><span class="command"><strong>Lazy_MPM_ChildInit</strong></span></span>
+ </p><pre class="programlisting">void Lazy_MPM_ChildInit (apr_pool_t* pool, server_rec* server)
+{
+ ...
+
+ module_globals->mpm = apr_pcalloc(pool,sizeof(mpm_bridge_status));
+
+ ....
+}</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idm4500"></a>Handling Tcl's exit core command</h3></div></div></div><p style="width:90%">
+ Most of the fields in the <span style="font-family:monospace"><span class="command"><strong>mpm_bridge_status</strong></span></span> are meant to deal
+ with the child exit process. Rivet supersedes the Tcl core's exit function
+ with a <span style="font-family:monospace"><span class="command"><strong>::rivet::exit</strong></span></span> function and it does so in order to curb the effects
+ of the core function that would force a child process to immediately exit.
+ This could have unwanted side effects, like skipping the execution of important
+ code dedicated to release locks or remove files. For threaded MPMs the abrupt
+ child process termination could be even more disruptive as all the threads
+ will be deleted without warning.
+ </p><p style="width:90%">
+ The <span style="font-family:monospace"><span class="command"><strong>::rivet::exit</strong></span></span> implementation calls the function pointed by
+ <span style="font-family:monospace"><span class="command"><strong>mpm_exit_handler</strong></span></span> which is bridge specific. Its main duty
+ is to take the proper action in order to release resources and force the
+ bridge controlled threads to exit.
+ </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top">
+ Nonetheless the <span style="font-family:monospace"><span class="command"><strong>exit</strong></span></span> command should be avoided in ordinary mod_rivet
+ programming. We cannot stress this point enough. If your application must bail out
+ for some reason focus your attention on the design to find the most appropriate
+ route to exit and whenever possible avoid
+ calling <span style="font-family:monospace"><span class="command"><strong>exit</strong></span></span> at all (which basically wraps a
+ C call to Tcl_Exit). Anyway the Rivet implementation partially transforms
+ <span style="font-family:monospace"><span class="command"><strong>exit</strong></span></span> in a sort of special <span style="font-family:monospace"><span class="command"><strong>::rivet::abort_page</strong></span></span>
+ implementation whose eventual action is to call the <span style="font-family:monospace"><span class="command"><strong>Tcl_Exit</strong></span></span>
+ library call. See the <span style="font-family:monospace"><span class="command"><strong><a class="xref" href="exit.html" title="exit">exit</a></strong></span></span>
+ command for further explanations.
+ </td></tr></table></div><p style="width:90%">
+ Both the worker bridge and lazy bridge
+ implementations of <span style="font-family:monospace"><span class="command"><strong>mpm_exit_handler</strong></span></span> call the function pointed
+ by <span style="font-family:monospace"><span class="command"><strong>mpm_finalize</strong></span></span> which also the function called by the framework
+ when the web server shuts down.
+ See these functions' code for further details, they are very easy to
+ read and understand
+ </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idm4519"></a>HTTP request processing with the lazy bridge</h3></div></div></div><p style="width:90%">
+ Requests processing with the lazy bridge is done by determining for which
+ virtual host a request was created. The <span style="font-family:monospace"><span class="command"><strong>rivet_server_conf</strong></span></span>
+ structure keeps a numerical index for each virtual host. This index is used
+ to reference the virtual host descriptor and from it the request
+ handler tries to gain lock on the mutex protecting the array of <span style="font-family:monospace"><span class="command"><strong>lazy_tcl_worker</strong></span></span>
+ structure pointers. Each instance of this structure is a descriptor of a thread created for
+ a specific virtual host; threads available for processing have their descriptor
+ on that array and the handler callback will pop the first
+ <span style="font-family:monospace"><span class="command"><strong>lazy_tcl_worker</strong></span></span> pointer to signal the thread
+ there is work to do for it. This is the <span style="font-family:monospace"><span class="command"><strong>lazy_tcl_worker</strong></span></span> structure
+ </p><pre class="programlisting">/* lazy bridge Tcl thread status and communication variables */
+
+typedef struct lazy_tcl_worker {
+ apr_thread_mutex_t* mutex;
+ apr_thread_cond_t* condition;
+ int status;
+ apr_thread_t* thread_id;
+ server_rec* server;
+ request_rec* r;
+ int ctype;
+ int ap_sts;
+ int nreqs;
+ rivet_server_conf* conf; /* rivet_server_conf* record */
+} lazy_tcl_worker;</pre><p style="width:90%">
+ The server field is assigned with the virtual host server record. Whereas the <span style="font-family:monospace"><span class="command"><strong>conf</strong></span></span>
+ field keeps the pointer to a run time computed <span style="font-family:monospace"><span class="command"><strong>rivet_server_conf</strong></span></span>. This structure
+ may change from request to request because <span style="font-family:monospace"><span class="command"><strong><Directory ...>...</Directory></strong></span></span> could
+ change the configuration with directory specific directive values
+ </p><p style="width:90%">
+ The Lazy bridge will not start any Tcl worker thread at server startup, but it will
+ wait for requests to come in and they are handed down to a worker threads by popping
+ a lazy_tcl_worker pointer from the related array in the virtual hosts database or,
+ in case the array is empty and no threads are available, a new worker thread is
+ created. The code in the <span style="font-family:monospace"><span class="command"><strong>Lazy_MPM_Request</strong></span></span> function
+ </p><pre class="programlisting"> lazy_tcl_worker* w;
+ ...
+ apr_array_header_t* array;
+ apr_thread_mutex_t* mutex;
+
+ mutex = module_globals->mpm->vhosts[conf->idx].mutex;
+ array = module_globals->mpm->vhosts[conf->idx].array;
+ apr_thread_mutex_lock(mutex);
+
+ ...
+
+ /* If the array is empty we create a new worker thread */
+
+ if (apr_is_empty_array(array))
+ {
+ w = create_worker(module_globals->pool,r->server);
+ (module_globals->mpm->vhosts[conf->idx].threads_count)++;
+ }
+ else
+ {
+ w = *(lazy_tcl_worker**) apr_array_pop(array);
+ }
+ apr_thread_mutex_unlock(mutex);
+
+ ...</pre><p style="width:90%">
+ After a request is processed the Tcl worker thread returns its own
+ lazy_tcl_worker descriptor to the array and then waits
+ on the condition variable used to control and synchronize the bridge
+ threads with the Apache worker threads.
+ </p><pre class="programlisting"> /* rescheduling itself in the array of idle threads */
+
+ apr_thread_mutex_lock(module_globals->mpm->vhosts[idx].mutex);
+ *(lazy_tcl_worker **) apr_array_push(module_globals->mpm->vhosts[idx].array) = w;
+ apr_thread_mutex_unlock(module_globals->mpm->vhosts[idx].mutex);</pre><p style="width:90%">
+ The lazy bridge <span style="font-family:monospace"><span class="command"><strong>module_globals->bridge_jump_table->mpm_thread_interp</strong></span></span>, which
+ is supposed to return the rivet_thread_interp structure pointer relevant to a given
+ request, has a straightforward task to do since by design each thread has
+ one interpreter
+ </p><pre class="programlisting">rivet_thread_interp* Lazy_MPM_Interp(rivet_thread_private *private,
+ rivet_server_conf* conf)
+{
+ return private->ext->interp;
+}</pre><p style="width:90%">
+ As already pointed out
+ running this bridge you get separate virtual interpreters and separate channels by default
+ and since by design each threads gets its own Tcl interpreter and Rivet channel you will
+ not be able to revert this behavior in the configuration with
+ </p><pre class="programlisting">SeparateVirtualInterps Off
+SeparateChannels Off</pre><p style="width:90%">
+ which are simply ignored
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="internals.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">Rivet Internals </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/lempty.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/lempty.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/lempty.html (added)
+++ tcl/site/rivet/manual3.0/lempty.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,7 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>lempty</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="lassign_array.html" title="lassign_array"><link rel="next" href="lmatch.html" title="lmatch"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">lempty</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lassign_array.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="lmatch.html"><img src="images/next.png" alt="Next"></a></td>
</tr></table></div><div class="refentry"><div class="refentry.separator"><hr></div><a name="lempty"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>lempty â
+ Returns 1 if <list> is empty or 0 if it has any elements.
+ This command emulates the TclX lempty command.
+ </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::lempty</span> <span style="font-family:monospace; font-weight: bold;">list</span> </div></div></div><div class="refsect1"><a name="idm1367"></a><h2>Description</h2><p style="width:90%">
+ Returns 1 if <list> is empty or 0 if it has any elements.
+ This command emulates the TclX lempty command.
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lassign_array.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="lmatch.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">lassign_array </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> lmatch</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/lmatch.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/lmatch.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/lmatch.html (added)
+++ tcl/site/rivet/manual3.0/lmatch.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,14 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>lmatch</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="lempty.html" title="lempty"><link rel="next" href="load_cookies.html" title="load_cookies"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">lmatch</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lempty.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="load_cookies.html"><img src="images/next.png" alt="Next"></a></td></t
r></table></div><div class="refentry"><div class="refentry.separator"><hr></div><a name="lmatch"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>lmatch â
+ Look for elements in <list> that match <pattern>
+ </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::lmatch</span> (<span style="font-family:monospace; font-weight: bold;">-exact</span> | <span style="font-family:monospace; font-weight: bold;">-glob</span> | <span style="font-family:monospace; font-weight: bold;">-regexp</span>) <span style="font-family:monospace; font-weight: bold;">list</span> <span style="font-family:monospace; font-weight: bold;">pattern</span> </div></div></div><div class="refsect1"><a name="idm1383"></a><h2>Description</h2><p style="width:90%">
+ Look for elements in <list> that match <pattern>.
+ This command is a decent replacement for TclX lmatch command when TclX is
+ not available
+ </p><p style="width:90%">
+ In the following example a regular expression is matched against
+ each element in the input list and a list containing the matching
+ elements is returned
+ </p><p style="width:90%">
+ </p><pre class="programlisting">::rivet::lmatch -regexp { aaxa bxxb ccxxxxcc } {.+[x]{2}.+}
+bxxb ccxxxxcc</pre><p style="width:90%">
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lempty.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="load_cookies.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">lempty </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> load_cookies</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/load_cookies.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/load_cookies.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/load_cookies.html (added)
+++ tcl/site/rivet/manual3.0/load_cookies.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,5 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>load_cookies</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="lmatch.html" title="lmatch"><link rel="next" href="load_env.html" title="load_env"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">load_cookies</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lmatch.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="load_env.html"><img src="images/next.png" alt="Next"></a></td></t
r></table></div><div class="refentry"><div class="refentry.separator"><hr></div><a name="load_cookies"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>load_cookies â get any cookie variables sent by the client.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::load_cookies</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>array_name</code></em></span>?</div></div></div><div class="refsect1"><a name="idm1398"></a><h2>Description</h2></div><p style="width:90%">
+ Load the array of cookie variables into the specified
+ array name. Uses array cookies by
+ default.
+ </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lmatch.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="load_env.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">lmatch </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> load_env</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/load_env.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/load_env.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/load_env.html (added)
+++ tcl/site/rivet/manual3.0/load_env.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,10 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>load_env</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="load_cookies.html" title="load_cookies"><link rel="next" href="load_headers.html" title="load_headers"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">load_env</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="load_cookies.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="load_headers.html"><img src="images/next.png" a
lt="Next"></a></td></tr></table></div><div class="refentry"><div class="refentry.separator"><hr></div><a name="load_env"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>load_env â get the request's environment variables.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::load_env</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>array_name</code></em></span>?</div></div></div><div class="refsect1"><a name="idm1411"></a><h2>Description</h2><p style="width:90%">
+ Load the array of environment variables into the specified
+ array name. Uses array ::request::env by
+ default.
+ </p><p style="width:90%">
+ As Rivet pages are run in the ::request
+ namespace, it isn't necessary to qualify the array name
+ for most uses - it's ok to access it as
+ env.
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="load_cookies.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="load_headers.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">load_cookies </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> load_headers</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/load_headers.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/load_headers.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/load_headers.html (added)
+++ tcl/site/rivet/manual3.0/load_headers.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,5 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>load_headers</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="load_env.html" title="load_env"><link rel="next" href="load_response.html" title="load_response"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">load_headers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="load_env.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="load_response.html"><img src="images/next.png" al
t="Next"></a></td></tr></table></div><div class="refentry"><div class="refentry.separator"><hr></div><a name="load_headers"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>load_headers â get client request's headers.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::load_headers</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>array_name</code></em></span>?</div></div></div><div class="refsect1"><a name="idm1427"></a><h2>Description</h2><p style="width:90%">
+ Load the headers that come from a client request into the
+ provided array name, or use headers if no
+ name is provided.
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="load_env.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="load_response.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">load_env </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> load_response</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/load_response.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/load_response.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/load_response.html (added)
+++ tcl/site/rivet/manual3.0/load_response.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,27 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>load_response</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="load_headers.html" title="load_headers"><link rel="next" href="lremove.html" title="lremove"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">load_response</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="load_headers.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="lremove.html"><img src="images/next.png" alt="N
ext"></a></td></tr></table></div><div class="refentry"><div class="refentry.separator"><hr></div><a name="load_response"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>load_response â load form variables into an array.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::load_response</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>arrayName</code></em></span>?</div></div></div><div class="refsect1"><a name="idm1440"></a><h2>Description</h2><p style="width:90%">
+ Load any form variables passed to this page into an
+ array. If <span style="font-family:monospace"><span class="command"><strong>load_response</strong></span></span> is called without
+ arguments the array response is created in
+ the scope of the caller. If the variables var1,var2,var3...
+ having values val1,val2,val3... are passed to the page, the
+ resulting array will be a collection mapping var1,var2,var3...
+ to their corresponding values. <span style="font-family:monospace"><span class="command"><strong>load_response</strong></span></span>
+ was inspired by the same NeoWebScript procedure in the way
+ it deals with multiple assignments: if a variable
+ is assigned more than once the corresponding array element will be a
+ list of the values for the variable. This can be useful in the case
+ of forms with checkbox options that are given the same name.
+ This condition is signalled by the presence of an auxiliary array
+ variable.
+ </p><p style="width:90%">
+ Example: if a group of checkboxes are associated to the var1
+ variable then <span style="font-family:monospace"><span class="command"><strong>response(var1)</strong></span></span> will store
+ the list of their values and the array will also have the extra variable
+ response(__var1) which can be tested with
+ the usual <span style="font-family:monospace"><span class="command"><strong>[info exists response(__var1)]</strong></span></span>
+ </p><p style="width:90%">
+ Calling <span style="font-family:monospace"><span class="command"><strong>load_response</strong></span></span> several times for the same
+ array results in adding more values to the array at every call.
+ When needed it is left to the caller to empty the array between
+ two subsequent calls.
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="load_headers.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="lremove.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">load_headers </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> lremove</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/lremove.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/lremove.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/lremove.html (added)
+++ tcl/site/rivet/manual3.0/lremove.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,12 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>lremove</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="load_response.html" title="load_response"><link rel="next" href="makeurl.html" title="makeurl"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">lremove</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="load_response.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="makeurl.html"><img src="images/next.png" alt="Next"></a>
</td></tr></table></div><div class="refentry"><div class="refentry.separator"><hr></div><a name="lremove"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>lremove â remove from a list elements matching one or more patterns</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><span style="font-family:monospace"><span class="command"><strong>::rivet::lremove</strong></span></span> (<span style="font-family:monospace; font-weight: bold;">-regexp | -glob | -exact</span>) <span style="font-family:monospace; font-weight: bold;">list</span> <span style="font-family:monospace; font-weight: bold;">pattern</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>pattern</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>pattern</code></em></span>?</div><div class="refsect1"><a name="idm1468"></a><h2>Description</h2><p style="width:90%">
+ <span style="font-family:monospace"><span class="command"><strong>lremove</strong></span></span> removes from list ?<span style="font-family:monospace; font-weight: bold;">list</span>? the first occurrence
+ of an element matching one of the patterns listed in the command line. By specifying the
+ -all option every occurrence of one the patterns is removed
+ </p><p style="width:90%">
+ Pattern matching can be -exact,-glob style or following
+ regular expressions (-regexp). These options are globally valid across the
+ whole pattern list (default is glob style matching)
+ </p><pre class="programlisting">::rivet::lremove -all -regexp {aa e111 bab aa} aa e111 bab
+e111 bab
+::rivet::lremove -all -regexp {aa e111 bab aa} aa "e\\d+"
+bab</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="load_response.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="makeurl.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">load_response </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> makeurl</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/makeurl.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/makeurl.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/makeurl.html (added)
+++ tcl/site/rivet/manual3.0/makeurl.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,17 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>makeurl</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="lremove.html" title="lremove"><link rel="next" href="no_body.html" title="no_body"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">makeurl</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lremove.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="no_body.html"><img src="images/next.png" alt="Next"></a></td></tr></table>
</div><div class="refentry"><div class="refentry.separator"><hr></div><a name="makeurl"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>makeurl â construct url's based on hostname, port.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::makeurl</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>filename</code></em></span>?</div></div></div><div class="refsect1"><a name="idm1488"></a><h2>Description</h2><p style="width:90%">
+ Create a self referencing URL from a filename. <span style="font-family:monospace"><span class="command"><strong>makeurl</strong></span></span>
+ can be used in three ways
+ </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">With no arguments the current script URL is returned</li><li class="listitem">
+ The argument is a relative path: the command returns
+ the argument prefixed with the current script's URL
+ </li><li class="listitem">
+ The argument is an absolute path: the full URL to the resource is returned
+ </li></ul></div><p style="width:90%">
+ </p><p style="width:90%">
+ Example with an absolute path:
+ </p><pre class="programlisting">::rivet::makeurl /tclp.gif</pre><p style="width:90%"> returns
+ <code class="computeroutput">http://[hostname]:[port]/tclp.gif</code>.
+ where hostname and port are the hostname and port of the
+ server in question. The protocol prefix is inferred from the protocol
+ in the URL referencing the script.
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lremove.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="no_body.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">lremove </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> no_body</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/no_body.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/no_body.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/no_body.html (added)
+++ tcl/site/rivet/manual3.0/no_body.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,5 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>no_body</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="makeurl.html" title="makeurl"><link rel="next" href="parray.html" title="parray"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">no_body</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="makeurl.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="parray.html"><img src="images/next.png" alt="Next"></a></td></tr></table></d
iv><div class="refentry"><div class="refentry.separator"><hr></div><a name="no_body"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>no_body â Prevents Rivet from sending any content.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::no_body</span> </div></div></div><div class="refsect1"><a name="idm1506"></a><h2>Description</h2><p style="width:90%">
+ This command is useful for situations where it is necessary
+ to only return HTTP headers and no actual content. For
+ instance, when returning a 304 redirect.
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="makeurl.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="parray.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">makeurl </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> parray</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/parray.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/parray.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/parray.html (added)
+++ tcl/site/rivet/manual3.0/parray.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,6 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>parray</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="no_body.html" title="no_body"><link rel="next" href="parse.html" title="parse"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">parray</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="no_body.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="parse.html"><img src="images/next.png" alt="Next"></a></td></tr></table></div><d
iv class="refentry"><div class="refentry.separator"><hr></div><a name="parray"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>parray â Tcl's <span style="font-family:monospace"><span class="command"><strong>parray</strong></span></span> with html formatting.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::parray</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>arrayName</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>?<span class="optional">pattern</span>?</code></em></span>?</div></div></div><div class="refsect1"><a name="idm1522"></a><h2>Description</h2><p style="width:90%">
+ An html version of the standard Tcl
+ <span style="font-family:monospace"><span class="command"><strong>parray</strong></span></span> command. Displays the entire
+ contents of an array in a sorted, nicely-formatted way.
+ Mostly used for debugging purposes.
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="no_body.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="parse.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">no_body </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> parse</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/parse.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/parse.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/parse.html (added)
+++ tcl/site/rivet/manual3.0/parse.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,5 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>parse</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="parray.html" title="parray"><link rel="next" href="raw_post.html" title="raw_post"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">parse</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parray.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="raw_post.html"><img src="images/next.png" alt="Next"></a></td></tr></table></di
v><div class="refentry"><div class="refentry.separator"><hr></div><a name="parse"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>parse â parses a Rivet template file.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::parse</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>filename</code></em></span>?</div></div></div><div class="refsect1"><a name="idm1535"></a><h2>Description</h2><p style="width:90%">
+ Like the Tcl <span style="font-family:monospace"><span class="command"><strong>source</strong></span></span> command, but also
+ parses for Rivet <? and ?> processing tags. Using
+ this command, you can use one .rvt file from another.
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="parray.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="raw_post.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">parray </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> raw_post</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/processing.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/processing.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/processing.html (added)
+++ tcl/site/rivet/manual3.0/processing.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,225 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Apache Rivet HTTP Request Processing</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="index.html" title="Apache Rivet 3.0"><link rel="prev" href="directives.html" title="Apache Rivet 3.0 Configuration"><link rel="next" href="request.html" title="Apache Child Processes Lifecycle and Request Processing"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Apache Rivet HTTP Request Processing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="directives.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Â </th><td width="20%" align="right">Â <a access
key="n" href="request.html"><img src="images/next.png" alt="Next"></a></td></tr></table></div><div class="section"><div class="titlepage"><div><div><hr><h2 class="title" style="clear: both"><a name="processing"></a>Apache Rivet HTTP Request Processing</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idm574"></a>Tcl Scripts Processing</h3></div></div></div><p style="width:90%">
+ The mod_rivet 2.0,2.1,2.2,2.3 modules handle an HTTP request
+ by running a Tcl script or a Rivet (.rvt file) template
+ whose path appears encoded in the URI (an alias translation or
+ URL rewriting might occur to establish the real path).
+ The execution of such scripts can be preceded and/or
+ followed by the execution scripts common to every path
+ configured through the BeforeScript and AfterScript
+ directives. These scripts can be configured on a per virtual host,
+ per directory or per user basis. Execution of such combined
+ scripts can break because of coding errors (thus triggering the
+ ErrorScript execution) or it can deliberately interrupt
+ ordinary execution by calling ::rivet::abort_page (triggering
+ the execution of a script defined by the directive AbortScript).
+ This scheme is in case
+ terminated by a further configurable script (AfterEveryScript).
+ In mod_rivet 2.x module series
+ this model of request handling was coded within
+ the module mod_rivet.so itself.
+ </p><p style="width:90%">
+ With Rivet 3.0 we changed this approach and landed to
+ a new much simpler and flexible model where each request is
+ by default handled by the following Tcl procedure
+ </p><pre class="programlisting"># -- request_handler.tcl
+#
+# Copyright 2002-2017 The Apache Rivet Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# code of the default handler of HTTP requests
+
+ ::try {
+ ::Rivet::initialize_request
+ } on error {err} {
+ ::rivet::apache_log_error crit \
+ "Rivet request initialization failed: $::errorInfo"
+ }
+
+ ::try {
+
+ set script [::rivet::inspect BeforeScript]
+ if {$script ne ""} {
+ set ::Rivet::script $script
+ eval $script
+ }
+
+ set script [::rivet::url_script]
+ if {$script ne ""} {
+ set ::Rivet::script $script
+ namespace eval ::request $script
+ }
+
+ set script [::rivet::inspect AfterScript]
+ if {$script ne ""} {
+ set ::Rivet::script $script
+ eval $script
+ }
+
+ } trap {RIVET ABORTPAGE} {err opts} {
+ ::Rivet::finish_request $script $err $opts AbortScript
+ } trap {RIVET THREAD_EXIT} {err opts} {
+ ::Rivet::finish_request $script $err $opts AbortScript
+ } on error {err opts} {
+ ::Rivet::finish_request $script $err $opts
+ } finally {
+ ::Rivet::finish_request $script "" "" AfterEveryScript
+ }
+
+# default_request_handler.tcl ---
+</pre><p style="width:90%">
+ Note the call to new 3.0 command ::rivet::url_script
+ that returns the body of the Tcl script or Rivet template
+ pointed by the URL.
+ </p><p style="width:90%">
+ This procedure emulates the 2.x scheme
+ and as such works as a fully compatible request handling
+ but opens to the programmers the option of replacing it
+ with their own application request handling procedure
+ </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top">
+ Note that if you redefine the core request handler
+ you'll need to handle yourself any error conditions
+ and any code interruption brought about by calling
+ <span style="font-family:monospace"><span class="command"><strong>::rivet::abort_page</strong></span></span>.
+ The current procedure might work as a template to be
+ reworked and used as a template to develop your own
+ request handler.
+ </td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idm583"></a>Example: basic OO Rivet Application</h3></div></div></div><p style="width:90%">
+ An applications may have no interest in running
+ a script pointed by the URL as in the traditional approach
+ followed by rivet inspired to the PHP philosophy of <span class="quote">â<span class="quote">scripting
+ the HTML</span>â</span>. A web based application
+ could be driven entirely by the URL encoded arguments and by the
+ data POSTed with HTML forms, still retaining the ability of exploiting
+ the template engine of Rivet through the <span style="font-family:monospace"><span class="command"><strong>::rivet::parse</strong></span></span>.
+ In other words an application could hinge on a single entry point to
+ handle requests, regardless the complexity of its internal design.
+ </p><p style="width:90%">This section shows a template for such an application
+ (let's call it MyRivetApp) based on an Itcl (or TclOO for what
+ it matters) object instance. In myrivetapp.tcl
+ the application class is defined and an instance of it is
+ created in the global namespace.
+ </p><pre class="programlisting">## myrivetapp.tcl --
+#
+# Application class definition and instance creation
+#
+
+package require Itcl
+
+::itcl::class MyRivetApp {
+
+ private variable application_name
+
+ public method init {}
+ public method request_processing {urlencoded_args}
+
+}
+
+::itcl::body MyRivetApp::init {app_name}{
+
+ # any initialization steps must go here
+ # ....
+
+ set application_name $app_name
+
+}
+
+::itcl::body MyRivetApp::request_processing {urlencoded_args} {
+
+ # the whole application code will run from this method
+ ...
+
+}
+
+set ::theApplication [MyRivetApp #auto]
+
+$::theApplication init [dict get [::rivet::inspect server] hostname]
+
+# -- myrivetapp.tcl
+</pre><p style="width:90%">
+ which provides a very basic interface for both initialization
+ and request processing. Such script will be sourced into the
+ Tcl interpreter at the mod_rivet initialization stage. In the
+ Apache configuration (most likely within a <VirtualHost myrivetapp.com:80>...</VirtualHost>
+ definition block)
+ </p><pre class="programlisting"><IfModule rivet_module>
+ RivetServerConf ChildInitScript "source myrivetapp.tcl"
+</IfModule></pre><p style="width:90%">
+ By running this script when an a thread is started
+ we set it up to respond requests, but we still need to
+ tell mod_rivet what code will eventually handle requests
+ and how the method MyRivetApp::request_processing will
+ be called with appropriate arguments
+ </p><pre class="programlisting"># -- myapp_request_handler.tcl
+#
+# This script will be read by mod_rivet at the thread initialization
+# stage and its content stored in a Tcl_Obj object. This object will
+# be evaluated calling Tcl_EvalObjExe
+#
+
+::try {
+
+ $::theApplication request_processing [::rivet::var_qs all]
+
+} trap {RIVET ABORTPAGE} {err opts} {
+
+ set abort_code [::rivet::abort_code]
+
+ switch $abort_code {
+ code1 {
+ # handling abort_page with code1
+ ....
+ }
+ code2 {
+ # handling abort_page with code2
+ ....
+ }
+ # ...
+ default {
+ # default abort handler
+ }
+ }
+
+} trap {RIVET THREAD_EXIT} {err opts} {
+
+ # myApplication sudden exit handler
+ ...
+
+} on error {err opts} {
+
+ # myApplication error handler
+ ...
+
+} finally {
+
+ # request processing final elaboration
+
+}
+
+# -- myapp_request_handler.tcl
+</pre></div><p style="width:90%">
+ Finally we have to tell mod_rivet to run this script when a
+ request is delivered to myApplication and we do so
+ using the 3.0 directive <span style="font-family:monospace"><span class="command"><strong>RequestHandler</strong></span></span>
+ </p><pre class="programlisting"><IfModule rivet_module>
+ RivetServerConf ChildInitScript "source myrivetapp.tcl"
+ RivetServerConf RequestHandler "myapp_request_handler.tcl"
+</IfModule></pre><p style="width:90%">
+ Notice that the argument of the directive <span style="font-family:monospace"><span class="command"><strong>RequestHandler</strong></span></span>
+ is a file name not a Tcl script as for <span style="font-family:monospace"><span class="command"><strong>ChildInitScript</strong></span></span>
+ </p><p style="width:90%">
+ With such approach only the <span style="font-family:monospace"><span class="command"><strong>ChildInitScript</strong></span></span>, <span style="font-family:monospace"><span class="command"><strong>ChildExitScript</strong></span></span>
+ and <span style="font-family:monospace"><span class="command"><strong>GlobalInitScript</strong></span></span> configuration directives are effective, while
+ the effect of other handler is devolved to our request handler script.
+ </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="directives.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="request.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Apache Rivet 3.0 Configuration </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Apache Child Processes Lifecycle and Request Processing</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/raw_post.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/raw_post.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/raw_post.html (added)
+++ tcl/site/rivet/manual3.0/raw_post.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,4 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>raw_post</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="parse.html" title="parse"><link rel="next" href="redirect.html" title="redirect"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">raw_post</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parse.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="redirect.html"><img src="images/next.png" alt="Next"></a></td></tr></table><
/div><div class="refentry"><div class="refentry.separator"><hr></div><a name="raw_post"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>raw_post â get the unmodified body of a POST request sent by the client.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::raw_post</span> </div></div></div><div class="refsect1"><a name="idm1546"></a><h2>Description</h2></div><p style="width:90%">
+ Returns the raw POST data from the request. If the request was
+ not a POST or there is no data, then "" - an empty string - is returned.
+ </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="parse.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="redirect.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">parse </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> redirect</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/read_file.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/read_file.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/read_file.html (added)
+++ tcl/site/rivet/manual3.0/read_file.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,6 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>read_file</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="redirect.html" title="redirect"><link rel="next" href="try.html" title="try"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">read_file</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="redirect.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="try.html"><img src="images/next.png" alt="Next"></a></td></tr></table></div
><div class="refentry"><div class="refentry.separator"><hr></div><a name="read_file"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>read_file â
+ Read the entire contents of a file and return it as a string.
+ </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::read_file</span> ?<span style="font-family:monospace; font-weight: bold;">file name</span>?</div></div></div><div class="refsect1"><a name="idm1587"></a><h2>Description</h2><p style="width:90%">
+ This is a utility command which loads the entire content of
+ a file and returns it as a result.
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="redirect.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="try.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">redirect </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> try</td></tr></table></div></body></html>
Added: tcl/site/rivet/manual3.0/redirect.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/redirect.html?rev=1821429&view=auto
==============================================================================
--- tcl/site/rivet/manual3.0/redirect.html (added)
+++ tcl/site/rivet/manual3.0/redirect.html Wed Jan 17 22:31:48 2018
@@ -0,0 +1,25 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>redirect</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.0"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="raw_post.html" title="raw_post"><link rel="next" href="read_file.html" title="read_file"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">redirect</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="raw_post.html"><img src="images/prev.png" alt="Prev"></a>Â </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right">Â <a accesskey="n" href="read_file.html"><img src="images/next.png" alt="Next"></a></td></
tr></table></div><div class="refentry"><div class="refentry.separator"><hr></div><a name="redirect"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>redirect â Interrupt processing and divert to a new URL</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::redirect</span> ?<span style="font-family:monospace; font-weight: bold;">URL</span>? ?<span style="font-family:monospace; font-weight: bold;">permanent</span>?</div></div></div><div class="refsect1"><a name="idm1558"></a><h2>Description</h2><p style="width:90%">
+ <span style="font-family:monospace"><span class="command"><strong>::rivet::redirect</strong></span></span> diverts the browser to a new URL and marks
+ the redirection as either permanent in the browser local cache or
+ non permanent (default).
+ Calling <span style="font-family:monospace"><span class="command"><strong>::rivet::redirect</strong></span></span> causes the script execution to interrupt
+ and control passes to <span style="font-family:monospace"><span class="command"><strong>AbortScript</strong></span></span>, if such script is
+ set, by calling <span style="font-family:monospace"><span class="command"><strong>::rivet::abort_page</strong></span></span> and passing as abort
+ code a dictionary with 2 keys:
+ </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><span style="font-family:monospace"><span class="command"><strong>error_code</strong></span></span>: string literal 'redirect'</li><li class="listitem"><span style="font-family:monospace"><span class="command"><strong>location</strong></span></span>: the URL the browser will be redirected to</li></ul></div><p style="width:90%">
+ </p><p style="width:90%">
+ <span style="font-family:monospace"><span class="command"><strong>::rivet::redirect</strong></span></span> drives the redirection by setting the
+ 301 (permanent = 1: permanent redirect) or 302 (permanent = 0: non permanent redirect) and
+ attempts to discard the output the script might have already placed in the
+ stdout channel buffer. The <span class="quote">â<span class="quote">permanent</span>â</span> argument can also be any of the
+ other HTTP status codes. This is handy for returning one the 3xx status codes
+ dedicated to the HTTP request redirection
+
+ The command can fail if
+ </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">A <span style="font-family:monospace"><span class="command"><strong>flush stdout</strong></span></span> was called before <span style="font-family:monospace"><span class="command"><strong>::rivet::redirect</strong></span></span>
+ thus causing the HTTP headers to be sent and preventing any possibility to
+ manipulate them</li><li class="listitem">The channel buffer was filled causing Tcl to
+ flush the channel</li></ul></div><p style="width:90%">
+ The <span style="font-family:monospace"><span class="command"><strong>stdout</strong></span></span> channel, like any Tcl channels, can be manipulated
+ and if needed its internal buffer stretched.
+ </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="raw_post.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="read_file.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">raw_post </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> read_file</td></tr></table></div></body></html>
---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org