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/23 22:10:56 UTC

svn commit: r1822064 - in /tcl/site/rivet/manual3.0: index.html installation.html lazybridge.html try.html

Author: mxmanghi
Date: Tue Jan 23 22:10:56 2018
New Revision: 1822064

URL: http://svn.apache.org/viewvc?rev=1822064&view=rev
Log:
further improvements in the manual

Modified:
    tcl/site/rivet/manual3.0/index.html
    tcl/site/rivet/manual3.0/installation.html
    tcl/site/rivet/manual3.0/lazybridge.html
    tcl/site/rivet/manual3.0/try.html

Modified: tcl/site/rivet/manual3.0/index.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/index.html?rev=1822064&r1=1822063&r2=1822064&view=diff
==============================================================================
--- tcl/site/rivet/manual3.0/index.html (original)
+++ tcl/site/rivet/manual3.0/index.html Tue Jan 23 22:10:56 2018
@@ -38,8 +38,8 @@
 	            	print large ASCII glyphs
 	            </span></dt><dt><span class="section"><a href="asciiglyphs.html#idm4177">Example</a></span></dt></dl></dd><dt><span class="section"><a href="formbroker.html">The Form Broker</a></span></dt><dd><dl><dt><span class="section"><a href="formbroker.html#idm4182">Introduction</a></span></dt><dt><span class="refentrytitle"><a href="fb.html">FormBroker</a></span><span class="refpurpose"> — 
                Form broker object creator
-            </span></dt></dl></dd><dt><span class="section"><a href="help.html">Resources - How to Get Help</a></span></dt><dd><dl><dt><span class="section"><a href="help.html#idm4310">Mailing Lists</a></span></dt><dt><span class="section"><a href="help.html#idm4317">Newsgroup</a></span></dt><dt><span class="section"><a href="help.html#websites">Web Sites</a></span></dt><dt><span class="section"><a href="help.html#idm4337">Bug Tracking System</a></span></dt><dt><span class="section"><a href="help.html#idm4341">IRC</a></span></dt><dt><span class="section"><a href="help.html#idm4344">Editing Rivet Template Files</a></span></dt></dl></dd><dt><span class="section"><a href="internals.html">Rivet Internals</a></span></dt><dd><dl><dt><span class="section"><a href="internals.html#idm4356">Rivet approach to Apache Multiprocessing Models</a></span></dt><dt><span class="section"><a href="internals.html#idm4369">mod_rivet MPM Bridge callbacks</a></span></dt><dt><span class="section"><a href="in
 ternals.html#idm4403">Server Initialization and MPM Bridge</a></span></dt><dt><span class="section"><a href="internals.html#idm4406">RivetChan</a></span></dt><dt><span class="section"><a href="internals.html#idm4411">The <span style="font-family:monospace"><span class="command"><strong>global</strong></span></span> Command</a></span></dt><dt><span class="section"><a href="internals.html#idm4419">Page Parsing, Execution and Caching</a></span></dt><dt><span class="section"><a href="internals.html#idm4427">Extending Rivet by developing C code procedures</a></span></dt><dt><span class="section"><a href="internals.html#idm4451">Debugging Rivet and Apache</a></span></dt></dl></dd><dt><span class="section"><a href="lazybridge.html">Example: the <span class="quote">“<span class="quote">Lazy</span>”</span> bridge</a></span></dt><dd><dl><dt><span class="section"><a href="lazybridge.html#idm4481">The rationale of threaded bridges</a></span></dt><dt><span class="section"><a href="lazy
 bridge.html#idm4485">Lazy bridge data structures</a></span></dt><dt><span class="section"><a href="lazybridge.html#idm4500">Handling Tcl's exit core command</a></span></dt><dt><span class="section"><a href="lazybridge.html#idm4519">HTTP request processing with the lazy bridge</a></span></dt></dl></dd></dl></div><div class="list-of-examples"><p><b>List of Examples</b></p><dl><dt>1. <a href="examples.html#hello_world">Hello World</a></dt><dt>2. <a href="examples.html#idm1925">Generate a Colorful Table</a></dt><dt>3. <a href="examples.html#variable_access">Variable Access</a></dt><dt>4. <a href="examples.html#file_upload">File Upload</a></dt><dt>5. <a href="examples.html#file_download">File Download</a></dt><dt>6. <a href="examples.html#ajax_xml_messaging">XML Messages and Ajax</a></dt><dt>7. <a href="examples.html#calendar_example">A Calendar Utility</a></dt></dl></div><p style="width:90%">
