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/08/31 02:28:02 UTC

svn commit: r1700183 - in /tcl/rivet/trunk: ./ src/ src/mod_rivet/ src/parser/ src/request/

Author: mxmanghi
Date: Mon Aug 31 00:28:02 2015
New Revision: 1700183

URL: http://svn.apache.org/r1700183
Log:
    * src/mod_rivet/mod_rivet.c: bringing the request type check
    back to Rivet_Handler shook quite a bit the build process as
    it required to create a new file rivet_types.h to store
    various definitions 
    * src/mod_rivet/TclWebapache.c: changed definition of
    TclWeb_InitRequest. The thread private data must have
    stored the whole request processing status
    * src/mod_rivet/rivet_prefork_mpm.c: Request type check moved
    to mod_rivet.c (Rivet_Handler)
    * src/mod_rivet/rivet_worker_mpm.c: Request type stored
    now in the request private data
    * src/parser/parsePkgInit.c: was still including config.h
    instead rivet_config.h. Add mandatory Apache standard 
    copyright statement
    * src/mod_rivet/mod_rivet_common.c: Rivet_CheckType 
    definition changed to return a rivet_req_ctype value
    * src/mod_rivet/rivet_types.h: add new file with
    definition used by various files that don't need mod_rivet.h
    * src/mod_rivet/apache_request.h: removed definition that
    went into rivet_types.h
    * src/Makefile.am: libparser needed to have also LDFLAGS
    to build correctly
    * src/rivet.h: ASF copyright statement, including also
    rivet_types.h
    


Modified:
    tcl/rivet/trunk/ChangeLog
    tcl/rivet/trunk/Makefile.in
    tcl/rivet/trunk/src/Makefile.am
    tcl/rivet/trunk/src/TclWeb.h
    tcl/rivet/trunk/src/mod_rivet/TclWebapache.c
    tcl/rivet/trunk/src/mod_rivet/mod_rivet.c
    tcl/rivet/trunk/src/mod_rivet/mod_rivet.h
    tcl/rivet/trunk/src/mod_rivet/mod_rivet_common.c
    tcl/rivet/trunk/src/mod_rivet/rivet_prefork_mpm.c
    tcl/rivet/trunk/src/mod_rivet/rivet_types.h   (contents, props changed)
    tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c
    tcl/rivet/trunk/src/parser/parserPkgInit.c
    tcl/rivet/trunk/src/request/apache_request.h
    tcl/rivet/trunk/src/rivet.h

Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Mon Aug 31 00:28:02 2015
@@ -1,3 +1,29 @@
+2015-08-30 Massimo Manghi <mx...@apache.org>
+    * src/mod_rivet/mod_rivet.c: bringing the request type check
+    back to Rivet_Handler shook quite a bit the build process as
+    it required to create a new file rivet_types.h to store
+    various definitions 
+    * src/mod_rivet/TclWebapache.c: changed definition of
+    TclWeb_InitRequest. The thread private data must have
+    stored the whole request processing status
+    * src/mod_rivet/rivet_prefork_mpm.c: Request type check moved
+    to mod_rivet.c (Rivet_Handler)
+    * src/mod_rivet/rivet_worker_mpm.c: Request type stored
+    now in the request private data
+    * src/parser/parsePkgInit.c: was still including config.h
+    instead rivet_config.h. Add mandatory Apache standard 
+    copyright statement
+    * src/mod_rivet/mod_rivet_common.c: Rivet_CheckType 
+    definition changed to return a rivet_req_ctype value
+    * src/mod_rivet/rivet_types.h: add new file with
+    definition used by various files that don't need mod_rivet.h
+    * src/mod_rivet/apache_request.h: removed definition that
+    went into rivet_types.h
+    * src/Makefile.am: libparser needed to have also LDFLAGS
+    to build correctly
+    * src/rivet.h: ASF copyright statement, including also
+    rivet_types.h
+    
 2015-08-18 Massimo Manghi <mx...@apache.org>
     * src/mod_rivet/mod_rivet.[c|h]: now calling MPM through
     a bridge_jump_table structure with all the functions exported

