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 2015/01/08 12:27:42 UTC
svn commit: r1650254 - in /tcl/rivet/branches/2.2: ChangeLog
doc/xml/commands.xml doc/xml/directives.xml src/rivetcmds/rivetInspect.c
Author: mxmanghi
Date: Thu Jan 8 11:27:42 2015
New Revision: 1650254
URL: http://svn.apache.org/r1650254
Log:
* doc/xml/commands.xml: documenting the ::rivet::redirect command
* doc/xml/directives.xml: add SeparateChannels directive documentation
* src/rivetcmds/rivetInspect.c: add handling of SeparateChannels/separate_channels configuratio
flag
Modified:
tcl/rivet/branches/2.2/ChangeLog
tcl/rivet/branches/2.2/doc/xml/commands.xml
tcl/rivet/branches/2.2/doc/xml/directives.xml
tcl/rivet/branches/2.2/src/rivetcmds/rivetInspect.c
Modified: tcl/rivet/branches/2.2/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/ChangeLog?rev=1650254&r1=1650253&r2=1650254&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/ChangeLog (original)
+++ tcl/rivet/branches/2.2/ChangeLog Thu Jan 8 11:27:42 2015
@@ -1,3 +1,9 @@
+2015-01-08 Massimo Manghi <mx...@apache.org>
+ * doc/xml/commands.xml: documenting the ::rivet::redirect command
+ * doc/xml/directives.xml: add SeparateChannels directive documentation
+ * src/rivetcmds/rivetInspect.c: add handling of SeparateChannels/separate_channels configuratio
+ flag
+
2015-01-06 Massimo Manghi <mx...@apache.org>
* src/apache-2/mod_rivet.c: handling separate_channel flag to create virtual host specific
Rivet channels
Modified: tcl/rivet/branches/2.2/doc/xml/commands.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/doc/xml/commands.xml?rev=1650254&r1=1650253&r2=1650254&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/doc/xml/commands.xml (original)
+++ tcl/rivet/branches/2.2/doc/xml/commands.xml Thu Jan 8 11:27:42 2015
@@ -1355,7 +1355,51 @@ bab</programlisting>
not a POST or there is no data, then "" - an empty string - is returned.
</para>
</refentry>
-
+ <refentry id="redirect">
+ <refnamediv>
+ <refname>redirect</refname>
+ <refpurpose>Interrupt processing and divert to a new URL</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>::rivet::redirect</command>
+ <arg>URL</arg>
+ <arg>permanent (default: 0)</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <command>::rivet::redirect</command> diverts the browser to a new URL and marks
+ the redirection as either permanent in the browser local cache or
+ non permanent (default).
+ Calling <command>::rivet::redirect</command> causes the script execution to interrupt
+ and control passes to <command>AbortScript</command>, if such script is
+ set, by calling <command>::rivet::abort_page</command> and passing as abort
+ code a dictionary with 2 keys:
+ <itemizedlist>
+ <listitem><command>error_code</command>: string literal 'redirect'</listitem>
+ <listitem><command>location</command>: the URL the browser is about to be redirected</listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <command>::rivet::redirect</command> drives the redirection by setting the
+ 301 (permanent redirect) or 302 (non permanent redirect) HTTP status codes and
+ attempts to discard the output the script might have already placed in the
+ stdout channel buffer. Therefore the command can fail if
+ <itemizedlist>
+ <listitem>Somewhere a <command>flush stdout</command> was called
+ causing the HTTP headers to be sent, thus preventing any possibility to
+ manipulate them</listitem>
+ <listitem>The channel buffer had been filled already, causing Tcl to
+ flush the channel</listitem>
+ </itemizedlist>
+ The <command>stdout</command> channel, like any Tcl channels, can be manipulated
+ and its internal buffer streched if needed.
+ </para>
+
+ </refsect1>
+ </refentry>
<refentry id="read_file">
<refnamediv>
<refname>read_file</refname>
Modified: tcl/rivet/branches/2.2/doc/xml/directives.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/doc/xml/directives.xml?rev=1650254&r1=1650253&r2=1650254&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/doc/xml/directives.xml (original)
+++ tcl/rivet/branches/2.2/doc/xml/directives.xml Thu Jan 8 11:27:42 2015
@@ -46,6 +46,7 @@
<arg>UploadMaxSize</arg>
<arg>UploadFilesToVar</arg>
<arg>SeparateVirtualInterps</arg>
+ <arg>SeparateChannels</arg>
<arg>HonorHeaderOnlyRequests</arg>
</group>
</cmdsynopsis>
@@ -372,6 +373,44 @@
<varlistentry>
<term>
+ <cmdsynopsis>
+ <arg choice="plain">SeparateChannels</arg>
+ <group choice="req">
+ <arg>yes</arg>
+ <arg>no</arg>
+ </group>
+ </cmdsynopsis>
+ </term>
+ <listitem>
+ <para>
+ Internally mod_rivet creates a new Tcl channel (Rivet channel) which is configured
+ as <command>stdout</command> and registered to each existing interpreter.
+ There is no need for multiple channels in a single thread as each thread can
+ serve only one request at a time. But if you are deploying mod_rivet in a
+ complex environment running many unrelated application, developed by
+ different teams, it could be the case to have <command>SeparateVirtualInterps</command>
+ set. If you want to enhance the environment separation you may also
+ set <command>SeparateChannels</command> to force mod_rivet to create
+ a channel per each Tcl interpreter thus enabling single application
+ code to change the Rivet channel parameters without affecting other
+ applications (even though changing the Tcl channel parameters is a rare
+ necessity). Setting this options increases the system overheads as each
+ Rivet channel needs to allocate their private control structures and internal
+ buffers
+ </para>
+ <note>
+ Notice that this is not needed if you have control over your application
+ </note>
+ <note>
+ This option is, by nature, only available at the
+ global level has effect only if <command>SeparateVirtualInterps</command>
+ is set
+ </note>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
<cmdsynopsis>
<arg choice="plain">HonorHeaderOnlyRequests</arg>
<group choice="req">
Modified: tcl/rivet/branches/2.2/src/rivetcmds/rivetInspect.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/src/rivetcmds/rivetInspect.c?rev=1650254&r1=1650253&r2=1650254&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/src/rivetcmds/rivetInspect.c (original)
+++ tcl/rivet/branches/2.2/src/rivetcmds/rivetInspect.c Thu Jan 8 11:27:42 2015
@@ -56,6 +56,7 @@ static const char* confDirectives[] =
"UploadDirectory",
"UploadFilesToVar",
"SeparateVirtualInterps",
+ "SeparateChannels",
"HonorHeaderOnlyRequests",
NULL
};
@@ -74,6 +75,7 @@ enum confIndices {
upload_directory,
upload_files_to_var,
separate_virtual_interps,
+ separate_channels,
honor_header_only_requests,
conf_index_terminator
};
@@ -182,6 +184,11 @@ Rivet_ReadConfParameter ( Tcl_Interp*
par_value = Tcl_NewIntObj(rsc->separate_virtual_interps);
break;
}
+ case separate_channels:
+ {
+ par_value = Tcl_NewIntObj(rsc->separate_channels);
+ break;
+ }
case honor_header_only_requests:
{
par_value = Tcl_NewIntObj(rsc->honor_header_only_reqs);
---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org