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 2002/02/12 12:09:59 UTC

cvs commit: tcl-rivet/src TclWeb.h TclWebapache.c mod_rivet.c mod_rivet.h rivetCore.c

davidw      02/02/12 03:09:58

  Modified:    .        ChangeLog
               src      TclWeb.h TclWebapache.c mod_rivet.c mod_rivet.h
                        rivetCore.c
  Log:
  * src/TclWebapache.c: Added some INLINE's.
  
  * src/mod_rivet.c (Rivet_ParseExecFile): Tweaking of parameters to
    enable the modification stated below.
  
  * src/rivetCore.c (Rivet_Parse): Removed 'rsc' from this function.
  
  Revision  Changes    Path
  1.33      +10 -0     tcl-rivet/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/ChangeLog,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- ChangeLog	7 Feb 2002 10:53:11 -0000	1.32
  +++ ChangeLog	12 Feb 2002 11:09:58 -0000	1.33
  @@ -1,3 +1,13 @@
  +2002-02-12  David N. Welton  <da...@dedasys.com>
  +
  +	* src/TclWebapache.c: Added some INLINE's.
  +
  +	* src/mod_rivet.c (Rivet_ParseExecFile): Tweaking of parameters to
  +	enable the modification stated below.
  +
  +	* src/rivetCore.c (Rivet_Parse): Removed 'rsc' from this
  +	function.
  +
   2002-02-07  David N. Welton  <da...@dedasys.com>
   
   	* src/TclWebapache.c (TclWebMakeURL): New command, extracted out
  
  
  
  1.9       +3 -1      tcl-rivet/src/TclWeb.h
  
  Index: TclWeb.h
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/TclWeb.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TclWeb.h	7 Feb 2002 10:53:11 -0000	1.8
  +++ TclWeb.h	12 Feb 2002 11:09:58 -0000	1.9
  @@ -5,7 +5,7 @@
    * 	Common API layer.
    */
   
  -/* $Id: TclWeb.h,v 1.8 2002/02/07 10:53:11 davidw Exp $ */
  +/* $Id: TclWeb.h,v 1.9 2002/02/12 11:09:58 davidw Exp $ */
   
   /* Error wrappers  */
   #define ER1 "<hr><p><code><pre>\n"
  @@ -48,6 +48,8 @@
    */
   
   int TclWeb_SendHeaders(TclWebRequest *req);
  +
  +INLINE int TclWeb_StopSending(TclWebRequest *req);
   
   int TclWeb_SetHeaderType(char *header, TclWebRequest *req);
   
  
  
  
  1.11      +11 -4     tcl-rivet/src/TclWebapache.c
  
  Index: TclWebapache.c
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/TclWebapache.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TclWebapache.c	7 Feb 2002 10:53:11 -0000	1.10
  +++ TclWebapache.c	12 Feb 2002 11:09:58 -0000	1.11
  @@ -7,7 +7,7 @@
    * operations.
    */
   
  -/* $Id: TclWebapache.c,v 1.10 2002/02/07 10:53:11 davidw Exp $ */
  +/* $Id: TclWebapache.c,v 1.11 2002/02/12 11:09:58 davidw Exp $ */
   
   #include <tcl.h>
   
  @@ -40,6 +40,13 @@
       return TCL_OK;
   }
   
  +INLINE int
  +TclWeb_StopSending(TclWebRequest *req)
  +{
  +    req->req->connection->aborted = 1;
  +    return TCL_OK;
  +}
  +
   /* Set up the content type header */
   
   int
  @@ -93,21 +100,21 @@
       return TCL_OK;
   }
   
  -int
  +INLINE int
   TclWeb_HeaderSet(char *header, char *val, TclWebRequest *req)
   {
       ap_table_set(req->req->headers_out, header, val);
       return TCL_OK;
   }
   
  -int
  +INLINE int
   TclWeb_SetStatus(int status, TclWebRequest *req)
   {
       req->req->status = status;
       return TCL_OK;
   }
   
  -int
  +INLINE int
   TclWeb_MakeURL(Tcl_Obj *result, char *filename, TclWebRequest *req)
   {
       result = Tcl_NewStringObj(ap_construct_url(TCLWEBPOOL, filename, req->req), -1);
  
  
  
  1.31      +7 -5      tcl-rivet/src/mod_rivet.c
  
  Index: mod_rivet.c
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/mod_rivet.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- mod_rivet.c	7 Feb 2002 10:53:11 -0000	1.30
  +++ mod_rivet.c	12 Feb 2002 11:09:58 -0000	1.31
  @@ -55,7 +55,7 @@
    * originally written at the National Center for Supercomputing Applications,
    * University of Illinois, Urbana-Champaign.  */
   
  -/* $Id: mod_rivet.c,v 1.30 2002/02/07 10:53:11 davidw Exp $  */
  +/* $Id: mod_rivet.c,v 1.31 2002/02/12 11:09:58 davidw Exp $  */
   
   /* mod_rivet.c by David Welton <da...@apache.org>
    *            and Damon Courtney <da...@unreality.com>
  @@ -159,8 +159,7 @@
   
   /* This is a seperate function so that it may be called from 'Parse' */
   int
  -Rivet_ParseExecFile(TclWebRequest *req, rivet_server_conf *rsc,
  -			char *filename, int toplevel)
  +Rivet_ParseExecFile(TclWebRequest *req, char *filename, int toplevel)
   {
       char *hashKey = NULL;
       int isNew = 0;
  @@ -172,7 +171,10 @@
       time_t ctime;
       time_t mtime;
   
  -    Tcl_Interp *interp = rsc->server_interp;
  +    rivet_server_conf *rsc = NULL;
  +    Tcl_Interp *interp = req->interp;
  +
  +    rsc = RIVET_SERVER_CONF( req->req->server->module_config );
   
       /* If toplevel is 0, we are being called from Parse, which means
          we need to get the information about the file ourselves. */
  @@ -378,7 +380,7 @@
   	return OK;
       }
   
  -    if (Rivet_ParseExecFile(globals->req, rsc, r->filename, 1) != TCL_OK)
  +    if (Rivet_ParseExecFile(globals->req, r->filename, 1) != TCL_OK)
       {
   	ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "%s",
   		     Tcl_GetVar(interp, "errorInfo", 0));
  
  
  
  1.17      +2 -2      tcl-rivet/src/mod_rivet.h
  
  Index: mod_rivet.h
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/mod_rivet.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- mod_rivet.h	27 Jan 2002 15:43:43 -0000	1.16
  +++ mod_rivet.h	12 Feb 2002 11:09:58 -0000	1.17
  @@ -72,8 +72,8 @@
       TclWebRequest *req;         /* TclWeb API request */
   } rivet_interp_globals;
   
  -int Rivet_ParseExecFile(TclWebRequest *req, rivet_server_conf *rsc,
  -			char *filename, int toplevel);
  +int Rivet_ParseExecFile(TclWebRequest *req, char *filename,
  +			int toplevel);
   rivet_server_conf *Rivet_GetConf(request_rec *r);
   
   #define RIVET_SERVER_CONF(module) (rivet_server_conf *)ap_get_module_config(module, &rivet_module)
  
  
  
  1.15      +7 -17     tcl-rivet/src/rivetCore.c
  
  Index: rivetCore.c
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/rivetCore.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- rivetCore.c	7 Feb 2002 10:53:11 -0000	1.14
  +++ rivetCore.c	12 Feb 2002 11:09:58 -0000	1.15
  @@ -2,7 +2,7 @@
    * rivetCore.c - Core commands which are compiled into mod_rivet itself.
    */
   
  -/* $Id: rivetCore.c,v 1.14 2002/02/07 10:53:11 davidw Exp $ */
  +/* $Id: rivetCore.c,v 1.15 2002/02/12 11:09:58 davidw Exp $ */
   
   #include "httpd.h"
   #include "http_config.h"
  @@ -40,7 +40,7 @@
       int objc,
       Tcl_Obj *CONST objv[])
   {
  -    Tcl_Obj *result;
  +    Tcl_Obj *result = NULL;
       rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", NULL);
   
       if (objc != 2)
  @@ -65,8 +65,6 @@
       char *filename;
       struct stat finfo;
       rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", NULL);
  -    rivet_server_conf *rsc =
  -	RIVET_SERVER_CONF( globals->r->server->module_config );
   
       if (objc != 2)
       {
  @@ -86,7 +84,7 @@
   	Tcl_AddErrorInfo(interp, Tcl_PosixError(interp));
   	return TCL_ERROR;
       }
  -    if (Rivet_ParseExecFile(globals->req, rsc, filename, 0) == TCL_OK)
  +    if (Rivet_ParseExecFile(globals->req, filename, 0) == TCL_OK)
   	return TCL_OK;
       else
   	return TCL_ERROR;
  @@ -213,9 +211,7 @@
   	    Tcl_WrongNumArgs(interp, 2, objv, "headername value");
   	    return TCL_ERROR;
   	}
  -	ap_table_set(globals->r->headers_out,
  -		     Tcl_GetStringFromObj (objv[2], (int *)NULL),
  -		     Tcl_GetStringFromObj (objv[3], (int *)NULL));
  +	TclWeb_HeaderSet(Tcl_GetString(objv[2]), Tcl_GetString(objv[3]), globals->req);
       }
       else if (!strcmp("type", opt)) /* ### set ### */
       {
  @@ -245,8 +241,6 @@
       return TCL_OK;
   }
   
  -/* Tcl command to get and parse any CGI and environmental variables */
  -
   /* Get the environmental variables, but do it from a tcl function, so
      we can decide whether we wish to or not */
   
  @@ -632,8 +626,6 @@
   TCL_CMD_HEADER( Rivet_AbortPageCmd )
   {
       rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", NULL);
  -    rivet_server_conf *rsc =
  -	RIVET_SERVER_CONF( globals->r->server->module_config );
   
       if (objc != 1)
       {
  @@ -642,11 +634,9 @@
       }
   
       TclWeb_PrintHeaders(globals->req);
  -    Tcl_Flush(*(rsc->outchannel));
  -
  -    globals->r->connection->aborted = 1;
  -
  -    return TCL_OK;
  +    Tcl_Flush(Tcl_GetChannel(interp, "stdout", NULL));
  +    TclWeb_StopSending(globals->req);
  +    return TCL_RETURN;
   }
   
   int
  
  
  

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