Modified: tcl/rivet/trunk/Makefile.in
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/Makefile.in?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/Makefile.in (original)
+++ tcl/rivet/trunk/Makefile.in Mon Aug 31 00:28:02 2015
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -24,7 +24,17 @@
 #             before invoking pkg_mkIndex.
 # 2013/01/20: removing libtool created .la files
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -88,18 +98,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/configure $(am__configure_deps) \
-	$(srcdir)/config.h.in $(top_srcdir)/rivet/init.tcl.in \
-	ChangeLog tclconfig/ChangeLog INSTALL README TODO \
-	tclconfig/compile tclconfig/config.guess tclconfig/config.sub \
-	tclconfig/depcomp tclconfig/install-sh tclconfig/missing \
-	tclconfig/ltmain.sh $(top_srcdir)/tclconfig/compile \
-	$(top_srcdir)/tclconfig/config.guess \
-	$(top_srcdir)/tclconfig/config.sub \
-	$(top_srcdir)/tclconfig/install-sh \
-	$(top_srcdir)/tclconfig/ltmain.sh \
-	$(top_srcdir)/tclconfig/missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/ax_split_version.m4 \
@@ -109,6 +107,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+	$(am__configure_deps) $(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
@@ -172,6 +172,17 @@ ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+	$(top_srcdir)/rivet/init.tcl.in \
+	$(top_srcdir)/tclconfig/compile \
+	$(top_srcdir)/tclconfig/config.guess \
+	$(top_srcdir)/tclconfig/config.sub \
+	$(top_srcdir)/tclconfig/install-sh \
+	$(top_srcdir)/tclconfig/ltmain.sh \
+	$(top_srcdir)/tclconfig/missing ChangeLog INSTALL README TODO \
+	tclconfig/ChangeLog tclconfig/compile tclconfig/config.guess \
+	tclconfig/config.sub tclconfig/depcomp tclconfig/install-sh \
+	tclconfig/ltmain.sh tclconfig/missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -438,7 +449,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -671,15 +681,15 @@ dist-xz: distdir
 	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
-	@echo WARNING: "Support for shar distribution archives is" \
-	               "deprecated." >&2
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__post_remove_distdir)
 
 dist-shar: distdir
-	@echo WARNING: "Support for distribution archives compressed with" \
-		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
@@ -715,17 +725,17 @@ distcheck: dist
 	esac
 	chmod -R a-w $(distdir)
 	chmod u+w $(distdir)
-	mkdir $(distdir)/_build $(distdir)/_inst
+	mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
 	chmod a-w $(distdir)
 	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
 	  && am__cwd=`pwd` \
-	  && $(am__cd) $(distdir)/_build \
-	  && ../configure \
+	  && $(am__cd) $(distdir)/_build/sub \
+	  && ../../configure \
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
-	    --srcdir=.. --prefix="$$dc_install_base" \
+	    --srcdir=../.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -903,6 +913,8 @@ uninstall-am: uninstall-local
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am uninstall-local
 
+.PRECIOUS: Makefile
+
 
 libtool: $(LIBTOOL_DEPS)
 	$(SHELL) ./config.status --recheck

Modified: tcl/rivet/trunk/src/Makefile.am
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/Makefile.am?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/src/Makefile.am (original)
+++ tcl/rivet/trunk/src/Makefile.am Mon Aug 31 00:28:02 2015
@@ -23,9 +23,9 @@ lib_libexec_LTLIBRARIES = librivetparser
 # Rivet Parser Library
 #
 librivetparser_la_SOURCES = parser/rivetParser.c parser/parserPkgInit.c
-librivetparser_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ -module -avoid-version
+librivetparser_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ -module -avoid-version
 librivetparser_la_LIBADD  = @APXS_LIBS@
