You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by da...@apache.org on 2005/10/01 12:19:44 UTC

svn commit: r292944 - in /tcl/rivet/trunk: ChangeLog debian/rules doc/rivet.xml src/mod_rivet.c src/rivetChannel.c tests/access.conf tests/runtests.tcl tests/srm.conf

Author: davidw
Date: Sat Oct  1 03:19:32 2005
New Revision: 292944

URL: http://svn.apache.org/viewcvs?rev=292944&view=rev
Log:
* tests/runtests.tcl: Add local path to TCLLIBPATH, add CoreDumpDirectory so
  that we can get any core files generated by bad tests.
			    
* src/mod_rivet.c (Rivet_PerInterpExit): Run any per-interp child exit
  things that need taking care of. (Rivet_ChildExit): Walk through the list
  of interpreters and do any shut down work necessary prior to shutting the
  whole thing down.
    
* src/rivetChannel.c (outputproc): If the AssocData is NULL, we don't try
  and output anything.  This is probably some residual data stuck in the
  channel.
		 

Added:
    tcl/rivet/trunk/tests/access.conf
    tcl/rivet/trunk/tests/srm.conf
Modified:
    tcl/rivet/trunk/ChangeLog
    tcl/rivet/trunk/debian/rules
    tcl/rivet/trunk/doc/rivet.xml
    tcl/rivet/trunk/src/mod_rivet.c
    tcl/rivet/trunk/src/rivetChannel.c
    tcl/rivet/trunk/tests/runtests.tcl

Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewcvs/tcl/rivet/trunk/ChangeLog?rev=292944&r1=292943&r2=292944&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Sat Oct  1 03:19:32 2005
@@ -1,5 +1,21 @@
+2005-10-01  David N. Welton  <da...@dedasys.com>
+
+	* tests/runtests.tcl: Add local path to TCLLIBPATH, add
+	CoreDumpDirectory so that we can get any core files generated by
+	bad tests.
+
+	* src/mod_rivet.c (Rivet_PerInterpExit): Run any per-interp child
+	exit things that need taking care of.
+	(Rivet_ChildExit): Walk through the list of interpreters and do
+	any shut down work necessary prior to shutting the whole thing
+	down.
+
+	* src/rivetChannel.c (outputproc): If the AssocData is NULL, we
+	don't try and output anything.  This is probably some residual
+	data stuck in the channel.
 
 2005-09-29  Karl Lehenbauer  <ka...@sc.com>
+
 	* rivet/packages/dio/dio.tcl: Fix typo in "DIO insert" method
 
 2005-09-25  Karl Lehenbauer  <ka...@sc.com>

Modified: tcl/rivet/trunk/debian/rules
URL: http://svn.apache.org/viewcvs/tcl/rivet/trunk/debian/rules?rev=292944&r1=292943&r2=292944&view=diff
==============================================================================
--- tcl/rivet/trunk/debian/rules (original)
+++ tcl/rivet/trunk/debian/rules Sat Oct  1 03:19:32 2005
@@ -17,6 +17,7 @@
 build-stamp: configure-stamp
 	dh_testdir
 	$(MAKE)
+	( cd doc/ $(MAKE) docs )
 	touch build-stamp
 
 clean:

Modified: tcl/rivet/trunk/doc/rivet.xml
URL: http://svn.apache.org/viewcvs/tcl/rivet/trunk/doc/rivet.xml?rev=292944&r1=292943&r2=292944&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/rivet.xml (original)
+++ tcl/rivet/trunk/doc/rivet.xml Sat Oct  1 03:19:32 2005
@@ -11,7 +11,7 @@
 ]>
 
 <!--
-   Copyright 2002-2004 The Apache Software Foundation
+   Copyright 2002-2005 The Apache Software Foundation
 
    Licensed under the Apache License, Version 2.0 (the "License"); you
    may not use this file except in compliance with the License.  You
@@ -4039,8 +4039,9 @@
       This section easily falls out of date, as new code is added, old
       code is removed, and changes are made.  The best place to look
       is the source code itself.  If you are interested in the changes
-      themselves, <command>cvs</command> can provide you with
-      information about what has been happening with the code.
+      themselves, the Subversion revision control system
+      (<command>svn</command>) can provide you with information about
+      what has been happening with the code.
     </para>
     <section>
       <title>Initialization</title>

