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/03/11 11:43:48 UTC
svn commit: r1665838 - in /tcl/rivet/branches/2.2: ChangeLog
doc/xml/internals.xml src/apache-2/mod_rivet.c
Author: mxmanghi
Date: Wed Mar 11 10:43:48 2015
New Revision: 1665838
URL: http://svn.apache.org/r1665838
Log:
* doc/xml/internals.xml: Improved paragraph on how to extend mod_rivet
* src/apache-2/mod_rivet.c: Improper handling of 'HTTP_NOT_FOUND' and
HTTP_INTERNAL_SERVER_ERROR caused an access to non existing memory (Bug #57686)
Modified:
tcl/rivet/branches/2.2/ChangeLog
tcl/rivet/branches/2.2/doc/xml/internals.xml
tcl/rivet/branches/2.2/src/apache-2/mod_rivet.c
Modified: tcl/rivet/branches/2.2/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/ChangeLog?rev=1665838&r1=1665837&r2=1665838&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/ChangeLog (original)
+++ tcl/rivet/branches/2.2/ChangeLog Wed Mar 11 10:43:48 2015
@@ -1,3 +1,8 @@
+2015-03-11 Massimo Manghi <mx...@apache.org>
+ * doc/xml/internals.xml: Improved paragraph on how to extend mod_rivet
+ * src/apache-2/mod_rivet.c: Improper handling of 'HTTP_NOT_FOUND' and
+ HTTP_INTERNAL_SERVER_ERROR caused an access to non existing memory (Bug #57686)
+
2015-02-20 Massimo Manghi <mx...@apache.org>
* INSTALL: installation instructions update
* VERSION: new version 2.2.2
@@ -14,7 +19,7 @@
TCL_BREAK (bug #57501)
* src/apache-2/mod_rivet.c: moving call to after_every_script out
of Rivet_ParseExecFile and into Rivet_SendContent. Any call to
- ::rivet::abort_page is now trapped by abort_script (bug #57501)
+ ::rivet::abort_page is now trapped by AbortScript (bug #57501)
* src/config/TclWebapache.c: if charset is set in the configuration
then it's set in the headers just before HTTP headers are sent (moved
from mod_rivet.c)
@@ -25,7 +30,7 @@
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
+ * src/rivetcmds/rivetInspect.c: add handling of SeparateChannels/separate_channels configuration
flag
2015-01-06 Massimo Manghi <mx...@apache.org>
Modified: tcl/rivet/branches/2.2/doc/xml/internals.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/doc/xml/internals.xml?rev=1665838&r1=1665837&r2=1665838&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/doc/xml/internals.xml (original)
+++ tcl/rivet/branches/2.2/doc/xml/internals.xml Wed Mar 11 10:43:48 2015
@@ -94,20 +94,30 @@
<title>Extending Rivet by developing C procedures implementing new commands</title>
<para>
Rivet endows the Tcl interpreter with new commands
- to provide an interface from the application layer to the
- Apache web server internal data. Many of these commands
- are meaningful only when HTTP request are being processed
- and a fundamental data structure has been allocated and
- intialized by the Apache framework: the request_rec object.
- In case commands have to be written that have to gain access
- to a valid request_rec object pointer they must check if such
+ serving as interface between the application layer and the
+ Apache web server. Many of these commands
+ are meaningful only when a HTTP request is under way and
+ therefore a request_rec object allocated by the framework
+ is existing and was passed to mod_rivet as argument of a callback.
+ In case commands have to gain access to a valid request_rec
+ object the C procedure must check if such
a pointer exists and it's initialized
- with valid data.
+ with valid data. For this purpose the procedure handling requests
+ (Rivet_SendContent) makes a copy of such pointer and keeps it
+ in an internal structure. The copy is set to NULL just before
+ returning to the framework, right after mod_rivet's has
+ carried out its request processing. When the pointer copy is NULL
+ the module is outside any request processing and this
+ condition invalidates the execution of
+ many of the Rivet commands. In case they are called
+ (for example in a ChildInitScript, GlobalInitScript,
+ ServerInitScript or ChildExitScript) they fail with a Tcl error
+ you can handle with a <command>catch</command> command.
</para>
<para>
For this purpose in <option>src/rivet.h</option> the macro
- CHECK_REQUEST_REC was defined accepting to arguments: the pointer
- to the request_rec object (stored in the
+ CHECK_REQUEST_REC was defined accepting two arguments: the copy
+ to the request_rec pointer (stored in the
<structname>rivet_interp_globals</structname>
structure) and the command name. If the pointer is NULL
the macro calls Tcl_NoRequestRec and returns TCL_ERROR
Modified: tcl/rivet/branches/2.2/src/apache-2/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/src/apache-2/mod_rivet.c?rev=1665838&r1=1665837&r2=1665838&view=diff
==============================================================================
--- tcl/rivet/branches/2.2/src/apache-2/mod_rivet.c (original)
+++ tcl/rivet/branches/2.2/src/apache-2/mod_rivet.c Wed Mar 11 10:43:48 2015
@@ -1505,6 +1505,12 @@ Rivet_SendContent(request_rec *r)
Tcl_GetVar(interp, "errorInfo", 0));
}
+ /* We finalize the request processing by printing the headers and flushing
+ the rivet channel internal buffer */
+
+ TclWeb_PrintHeaders(globals->req);
+ Tcl_Flush(*(rsc->outchannel));
+
/* Reset globals */
Rivet_CleanupRequest(r);
@@ -1513,9 +1519,6 @@ sendcleanup:
/* Everything is done and we flush the rivet channel before resetting the status */
- TclWeb_PrintHeaders(globals->req);
- Tcl_Flush(*(rsc->outchannel));
-
globals->req->content_sent = 0;
globals->page_aborting = 0;
if (globals->abort_code != NULL)
---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org