-librivetparser_la_CPPFLAGS = @apache_include@ -I@rivet_core@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ -DSTART_TAG='"<?"' -DEND_TAG='"?>"' -DUSE_TCL_STUBS
+librivetparser_la_CPPFLAGS = @apache_include@ -I@rivet_core@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_INCLUDES@ @APR_CPPFLAGS@ -DSTART_TAG='"<?"' -DEND_TAG='"?>"' -DUSE_TCL_STUBS
 
 #
 # Rivet Library

Modified: tcl/rivet/trunk/src/TclWeb.h
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/TclWeb.h?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/src/TclWeb.h (original)
+++ tcl/rivet/trunk/src/TclWeb.h Mon Aug 31 00:28:02 2015
@@ -23,18 +23,6 @@
 #define DEFAULT_HEADER_TYPE "text/html"
 #define DEFAULT_TIME_FORMAT "%A, %d-%b-%Y %H:%M:%S %Z"
 
-typedef struct TclWebRequest {
-    Tcl_Interp*     interp;
-    request_rec*    req;
-    ApacheRequest*  apachereq;
-    ApacheUpload*   upload;
-    int             headers_printed;	/* has the header been printed yet? */
-    int             headers_set;		/* has the header been set yet? */
-    int             content_sent;
-    int             environment_set;	/* have we setup the environment variables? */
-    char*           charset;
-} TclWebRequest;
-
 /* Creates a TclWebRequest object */
 
 TclWebRequest* TclWeb_NewRequestObject (apr_pool_t *p);
