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/src TclWebapache.c
Date Tue, 07 Jan 2003 21:28:18 GMT
davidw      2003/01/07 13:28:17

  Modified:    .        ChangeLog
               src      TclWebapache.c
  Log:
  * src/TclWebapache.c (TclWeb_UploadData): Fix from Holger Zeinert that
    makes file uploads work on windows.
  
  Revision  Changes    Path
  1.93      +5 -0      tcl-rivet/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/ChangeLog,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- ChangeLog	30 Dec 2002 18:42:35 -0000	1.92
  +++ ChangeLog	7 Jan 2003 21:28:16 -0000	1.93
  @@ -1,3 +1,8 @@
  +2003-01-07  David N. Welton  <davidw@dedasys.com>
  +
  +	* src/TclWebapache.c (TclWeb_UploadData): Fix from Holger Zeinert
  +	that makes file uploads work on windows.
  +
   2002-12-30  David N. Welton  <davidw@dedasys.com>
   
   	* doc/examples/upload.html: Changed .ttml to .rvt - thanks to
  
  
  
  1.41      +23 -7     tcl-rivet/src/TclWebapache.c
  
  Index: TclWebapache.c
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/TclWebapache.c,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- TclWebapache.c	18 Dec 2002 08:09:45 -0000	1.40
  +++ TclWebapache.c	7 Jan 2003 21:28:16 -0000	1.41
  @@ -491,9 +491,15 @@
       if (ApacheUpload_FILE(req->upload) != NULL)
       {
   	/* create and return a file channel */
  +
  +#ifdef __MINGW32__
  +	*chan = Tcl_MakeFileChannel(
  +	    (ClientData)_get_osfhandle(
  +		fileno(ApacheUpload_FILE(req->upload))), TCL_READABLE);
  +#else
   	*chan = Tcl_MakeFileChannel(
  -	    (ClientData)(int)fileno(ApacheUpload_FILE(req->upload)),
  -	    TCL_READABLE);
  +	    (ClientData)fileno(ApacheUpload_FILE(req->upload)), TCL_READABLE);
  +#endif
   	Tcl_RegisterChannel(req->interp, *chan);
   	return TCL_OK;
       } else {
  @@ -517,9 +523,14 @@
   			     "-translation", "binary");
       }
   
  +#ifdef __MINGW32__
       chan = Tcl_MakeFileChannel(
  -	(ClientData)(int)fileno(ApacheUpload_FILE(req->upload)),
  -	TCL_READABLE);
  +	(ClientData)_get_osfhandle(
  +	    fileno(ApacheUpload_FILE(req->upload))), TCL_READABLE);
  +#else
  +    chan = Tcl_MakeFileChannel(
  +	(ClientData)fileno(ApacheUpload_FILE(req->upload)), TCL_READABLE);
  +#endif
       Tcl_SetChannelOption(req->interp, chan, "-translation", "binary");
   
       while ((sz = Tcl_Read(chan, savebuffer, BUFSZ)))
  @@ -552,9 +563,14 @@
   	Tcl_Channel chan = NULL;
   
   	bytes = Tcl_Alloc((unsigned)ApacheUpload_size(req->upload));
  +#ifdef __MINGW32__
  +	chan = Tcl_MakeFileChannel(
  +	    (ClientData)_get_osfhandle(
  +		fileno(ApacheUpload_FILE(req->upload))), TCL_READABLE);
  +#else
   	chan = Tcl_MakeFileChannel(
  -	    (ClientData)(int)fileno(ApacheUpload_FILE(req->upload)),
  -	    TCL_READABLE);
  +	    (ClientData)fileno(ApacheUpload_FILE(req->upload)), TCL_READABLE);
  +#endif
   	Tcl_SetChannelOption(req->interp, chan,
   			     "-translation", "binary");
   	Tcl_SetChannelOption(req->interp, chan, "-encoding", "binary");
  
  
  

---------------------------------------------------------------------
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