-    	Document revision: $Revision: 1821687 $, last modified 2018-01-20 11:56:35+01:00$ by $Author: mxmanghi $.
+            </span></dt></dl></dd><dt><span class="section"><a href="help.html">Resources - How to Get Help</a></span></dt><dd><dl><dt><span class="section"><a href="help.html#idm4310">Mailing Lists</a></span></dt><dt><span class="section"><a href="help.html#idm4317">Newsgroup</a></span></dt><dt><span class="section"><a href="help.html#websites">Web Sites</a></span></dt><dt><span class="section"><a href="help.html#idm4337">Bug Tracking System</a></span></dt><dt><span class="section"><a href="help.html#idm4341">IRC</a></span></dt><dt><span class="section"><a href="help.html#idm4344">Editing Rivet Template Files</a></span></dt></dl></dd><dt><span class="section"><a href="internals.html">Rivet Internals</a></span></dt><dd><dl><dt><span class="section"><a href="internals.html#idm4356">Rivet approach to Apache Multiprocessing Models</a></span></dt><dt><span class="section"><a href="internals.html#idm4369">mod_rivet MPM Bridge callbacks</a></span></dt><dt><span class="section"><a href="in
 ternals.html#idm4403">Server Initialization and MPM Bridge</a></span></dt><dt><span class="section"><a href="internals.html#idm4406">RivetChan</a></span></dt><dt><span class="section"><a href="internals.html#idm4411">The <span style="font-family:monospace"><span class="command"><strong>global</strong></span></span> Command</a></span></dt><dt><span class="section"><a href="internals.html#idm4419">Page Parsing, Execution and Caching</a></span></dt><dt><span class="section"><a href="internals.html#idm4427">Extending Rivet by developing C code procedures</a></span></dt><dt><span class="section"><a href="internals.html#idm4451">Debugging Rivet and Apache</a></span></dt></dl></dd><dt><span class="section"><a href="lazybridge.html">Example: the <span class="quote">“<span class="quote">Lazy</span>”</span> bridge</a></span></dt><dd><dl><dt><span class="section"><a href="lazybridge.html#idm4481">The rationale of threaded bridges</a></span></dt><dt><span class="section"><a href="lazy
 bridge.html#idm4485">Lazy bridge data structures</a></span></dt><dt><span class="section"><a href="lazybridge.html#idm4501">Handling Tcl's exit core command</a></span></dt><dt><span class="section"><a href="lazybridge.html#idm4520">HTTP request processing with the lazy bridge</a></span></dt></dl></dd></dl></div><div class="list-of-examples"><p><b>List of Examples</b></p><dl><dt>1. <a href="examples.html#hello_world">Hello World</a></dt><dt>2. <a href="examples.html#idm1925">Generate a Colorful Table</a></dt><dt>3. <a href="examples.html#variable_access">Variable Access</a></dt><dt>4. <a href="examples.html#file_upload">File Upload</a></dt><dt>5. <a href="examples.html#file_download">File Download</a></dt><dt>6. <a href="examples.html#ajax_xml_messaging">XML Messages and Ajax</a></dt><dt>7. <a href="examples.html#calendar_example">A Calendar Utility</a></dt></dl></div><p style="width:90%">
+    	Document revision: $Revision: 1821687 $, last modified 2018-01-23 23:09:08+01:00$ by $Author: mxmanghi $.
   	</p><div class="section"><div class="titlepage"><div><div><hr><h2 class="title" style="clear: both"><a name="introduction"></a>Introduction to Apache Rivet version 3.0</h2></div></div></div><p style="width:90%">
       Apache Rivet is a system for creating dynamic web content by
       integrating the 

Modified: tcl/site/rivet/manual3.0/installation.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/installation.html?rev=1822064&r1=1822063&r2=1822064&view=diff
==============================================================================
--- tcl/site/rivet/manual3.0/installation.html (original)
+++ tcl/site/rivet/manual3.0/installation.html Tue Jan 23 22:10:56 2018
@@ -19,7 +19,7 @@
 				and Rivet 3.0 is now able to run with the 
 				<a class="ulink" href="http://httpd.apache.org/docs/2.4/mod/worker.html" target="_top">worker</a> 
             and the
-            <a class="ulink" href="http://httpd.apache.org/docs/2.4/mod/event.html" target="_top">worker</a> 
+            <a class="ulink" href="http://httpd.apache.org/docs/2.4/mod/event.html" target="_top">event</a> 
             MPMs. Rivet 3.0 has not been ported to OS of the Windows family
             but we feel that the current design would fit just fine with the Windows specific
             MPMs such as

