You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-cvs@tcl.apache.org by ro...@apache.org on 2002/03/27 20:08:37 UTC
cvs commit: tcl-websh/src/generic formdata.c
ronnie 02/03/27 11:08:37
Modified: src/generic formdata.c
Log:
- set back channels after reading form data
in parseUrlEncodedFormData and parseMultipartFormData
Revision Changes Path
1.6 +15 -6 tcl-websh/src/generic/formdata.c
Index: formdata.c
===================================================================
RCS file: /home/cvs/tcl-websh/src/generic/formdata.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- formdata.c 7 Mar 2002 18:55:40 -0000 1.5
+++ formdata.c 27 Mar 2002 19:08:37 -0000 1.6
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and
* redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * @(#) $Id: formdata.c,v 1.5 2002/03/07 18:55:40 davidw Exp $
+ * @(#) $Id: formdata.c,v 1.6 2002/03/27 19:08:37 ronnie Exp $
*
*/
@@ -40,6 +40,7 @@
int mode;
int readToEnd = 0;
int content_length = 0;
+ Tcl_DString translation;
channel = Web_GetChannelOrVarChannel(interp, channelName, &mode);
if (channel == NULL) {
@@ -61,8 +62,8 @@
return TCL_ERROR;
}
- /* fixme: we don't set the channel options back. maybe we should. */
- /* For now (3.5) we will add this to the documentation. */
+ Tcl_DStringInit(&translation);
+ Tcl_GetChannelOption(interp, channel, "-translation", &translation);
Tcl_SetChannelOption(interp, channel, "-translation", "binary");
/* ------------------------------------------------------------------------
@@ -86,6 +87,8 @@
if (Tcl_GetIntFromObj(interp, len, &content_length) != TCL_OK) {
+ Tcl_SetChannelOption(interp, channel, "-translation", Tcl_DStringValue(&translation));
+ Tcl_DStringFree(&translation);
/* unregister if was a varchannel */
Web_UnregisterVarChannel(interp, channelName, channel);
return TCL_ERROR;
@@ -118,6 +121,8 @@
Tcl_DecrRefCount(formData);
+ Tcl_SetChannelOption(interp, channel, "-translation", Tcl_DStringValue(&translation));
+ Tcl_DStringFree(&translation);
/* unregister if was a varchannel */
Web_UnregisterVarChannel(interp, channelName, channel);
@@ -125,6 +130,8 @@
}
}
+ Tcl_SetChannelOption(interp, channel, "-translation", Tcl_DStringValue(&translation));
+ Tcl_DStringFree(&translation);
/* unregister if was a varchannel */
Web_UnregisterVarChannel(interp, channelName, channel);
@@ -186,6 +193,7 @@
int mode;
char *boundary = mimeGetParamFromContDisp(content_type, "boundary");
int res = 0;
+ Tcl_DString translation;
/* printf("DBG parseMultipartFormData - starting\n"); fflush(stdout); */
@@ -214,13 +222,14 @@
return TCL_ERROR;
}
- /* fixme: we don't set the channel options back. maybe we should. */
- /* For now (3.5) we will add this to the documentation. */
+ Tcl_DStringInit(&translation);
+ Tcl_GetChannelOption(interp, channel, "-translation", &translation);
Tcl_SetChannelOption(interp, channel, "-translation", "binary");
-
res = mimeSplitMultipart(interp, channel, boundary, requestData);
+ Tcl_SetChannelOption(interp, channel, "-translation", Tcl_DStringValue(&translation));
+ Tcl_DStringFree(&translation);
/* unregister if was a varchannel */
Web_UnregisterVarChannel(interp, channelName, channel);
---------------------------------------------------------------------
To unsubscribe, e-mail: websh-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-cvs-help@tcl.apache.org