Modified: tcl/rivet/trunk/src/mod_rivet.c
URL: http://svn.apache.org/viewcvs/tcl/rivet/trunk/src/mod_rivet.c?rev=292944&r1=292943&r2=292944&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet.c (original)
+++ tcl/rivet/trunk/src/mod_rivet.c Sat Oct  1 03:19:32 2005
@@ -333,7 +333,7 @@
 	}
 
 	if (*(rsc->cache_free)) {
-	    rsc->objCacheList[-- *(rsc->cache_free) ] = strdup(hashKey);
+	    rsc->objCacheList[-- *(rsc->cache_free) ] = (char *)strdup(hashKey);
 	} else if (*(rsc->cache_size)) { /* If it's zero, we just skip this. */
 	    Tcl_HashEntry *delEntry;
 	    delEntry = Tcl_FindHashEntry(
@@ -344,7 +344,7 @@
 	    free(rsc->objCacheList[*(rsc->cache_size) - 1]);
 	    memmove((rsc->objCacheList) + 1, rsc->objCacheList,
 		    sizeof(char *) * (*(rsc->cache_size) -1));
-	    rsc->objCacheList[0] = strdup(hashKey);
+	    rsc->objCacheList[0] = (char *)strdup(hashKey);
 	}
     } else {
 	/* We found a compiled version of this page. */
@@ -896,6 +896,32 @@
 /*
  *-----------------------------------------------------------------------------
  *
+ * Rivet_PerInterpExit --
+ *
+ * 	Called to shut down anything that needs closing out on a per-interp basis.
+ *
+ * Results:
+ *	None.
+ *
+ * Side Effects:
+ *	None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+static void
+Rivet_PerInterpExit(server_rec *s, rivet_server_conf *rsc, pool *p) {
+    Tcl_Interp *interp = rsc->server_interp;
+
+    /* Let's try setting this to NULL so that the channel's outputproc
+     * realizes that it had better not do anything at this point. */
+
+    Tcl_SetAssocData(interp, "rivet", NULL, NULL);
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *
  * Rivet_PanicProc --
  *
  * 	Called when Tcl panics, usually because of memory problems.
@@ -918,7 +944,7 @@
     char *buf;
     char *format;
 
-    format = TCL_VARARGS_START(char *,arg1,argList);
+    format = (char *) TCL_VARARGS_START(char *,arg1,argList);
     buf = ap_pvsprintf(globalrr->pool, format, argList);
     ap_log_error(APLOG_MARK, APLOG_CRIT, globalrr->server,
 		 "Critical error in request: %s", globalrr->unparsed_uri);
@@ -1767,7 +1793,28 @@
 void
 Rivet_ChildExit(server_rec *s, pool *p)
 {
+    server_rec *sr;
+    rivet_server_conf *rsc = RIVET_SERVER_CONF( s->module_config );
+    rivet_server_conf *myrsc;
+
+    /* Do the user defined stuff... */
     Rivet_ChildHandlers(s, p, 0);
+
+    /* Then tear down anything that needs doing. */
+    Rivet_PerInterpExit(s, rsc, p);
+
+    /* Walk through the others and shut them down too. */
+    for (sr = s; sr; sr = sr->next) {
+	if (sr != s)  {
+	    /* not the first one  */
+	    if (rsc->separate_virtual_interps != 0) {
+		myrsc = RIVET_SERVER_CONF(sr->module_config);
+		Rivet_PerInterpExit(s, myrsc, p);
+	    }
+	}
+    }
+
+
     Tcl_Finalize();
     return;
 }

Modified: tcl/rivet/trunk/src/rivetChannel.c
URL: http://svn.apache.org/viewcvs/tcl/rivet/trunk/src/rivetChannel.c?rev=292944&r1=292943&r2=292944&view=diff
==============================================================================
--- tcl/rivet/trunk/src/rivetChannel.c (original)
+++ tcl/rivet/trunk/src/rivetChannel.c Sat Oct  1 03:19:32 2005
@@ -48,6 +48,12 @@
     rivet_interp_globals *globals =
 	Tcl_GetAssocData(rsc->server_interp, "rivet", NULL);
 
+    /* If this is true, we're in the process of shutting down - just
+     * throw it away. */
+    if (globals == NULL) {
+	return toWrite;
+    }
+
     TclWeb_PrintHeaders(globals->req);
     if (globals->req->content_sent == 0)
     {

Added: tcl/rivet/trunk/tests/access.conf
URL: http://svn.apache.org/viewcvs/tcl/rivet/trunk/tests/access.conf?rev=292944&view=auto
==============================================================================
    (empty)

Modified: tcl/rivet/trunk/tests/runtests.tcl
URL: http://svn.apache.org/viewcvs/tcl/rivet/trunk/tests/runtests.tcl?rev=292944&r1=292943&r2=292944&view=diff
==============================================================================
--- tcl/rivet/trunk/tests/runtests.tcl (original)
+++ tcl/rivet/trunk/tests/runtests.tcl Sat Oct  1 03:19:32 2005
@@ -74,11 +74,14 @@
     # We can use this to include our own stuff for each test.
     Include test.conf
 
+    # For testing, we want core dumps.
+    CoreDumpDirectory $CWD
 }
 
 # Copy the rivet init files.
 file delete -force rivet
 file copy -force [file join .. rivet] .
+set env(TCLLIBPATH) [file normalize [file join [file dirname [info script]] rivet]]
 
 # If 'startserver' is specified on the command line, just start up the
 # server without running tests.

Added: tcl/rivet/trunk/tests/srm.conf
URL: http://svn.apache.org/viewcvs/tcl/rivet/trunk/tests/srm.conf?rev=292944&view=auto
==============================================================================
    (empty)



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