tcl-rivet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject cvs commit: tcl-rivet/tests uploadsave.rvt upload.test
Date Tue, 01 Jul 2003 07:46:45 GMT
davidw      2003/07/01 00:46:45

  Modified:    .        ChangeLog STATUS TODO
               src      apache_request.c apache_request.h make.tcl
                        mod_rivet.c mod_rivet.h rivetCore.c
               tests    upload.test
  Added:       tests    uploadsave.rvt
  Log:
  * src/rivetCore.c (Rivet_Upload): Pass the correct element of objv to
    TclWeb_UploadSave.
  
  * tests/uploadsave.rvt: New file to test 'upload save'.
  
  * tests/upload.test: New test for 'upload save'.
  
  * src/mod_rivet.c (Rivet_ParseExecFile): Use Tcl_FSStat instead of
    Tcl_Stat.
  
  * src/rivetCore.c (Rivet_Parse): Use Tcl_FSStat instead of Tcl_Stat.
  
  Revision  Changes    Path
  1.123     +17 -0     tcl-rivet/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/ChangeLog,v
  retrieving revision 1.122
  retrieving revision 1.123
  diff -u -r1.122 -r1.123
  --- ChangeLog	29 Jun 2003 11:03:53 -0000	1.122
  +++ ChangeLog	1 Jul 2003 07:46:44 -0000	1.123
  @@ -1,3 +1,20 @@
  +2003-07-01  David N. Welton  <davidw@dedasys.com>
  +
  +	* src/rivetCore.c (Rivet_Upload): Pass the correct element of objv
  +	to TclWeb_UploadSave.
  +
  +	* tests/uploadsave.rvt: New file to test 'upload save'.
  +
  +	* tests/upload.test: New test for 'upload save'.
  +
  +2003-06-30  David N. Welton  <davidw@dedasys.com>
  +
  +	* src/mod_rivet.c (Rivet_ParseExecFile): Use Tcl_FSStat instead of
  +	Tcl_Stat.
  +
  +	* src/rivetCore.c (Rivet_Parse): Use Tcl_FSStat instead of
  +	Tcl_Stat.
  +
   2003-06-29  David N. Welton  <davidw@dedasys.com>
   
   	* doc/rivet.xml: Add IRC reference to the help section of the
  
  
  
  1.10      +0 -1      tcl-rivet/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/STATUS,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- STATUS	19 May 2003 22:24:56 -0000	1.9
  +++ STATUS	1 Jul 2003 07:46:44 -0000	1.10
  @@ -21,4 +21,3 @@
   
   *) Documentation
   
  -   * Add documentation for commands implemented in Tcl.
  
  
  
  1.19      +2 -0      tcl-rivet/TODO
  
  Index: TODO
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/TODO,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- TODO	22 May 2003 10:51:31 -0000	1.18
  +++ TODO	1 Jul 2003 07:46:44 -0000	1.19
  @@ -49,6 +49,8 @@
   
   * Document the 'form' package.
   
  +* Integrate ncgi package, to help migration for people using it.
  +
   MAYBE
   =====
   
  
  
  
  1.7       +2 -2      tcl-rivet/src/apache_request.c
  
  Index: apache_request.c
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/apache_request.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- apache_request.c	12 May 2003 07:51:00 -0000	1.6
  +++ apache_request.c	1 Jul 2003 07:46:45 -0000	1.7
  @@ -58,6 +58,7 @@
   
   #include "apache_request.h"
   #include "apache_multipart_buffer.h"
  +
   int fill_buffer(multipart_buffer *self); /* needed for mozilla hack */
   
   static void req_plustospace(char *str)
  @@ -356,7 +357,7 @@
   	return OK;
   }
   
  -static int urlword_dlm[] = {'&', ';', 0};
  +/* static int urlword_dlm[] = {'&', ';', 0}; */
   
   static char *my_urlword(pool *p, const char **line)
   {
  @@ -428,7 +429,6 @@
   
       req->parsed = 1;
       return result;
  -
   }
   
   int ApacheRequest_parse_urlencoded(ApacheRequest *req)
  
  
  
  1.3       +2 -0      tcl-rivet/src/apache_request.h
  
  Index: apache_request.h
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/apache_request.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apache_request.h	14 Dec 2002 19:04:35 -0000	1.2
  +++ apache_request.h	1 Jul 2003 07:46:45 -0000	1.3
  @@ -88,6 +88,8 @@
   #endif 
   
   ApacheRequest *ApacheRequest_new(request_rec *r);
  +/* int ApacheRequest_save_post_data(request_rec *r, int flag);
  +char *ApacheRequest_fetch_post_data(request_rec *r);  */
   int ApacheRequest_parse_multipart(ApacheRequest *req);
   int ApacheRequest_parse_urlencoded(ApacheRequest *req);
   char *ApacheRequest_script_name(ApacheRequest *req);
  
  
  
  1.43      +14 -7     tcl-rivet/src/make.tcl
  
  Index: make.tcl
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/make.tcl,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- make.tcl	12 Jun 2003 13:51:34 -0000	1.42
  +++ make.tcl	1 Jul 2003 07:46:45 -0000	1.43
  @@ -22,12 +22,19 @@
   
   ##
   ## Set this variable to the location of your apxs script if it cannot be
  -## found by make.tcl
  +## found by make.tcl, or use the environmental variable 'APXS_LOCATION'.
   ##
  +
   set APXS "apxs"
   
  -## Try to find the Apache apxs script.
  -set APXS [FindAPXS $APXS]
  +if { [info exists env(APXS_LOCATION)] } {
  +    set APXS $env(APXS_LOCATION)
  +} else {
  +    ## Try to find the Apache apxs script.
  +    set APXS [FindAPXS $APXS]
  +}
  +
  +# set APXS "path/to/apxs"
   
   if { ![string length $APXS] } {
       puts stderr "Could not find Apache apxs script."
  @@ -66,7 +73,7 @@
   set XSL [file join .. doc rivet.xsl]
   set XML [file join .. doc rivet.xml]
   # Existing translations.
  -set TRANSLATIONS ru_UTF
  +set TRANSLATIONS ru
   set PKGINDEX [file join .. rivet pkgIndex.tcl]
   
   # ------------
  @@ -268,9 +275,9 @@
   
   AddNode distdoc {
       depends $XML $XSL
  -    sh xsltproc --stringparam html.stylesheet rivet.css --nonet -o $HTML $XSLCHUNK $XML
  +    sh xsltproc --stringparam html.stylesheet rivet.css --stringparam html.ext ".html.en"
--nonet -o $HTML $XSLCHUNK $XML
       foreach tr $TRANSLATIONS {
  -	sh xsltproc --stringparam html.stylesheet rivet.css  --stringparam html.ext ".${tr}.html"
--nonet -o $HTML $XSLCHUNK [string map [list .xml ".${tr}.xml"] $XML]
  +	sh xsltproc --stringparam html.stylesheet rivet.css  --stringparam html.ext ".html.${tr}"
--nonet -o $HTML $XSLCHUNK [string map [list .xml ".${tr}.xml"] $XML]
       }
   }
   
  
  
  
  1.66      +10 -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.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- mod_rivet.c	12 Jun 2003 15:32:04 -0000	1.65
  +++ mod_rivet.c	1 Jul 2003 07:46:45 -0000	1.66
  @@ -214,10 +214,15 @@
          we need to get the information about the file ourselves. */
       if (toplevel == 0)
       {
  -	struct stat stat;
  -	if( Tcl_Stat(filename, &stat) < 0 ) return TCL_ERROR;
  -	ctime = stat.st_ctime;
  -	mtime = stat.st_mtime;
  +	Tcl_Obj *fnobj;
  +	Tcl_StatBuf buf;
  +
  +	fnobj = Tcl_NewStringObj(filename, -1);
  +	Tcl_IncrRefCount(fnobj);
  +	if( Tcl_FSStat(fnobj, &buf) < 0 ) return TCL_ERROR;
  +	Tcl_DecrRefCount(fnobj);
  +	ctime = buf.st_ctime;
  +	mtime = buf.st_mtime;
       } else {
   	ctime = req->req->finfo.st_ctime;
   	mtime = req->req->finfo.st_mtime;
  
  
  
  1.28      +1 -1      tcl-rivet/src/mod_rivet.h
  
  Index: mod_rivet.h
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/mod_rivet.h,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- mod_rivet.h	22 May 2003 10:51:32 -0000	1.27
  +++ mod_rivet.h	1 Jul 2003 07:46:45 -0000	1.28
  @@ -40,7 +40,7 @@
   #   define CONST84
   #endif
   
  -/* Note that STARTING_SEQUENCE and ENDING_SEQUENCE (<? and ?>,
  +/* Note: STARTING_SEQUENCE and ENDING_SEQUENCE (<? and ?>,
      respectively) are now defined in rivetParser.h. */
   
   #define VAR_SRC_QUERYSTRING 1
  
  
  
  1.34      +11 -4     tcl-rivet/src/rivetCore.c
  
  Index: rivetCore.c
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/rivetCore.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- rivetCore.c	26 May 2003 21:20:25 -0000	1.33
  +++ rivetCore.c	1 Jul 2003 07:46:45 -0000	1.34
  @@ -62,7 +62,9 @@
       Tcl_Obj *CONST objv[])
   {
       char *filename;
  -    struct stat finfo;
  +    Tcl_StatBuf buf;
  +    Tcl_Obj *fnobj;
  +    int retval = 0;
       rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", NULL);
   
       if( objc < 2 || objc > 3 )
  @@ -88,11 +90,16 @@
   	return TCL_ERROR;
       }
   
  -    if (stat(filename, &finfo))
  +    fnobj = Tcl_NewStringObj(filename, -1);
  +    Tcl_IncrRefCount(fnobj);
  +    retval = Tcl_FSStat(fnobj, &buf);
  +    Tcl_DecrRefCount(fnobj);
  +    if (retval != 0)
       {
   	Tcl_AddErrorInfo(interp, Tcl_PosixError(interp));
   	return TCL_ERROR;
       }
  +
       if (Rivet_ParseExecFile(globals->req, filename, 0) == TCL_OK) {
   	return TCL_OK;
       } else {
  @@ -534,7 +541,7 @@
   	    return TCL_ERROR;
   	}
   
  -	if (TclWeb_UploadSave(varname, objv[4], globals->req) != TCL_OK)
  +	if (TclWeb_UploadSave(varname, objv[3], globals->req) != TCL_OK)
   	{
   	    return TCL_ERROR;
   	}
  
  
  
  1.4       +21 -1     tcl-rivet/tests/upload.test
  
  Index: upload.test
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/tests/upload.test,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- upload.test	5 Nov 2002 01:13:24 -0000	1.3
  +++ upload.test	1 Jul 2003 07:46:45 -0000	1.4
  @@ -15,6 +15,26 @@
   		  -type "multipart/form-data; boundary=$bound" -query $outputData]
   
       set ret [string trim [::http::data $page]]
  +    ::http::cleanup $page
       set ret
   } {uploadtest 1 42747  AngeloFish.jpg}
   
  +set testfilename1 uploadsave.rvt
  +
  +::tcltest::test upload-1.2 {upload save} {
  +    file delete uploadedjpeg.jpg
  +    set bound "-----NEXT_PART_[clock seconds].[pid]"
  +    set fl [open AngeloFish.jpg r]
  +    fconfigure $fl -translation binary
  +    set data [read $fl]
  +    close $fl
  +
  +    set outputData "--$bound\r\nContent-Disposition: form-data; name=\"uploadtest\"; filename=\"AngeloFish.jpg\"\r\n\r\n$data\n${bound}--"
  +
  +    set page [::http::geturl "${urlbase}$testfilename1" \
  +		  -type "multipart/form-data; boundary=$bound" -query $outputData]
  +
  +    set ret [string trim [::http::data $page]]
  +    ::http::cleanup $page
  +    file size uploadedjpeg.jpg
  +} {42747}
  
  
  
  1.1                  tcl-rivet/tests/uploadsave.rvt
  
  Index: uploadsave.rvt
  ===================================================================
  <?
  upload save [upload names] uploadedjpeg.jpg
  ?>
  
  

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


Mime
View raw message