@@ -48,7 +36,7 @@ TclWebRequest* TclWeb_NewRequestObject (
  *-----------------------------------------------------------------------------
  */
 
-int TclWeb_InitRequest(TclWebRequest *req, Tcl_Interp *interp, int ctype, void *arg);
+int TclWeb_InitRequest(rivet_thread_private* private, Tcl_Interp *interp);
 
 /*
  *-----------------------------------------------------------------------------

Modified: tcl/rivet/trunk/src/mod_rivet/TclWebapache.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/TclWebapache.c?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/TclWebapache.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/TclWebapache.c Mon Aug 31 00:28:02 2015
@@ -90,9 +90,10 @@ TclWeb_NewRequestObject (apr_pool_t *p)
  */
 
 int
-TclWeb_InitRequest(TclWebRequest* req, Tcl_Interp *interp, int ctype, void *arg)
+TclWeb_InitRequest(rivet_thread_private* private, Tcl_Interp *interp)
 {
-    request_rec *r = (request_rec *)arg;
+    request_rec*        r   = private->r;
+    TclWebRequest*      req = private->req;
     int content_type_len = strlen(r->content_type);
 
     req->interp             = interp;
@@ -108,8 +109,8 @@ TclWeb_InitRequest(TclWebRequest* req, T
      * a charset parameters might be there 
      */
 
-    if (((ctype==RIVET_TEMPLATE) && (content_type_len > strlen(RIVET_TEMPLATE_CTYPE))) || \
-         ((ctype==RIVET_TCLFILE) && (content_type_len > strlen(RIVET_TCLFILE_CTYPE)))) {
+    if (((private->ctype==RIVET_TEMPLATE) && (content_type_len > strlen(RIVET_TEMPLATE_CTYPE))) || \
+         ((private->ctype==RIVET_TCLFILE) && (content_type_len > strlen(RIVET_TCLFILE_CTYPE)))) {
         
         char* charset;
 

Modified: tcl/rivet/trunk/src/mod_rivet/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/mod_rivet.c?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/mod_rivet.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/mod_rivet.c Mon Aug 31 00:28:02 2015
@@ -51,13 +51,14 @@
 /* as long as we need to emulate ap_chdir_file we need to include unistd.h */
 #include <unistd.h>
 
+#include "rivet_types.h"
+#include "mod_rivet.h"
+#include "rivetChannel.h"
+#include "apache_config.h"
 #include "TclWeb.h"
 #include "rivet.h"
-#include "mod_rivet.h"
 #include "mod_rivet_common.h"
 #include "rivetParser.h"
-#include "rivetChannel.h"
-#include "apache_config.h"
 
 rivet_interp_globals    interp_globals;
 
@@ -527,7 +528,6 @@ Rivet_SendContent(rivet_thread_private *
 {
     int                     errstatus;
     int                     retval;
-    int                     ctype;
     Tcl_Interp*             interp;
     rivet_thread_interp*    interp_obj;
     Tcl_Channel*            running_channel;
@@ -540,11 +540,6 @@ Rivet_SendContent(rivet_thread_private *
 
     private->r = r;
 
-    ctype = Rivet_CheckType(private->r);  
-    if (ctype == CTYPE_NOT_HANDLED) {
-        return DECLINED;
-    }
-
     /* Set the global request req to know what we are dealing with in
      * case we have to call the PanicProc. */
 
@@ -620,9 +615,6 @@ Rivet_SendContent(rivet_thread_private *
     }
 
     interp  = interp_obj->interp;
-    //globals = Tcl_GetAssocData(interp, "rivet", NULL);
-    //globals->r = r;
-    //globals->srec = private->r->server;
 
 #ifndef USE_APACHE_RSC
     if (private->r->per_dir_config != NULL)
@@ -696,7 +688,7 @@ Rivet_SendContent(rivet_thread_private *
 
     /* Apache Request stuff */
 
-    TclWeb_InitRequest(private->req, interp, ctype, private->r);
+    TclWeb_InitRequest(private, interp);
     ApacheRequest_set_post_max(private->req->apachereq, private->running_conf->upload_max);
     ApacheRequest_set_temp_dir(private->req->apachereq, private->running_conf->upload_dir);
 
@@ -816,7 +808,7 @@ sendcleanup:
  */
 
 static int 
-Rivet_ExecuteErrorHandler (Tcl_Interp* interp,Tcl_Obj* tcl_script_obj, rivet_thread_private *private)
+Rivet_ExecuteErrorHandler (Tcl_Interp* interp,Tcl_Obj* tcl_script_obj, rivet_thread_private* private)
 {
     int                 result;
     Tcl_Obj*            errscript;
@@ -1675,7 +1667,11 @@ static void Rivet_ChildInit (apr_pool_t
 
 static int Rivet_Handler (request_rec *r)    
 {
-    return (*RIVET_MPM_BRIDGE_FUNCTION(mpm_request))(r);
+    rivet_req_ctype ctype = Rivet_CheckType(r);  
+    if (ctype == CTYPE_NOT_HANDLED) {
+        return DECLINED;
+    }
+    return (*RIVET_MPM_BRIDGE_FUNCTION(mpm_request))(r,ctype);
 }
 
 /*

Modified: tcl/rivet/trunk/src/mod_rivet/mod_rivet.h
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/mod_rivet.h?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/mod_rivet.h (original)
+++ tcl/rivet/trunk/src/mod_rivet/mod_rivet.h Mon Aug 31 00:28:02 2015
@@ -30,8 +30,8 @@
 #include <apr_thread_cond.h>
 #include <apr_atomic.h>
 #include <tcl.h>
+#include "rivet.h"
 #include "apache_request.h"
-#include "TclWeb.h"
 
 /* Rivet config */
 #ifdef HAVE_CONFIG_H
@@ -127,15 +127,6 @@ typedef struct _rivet_server_conf {
 
 #define TCL_INTERPS 1
 
-typedef int rivet_thr_status;
-enum
-{
-    init,
-    idle,
-    request_processing,
-    done
-};
-
 /* thread private interpreter error flags */
 
 #define RIVET_CACHE_FULL            1
@@ -164,7 +155,7 @@ typedef struct _rivet_thread_interp {
 
 typedef int  (RivetBridge_ServerInit)   (apr_pool_t*,apr_pool_t*,apr_pool_t*,server_rec*);
 typedef void (RivetBridge_ChildInit)    (apr_pool_t* pPool,server_rec* s);
-typedef int  (RivetBridge_Request)      (request_rec*);
+typedef int  (RivetBridge_Request)      (request_rec*,rivet_req_ctype);
 typedef apr_status_t 
              (RivetBridge_Finalize)(void*);
 typedef rivet_thread_interp*
@@ -211,6 +202,7 @@ typedef struct _thread_worker_private {
                                             /* the request_rec and TclWebRequest    *
                                              * are copied here to be passed to a    *
                                              * channel                              */
+    rivet_req_ctype     ctype;              /*                                      */
     request_rec*        r;                  /* current request_rec                  */
     TclWebRequest*      req;
     Tcl_Obj*            request_init;
@@ -245,19 +237,6 @@ enum {
     orderly_exit
 };
 
-/* data private to the Apache callback handling the request */
-
-typedef struct _handler_private 
-{
-    rivet_job_t             job_type;
-    apr_thread_cond_t*      cond;
-    apr_thread_mutex_t*     mutex;
-    request_rec*            r;              /* request rec                 */
-    int                     code;
-    int                     status;
-
-    //TclWebRequest*      req;
-} handler_private;
 
 rivet_server_conf *Rivet_GetConf(request_rec *r);
 

Modified: tcl/rivet/trunk/src/mod_rivet/mod_rivet_common.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/mod_rivet_common.c?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/mod_rivet_common.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/mod_rivet_common.c Mon Aug 31 00:28:02 2015
@@ -466,10 +466,10 @@ int Rivet_chdir_file (const char *file)
  *
  */
 
-int
+rivet_req_ctype
 Rivet_CheckType (request_rec *req)
 {
-    int ctype = CTYPE_NOT_HANDLED;
+    rivet_req_ctype ctype = CTYPE_NOT_HANDLED;
 
     if ( req->content_type != NULL ) {
         if( STRNEQU( req->content_type, RIVET_TEMPLATE_CTYPE) ) {

Modified: tcl/rivet/trunk/src/mod_rivet/rivet_prefork_mpm.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/rivet_prefork_mpm.c?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/rivet_prefork_mpm.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/rivet_prefork_mpm.c Mon Aug 31 00:28:02 2015
@@ -118,7 +118,7 @@ void Rivet_MPM_ChildInit (apr_pool_t* po
  *   HTTP status code (see the Apache HTTP web server documentation)
  */
 
-int Rivet_MPM_Request (request_rec* r)
+int Rivet_MPM_Request (request_rec* r,rivet_req_ctype ctype)
 {
     rivet_thread_private*   private;
 
@@ -126,6 +126,8 @@ int Rivet_MPM_Request (request_rec* r)
 
     RIVET_PRIVATE_DATA_NOT_NULL (rivet_thread_key, private);
 
+    private->ctype = ctype;
+
     return Rivet_SendContent(private,r);
 }
 
@@ -139,20 +141,6 @@ rivet_thread_interp* Rivet_MPM_MasterInt
     return module_globals->server_interp;
 }
 
-/*
- * -- Rivet_MPM_ExitHandler
- *
- * This handler basically falls back to the Tcl exit handler
- *
- */
-
-//int Rivet_MPM_ExitHandler(int code)
-//{
-//    Tcl_Exit(code);
-//    /*NOTREACHED*/
-//    return TCL_OK;		/* Better not ever reach this! */
-//}
-
 rivet_bridge_table bridge_jump_table = {
     NULL,
     Rivet_MPM_ChildInit,

Modified: tcl/rivet/trunk/src/mod_rivet/rivet_types.h
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/rivet_types.h?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/rivet_types.h (original)
+++ tcl/rivet/trunk/src/mod_rivet/rivet_types.h Mon Aug 31 00:28:02 2015
@@ -1,6 +1,32 @@
+/* -- rivet_types.h: this file should collect all the basic types used
+ * in mod_rivet and other related code
+ */
+
+/*
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+ */
+
+/* $Id$ */
+
 #ifndef _RIVET_TYPES_H_
 #define _RIVET_TYPES_H_
 
+#include <httpd.h>
 #include <tcl.h>
 
 typedef struct _ApacheRequest   ApacheRequest;

Propchange: tcl/rivet/trunk/src/mod_rivet/rivet_types.h
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c Mon Aug 31 00:28:02 2015
@@ -73,6 +73,27 @@ typedef struct mpm_bridge_status {
     apr_thread_mutex_t* req_mutex;
 #endif
 } mpm_bridge_status;
+/* data private to the Apache callback handling the request */
+
+typedef struct _handler_private 
+{
+    rivet_job_t             job_type;
+    apr_thread_cond_t*      cond;
+    apr_thread_mutex_t*     mutex;
+    request_rec*            r;              /* request rec                 */
+    int                     code;
+    int                     status;
+    rivet_req_ctype         ctype;          /*                             */
+} handler_private;
+
+typedef int rivet_thr_status;
+enum
+{
+    init,
+    idle,
+    request_processing,
+    done
+};
 
 /* Rivet_MPM_Shutdown --
  *
@@ -132,11 +153,8 @@ void Rivet_MPM_Shutdown (void)
 static void* APR_THREAD_FUNC request_processor (apr_thread_t *thd, void *data)
 {
     rivet_thread_private*   private;
-    //Tcl_Channel*          outchannel;		    /* stuff for buffering output */
-    //server_rec*           server;
 
     apr_thread_mutex_lock(module_globals->mpm->job_mutex);
-    //server = module_globals->server;
 
     private = Rivet_CreatePrivateData();
     if (private == NULL) 
@@ -164,8 +182,6 @@ static void* APR_THREAD_FUNC request_pro
         return NULL;
     }
 
-    // rsc->server_interp = private->interp;
-
     apr_thread_mutex_unlock(module_globals->mpm->job_mutex);       /* unlock job initialization stage */
 
         /* eventually we increment the number of active threads */
@@ -217,6 +233,8 @@ static void* APR_THREAD_FUNC request_pro
         /* these assignements are crucial for both calling Rivet_SendContent and
          * for telling the channel where stuff must be sent to */
 
+        private->ctype  = request_obj->ctype;
+
         HTTP_REQUESTS_PROC(request_obj->code = Rivet_SendContent(private,request_obj->r));
 
         apr_thread_mutex_lock(request_obj->mutex);
@@ -519,7 +537,7 @@ apr_status_t Worker_RequestPrivateCleanu
  *   HTTP status code (see the Apache HTTP web server documentation)
  */
 
-int Rivet_MPM_Request (request_rec* r)
+int Rivet_MPM_Request (request_rec* r,rivet_req_ctype ctype)
 {
     handler_private*    request_private;
     apr_status_t        rv;
@@ -567,6 +585,7 @@ int Rivet_MPM_Request (request_rec* r)
     request_private->code       = OK;
     request_private->status     = init;
     request_private->job_type   = request;
+    request_private->ctype      = ctype;
 
     rv = apr_queue_push(module_globals->mpm->queue,request_private);
     if (rv == APR_SUCCESS)

Modified: tcl/rivet/trunk/src/parser/parserPkgInit.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/parser/parserPkgInit.c?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/src/parser/parserPkgInit.c (original)
+++ tcl/rivet/trunk/src/parser/parserPkgInit.c Mon Aug 31 00:28:02 2015
@@ -1,32 +1,38 @@
 /*
- * parserPkgInit.c - This code provides a wrapper around
- * rivetParser.c, in order to expose it to Tcl scripts not running in
- * Rivet.
+ * parserPkgInit.c - This code provides a wrapper around rivetParser.c, 
+ * in order to expose it to Tcl scripts not running in Rivet.
  */
 
-/* Copyright 2003-2004 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 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.
-*/
+/*
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+ */
 
 /* $Id$ */
 
 /* Rivet config */
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#include <rivet_config.h>
 #endif
 
+#include <apr_tables.h>
+#include <apr_file_io.h>
 #include <tcl.h>
+
 #include "rivet.h"
 #include "rivetParser.h"
 

Modified: tcl/rivet/trunk/src/request/apache_request.h
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/request/apache_request.h?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/src/request/apache_request.h (original)
+++ tcl/rivet/trunk/src/request/apache_request.h Mon Aug 31 00:28:02 2015
@@ -8,6 +8,7 @@
 #include "http_main.h"
 #include "http_protocol.h"
 #include "util_script.h"
+#include "mod_rivet.h"
 
 #ifdef  SFIO
 #include "sfio.h"
@@ -31,36 +32,6 @@ extern Sfio_t*  _stdopen _ARG_((int, con
 #define ap_pfclose(p,q)		sfclose(q)
 #endif /*SFIO*/
 
-typedef struct ApacheUpload ApacheUpload;
-
-typedef struct _ApacheRequest {
-    //table *parms;
-    apr_table_t *parms;
-    ApacheUpload *upload;
-    int status;
-    int parsed;
-    int post_max;
-    int disable_uploads;
-    int (*upload_hook)(void *ptr, char *buf, int len, ApacheUpload *upload);
-    void *hook_data;
-    const char* temp_dir;
-    char* raw_post; /* Raw post data. */
-    request_rec *r;
-    int nargs;
-} ApacheRequest;
-
-struct ApacheUpload {
-    ApacheUpload *next;
-    char *filename;
-    char *name;
-    char *tempname;
-    //table *info;
-    apr_table_t *info;
-    apr_file_t *fp;
-    long size;
-    ApacheRequest *req;
-};
-
 #ifndef strEQ
 #define strEQ(s1,s2) (!strcmp((s1),(s2)))
 #endif

Modified: tcl/rivet/trunk/src/rivet.h
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/rivet.h?rev=1700183&r1=1700182&r2=1700183&view=diff
==============================================================================
--- tcl/rivet/trunk/src/rivet.h (original)
+++ tcl/rivet/trunk/src/rivet.h Mon Aug 31 00:28:02 2015
@@ -1,23 +1,34 @@
-/* Copyright 2002-2004 The Apache Software Foundation
+/* rivet.h: */
 
-   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.
-*/
+/*
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+ */
 
 /* $Id$ */
 
 #ifndef _RIVET_H_
 #define _RIVET_H_
 
+#include <tcl.h>
+#include "rivet_types.h"
+
+typedef int rivet_req_ctype;
+
 /* This is for windows. */
 #ifdef BUILD_rivet
 #undef TCL_STORAGE_CLASS
@@ -54,10 +65,10 @@ static int cmd(\
 #define THREAD_PRIVATE_DATA(p)  p = (rivet_thread_private *)clientData;
 
 #define TCL_OBJ_CMD( name, func ) \
-Tcl_CreateObjCommand( interp, /* Tcl interpreter */\
-		      name,   /* Function name in Tcl */\
-		      func,   /* C function name */\
-		      NULL,   /* Client Data */\
+Tcl_CreateObjCommand( interp,           /* Tcl interpreter */\
+		      name,                     /* Function name in Tcl */\
+		      func,                     /* C function name */\
+		      NULL,                     /* Client Data */\
 		      (Tcl_CmdDeleteProc *)NULL /* Tcl Delete Prov */)
 
  /* RIVET_OBJ_CMD creates a command in the RIVET_NS namespace. Commands
@@ -71,13 +82,12 @@ Tcl_CreateObjCommand( interp, /* Tcl int
   */
 
 #define RIVET_OBJ_CMD( name, func, private_p) \
-Tcl_CreateObjCommand( interp, /* Tcl interpreter */\
-		      RIVET_NS "::" name,   /* Function name in Tcl */\
-		      func,   /* C function name */\
-		      private_p,   /* Client Data */\
+Tcl_CreateObjCommand( interp,           /* Tcl interpreter */\
+		      RIVET_NS "::" name,       /* Function name in Tcl */\
+		      func,                     /* C function name */\
+		      private_p,                /* Client Data */\
 		      (Tcl_CmdDeleteProc *)NULL /* Tcl Delete Prov */); 
 
-
 /* 
  * Pointer in r is checked and in case Rivet_NoRequestRec is
  * called returning TCL_ERROR. This macro is used (and often



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