Modified: tcl/site/rivet/manual3.0/lazybridge.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/lazybridge.html?rev=1822064&r1=1822063&r2=1822064&view=diff
==============================================================================
--- tcl/site/rivet/manual3.0/lazybridge.html (original)
+++ tcl/site/rivet/manual3.0/lazybridge.html Tue Jan 23 22:10:56 2018
@@ -54,7 +54,7 @@ typedef struct vhost_iface {
     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
+ 		A pointer to this data structure array is stored in the bridge status which a basic
  		structure that likely every bridge has to create.
 	</p><pre class="programlisting">/* Lazy bridge internal status data */
 
@@ -65,12 +65,12 @@ typedef struct mpm_bridge_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-&gt;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>
+		By design the bridge must create exactly one instance of <span style="font-family:monospace"><span class="command"><strong>mpm_bridge_status</strong></span></span>
+		and store its pointer in <span style="font-family:monospace"><span class="command"><strong>module_globals-&gt;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>
+		function
 	</p><pre class="programlisting">/*
  * -- Lazy_MPM_ChildInit
  * 
@@ -87,7 +87,8 @@ void Lazy_MPM_ChildInit (apr_pool_t* poo
 
     module_globals-&gt;mpm = apr_pcalloc(pool,sizeof(mpm_bridge_status));
 
-    /* This mutex is only used to consistently 
+    /* This mutex is only used to consistently carry out these 
+     * two tasks
      *
      *  - set the exit status of a child process (hopefully will be 
      *    unnecessary when Tcl is able again of calling 
@@ -131,7 +132,7 @@ void Lazy_MPM_ChildInit (apr_pool_t* poo
         module_globals-&gt;mpm-&gt;vhosts[vh].threads_count = 0;
     }
     module_globals-&gt;mpm-&gt;server_shutdown = 0;
-}</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%">
+}</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idm4501"></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
@@ -163,7 +164,7 @@ void Lazy_MPM_ChildInit (apr_pool_t* poo
 		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%">
+	</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idm4520"></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
@@ -190,14 +191,16 @@ typedef struct lazy_tcl_worker {
 } 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>&lt;Directory ...&gt;...&lt;/Directory&gt;</strong></span></span> could
-		change the configuration with directory specific directive values
+		may change from request to request because the request configuration changes when the URL may refer 
+		to directory specific configuration in <span style="font-family:monospace"><span class="command"><strong>&lt;Directory ...&gt;...&lt;/Directory&gt;</strong></span></span> 
+		blocks
 	</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
+		wait for requests to come in and then if worker threads are sitting on a virtual host queue
+		a thread's <span style="font-family:monospace"><span class="command"><strong>lazy_tcl_worker</strong></span></span> structure pointer is popped
+		and the request handed to it. If no available thread is on the queue 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> easy to understand and shows
+		how this is working
 	</p><pre class="programlisting">/* -- Lazy_MPM_Request
  *
  * The lazy bridge HTTP request function. This function 
@@ -219,6 +222,14 @@ int Lazy_MPM_Request (request_rec* r,riv
     array = module_globals-&gt;mpm-&gt;vhosts[conf-&gt;idx].array;
     apr_thread_mutex_lock(mutex);
 
+   /* This request may have come while the child process was 
+    * shutting down. We cannot run the risk that incoming requests 
+    * may hang the child process by keeping its threads busy, 
+    * so we simply return an HTTP_INTERNAL_SERVER_ERROR. 
+    * This is hideous and explains why the 'exit' commands must 
+    * be avoided at any costs when programming with mod_rivet
+    */
+
     if (module_globals-&gt;mpm-&gt;server_shutdown == 1) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r,
                       MODNAME ": http request aborted during child process shutdown");

Modified: tcl/site/rivet/manual3.0/try.html
URL: http://svn.apache.org/viewvc/tcl/site/rivet/manual3.0/try.html?rev=1822064&r1=1822063&r2=1822064&view=diff
==============================================================================
--- tcl/site/rivet/manual3.0/try.html (original)
+++ tcl/site/rivet/manual3.0/try.html Tue Jan 23 22:10:56 2018
@@ -23,7 +23,8 @@
 				You can handle the <span class="quote">“<span class="quote">exit</span>”</span> and <span class="quote">“<span class="quote">abort</span>”</span> cases with
 				an <span style="font-family:monospace"><span class="command"><strong>AbortScript</strong></span></span>.
 				See <a class="xref" href="directives.html" title="Apache Rivet 3.0 Configuration">the section called “Apache Rivet 3.0 Configuration”</a>
-			</p><pre class="programlisting">&lt;html&gt;&lt;?::rivet::try {
+			</p><pre class="programlisting">&lt;html&gt;&lt;?
+::rivet::try {
 	if {[::rivet::var_qs exists exit]} {
 	    ::rivet::exit [::rivet::var_qs get exit]
 	} elseif {[::rivet::var_qs exists abort]} {
@@ -42,7 +43,7 @@
    puts "$fd --&amp;gt;&amp;gt; $fv&lt;br/&gt;"
 
   }
- }
+}
 ?&gt;&lt;/html&gt;</pre><p style="width:90%">
 			Placing this code in a file (try.rvt) on the 
 			web server <span class="emphasis"><em>DocumentRoot</em></span> 



---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org