Upgrade to 0.11.1... The contents of the patch-tmp should really be

submitted  to the  libapreq  developers --  the  mod_dtcl author  simply
bundles a couple of their source files with mod_dtcl...
This commit is contained in:
Mikhail Teterin 2001-08-08 03:23:35 +00:00
parent 2379127908
commit 97d3f9d9d8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=45938
6 changed files with 66 additions and 41 deletions

View File

@ -6,8 +6,7 @@
#
PORTNAME= mod_dtcl
PORTVERSION= 0.11.0
PORTREVISION= 1
PORTVERSION= 0.11.1
CATEGORIES= www tcl83
MASTER_SITES= http://tcl.apache.org/mod_dtcl/download/

View File

@ -1 +1 @@
MD5 (mod_dtcl-0.11.0.tar.gz) = 3311a9d05b586d3a95c2d0172fb9e0df
MD5 (mod_dtcl-0.11.1.tar.gz) = b13504f9507fc6ff819ee5d2b8d37332

View File

@ -23,7 +23,7 @@ INTERNALLIB= True # to avoid building a static version
SRCS= mod_dtcl.c
SRCS+= apache_cookie.c apache_multipart_buffer.c apache_request.c \
tcl_commands.c
parser.c tcl_commands.c
NOMAN= True # don't bother with the man-page here, let the port handle it

View File

@ -1,15 +1,36 @@
--- mod_dtcl.c Tue May 1 11:56:01 2001
+++ mod_dtcl.c Fri Jun 1 20:29:10 2001
@@ -735,3 +735,3 @@
/* take results and create tcl variables from them */
-#if USE_ONLY_VAR_COMMAND == 1
+#if USE_ONLY_VAR_COMMAND == 0
if (req->parms)
@@ -792 +792,6 @@
- chan = Tcl_MakeFileChannel((ClientData *)fileno(upload->fp), TCL_READABLE);
+ union {
+ ClientData handle;
+ int fd;
+ } handle;
+ handle.fd = fileno(upload->fp);
--- tcl_commands.c Fri Jun 29 12:38:00 2001
+++ tcl_commands.c Tue Aug 7 22:55:11 2001
@@ -676,7 +676,14 @@
{
+ union {
+ ClientData handle;
+ int fd;
+ } handle;
+ FILE *f;
Tcl_Channel chan;
char *method = Tcl_GetString(objv[3]);
+ f = ApacheUpload_FILE(upload);
+ handle.fd = f ? fileno(f) : -1;
if (!strcmp(method, "channel"))
{
- if (ApacheUpload_FILE(upload) != NULL)
+ if (handle.fd != -1)
{
@@ -684,4 +690,3 @@
char *channelname = NULL;
- chan = Tcl_MakeFileChannel((ClientData *)fileno(
- ApacheUpload_FILE(upload)), TCL_READABLE);
+ chan = Tcl_MakeFileChannel(handle.handle, TCL_READABLE);
Tcl_RegisterChannel(interp, chan);
@@ -709,4 +714,3 @@
- chan = Tcl_MakeFileChannel((ClientData *)fileno(
- ApacheUpload_FILE(upload)), TCL_READABLE);
+ chan = Tcl_MakeFileChannel(handle.handle, TCL_READABLE);
Tcl_SetChannelOption(interp, chan, "-translation", "binary");
@@ -736,4 +740,3 @@
bytes = Tcl_Alloc(ApacheUpload_size(upload));
- chan = Tcl_MakeFileChannel((ClientData *)fileno(
- ApacheUpload_FILE(upload)), TCL_READABLE);
+ chan = Tcl_MakeFileChannel(handle.handle, TCL_READABLE);
Tcl_SetChannelOption(interp, chan, "-translation", "binary");

View File

@ -1,23 +1,25 @@
--- apache_request.c Mon Mar 19 12:36:42 2001
+++ apache_request.c Fri Jun 1 20:36:57 2001
@@ -328,20 +328,34 @@
--- apache_request.c Sat Jun 23 10:11:03 2001
+++ apache_request.c Tue Aug 7 22:37:51 2001
@@ -341,22 +341,33 @@
{
request_rec *r = req->r;
FILE *fp;
- char prefix[] = "apreq";
- char *name;
- int fd, tries = 100;
-
+#define PREFIX "apreq"
char *name = NULL;
- int fd = 0;
- int tries = 100;
+ int fd;
+ char *dirs[5], **dir;
- while (--tries > 0) {
- if ( (name = tempnam(req->temp_dir, prefix)) == NULL ) continue;
- fd = ap_popenf(r->pool, name, O_CREAT|O_EXCL|O_RDWR, 0600);
- if ( (name = tempnam(req->temp_dir, prefix)) == NULL )
- continue;
- fd = ap_popenf(r->pool, name, O_CREAT|O_EXCL|O_RDWR|O_BINARY, 0600);
- if ( fd >= 0 )
- break; /* success */
- else
+#define PREFIX "apreq"
+ char *name = NULL;
+ int fd = -1;
+ char *dirs[5], **dir;
+
- free(name);
+ dirs[0] = getenv("TMPDIR"); dirs[1] = req->temp_dir;
+ dirs[2] = P_tmpdir; dirs[3] = "/tmp"; dirs[4] = NULL;
+
@ -27,7 +29,7 @@
+ */
+ for (dir = dirs; *dir == NULL; dir++) /* Nothing */;
+
+ /* Now, try to create the temporary file in on of the directories: */
+ /* Now, try to create the temporary file in one of the directories: */
+ for (fd = -1; fd == -1 && *dir; dir++) {
+ name = malloc(strlen(*dir) + sizeof PREFIX + 8);
+ if (!name) {
@ -36,15 +38,11 @@
+ }
+ sprintf(name, "%s/%s.XXXXXX", *dir, PREFIX);
+ fd = mkstemp(name);
+ if (fd == -1)
free(name);
+ if (fd == -1) free(name);
}
-
- if ( tries == 0 || (fp = ap_pfdopen(r->pool, fd, "w+") ) == NULL ) {
+
+ if ( fd == -1 || (fp = ap_pfdopen(r->pool, fd, "w+") ) == NULL ) {
ap_log_rerror(REQ_ERROR,
- "[libapreq] could not open temp file '%s'", name);
+ "[libapreq] could not open temp file '%s'", name);
- if ( tries == 0 || (fp = ap_pfdopen(r->pool, fd, "w+" "b") ) == NULL ) {
+ if ( fd == -1 || (fp = ap_pfdopen(r->pool, fd, "w+" "b") ) == NULL ) {
ap_log_rerror(REQ_ERROR, "[libapreq] could not create/open temp file");
if ( fd >= 0 ) { remove(name); free(name); }
return NULL;

View File

@ -1,6 +1,13 @@
libexec/apache/mod_dtcl.so
@exec %D/sbin/apxs -e -A -n dtcl %D/%F
@unexec %D/sbin/apxs -e -A -n dtcl %D/%F
%%PORTDOCS%%share/doc/mod_dtcl/commands.html
%%PORTDOCS%%share/doc/mod_dtcl/directives.html
%%PORTDOCS%%share/doc/mod_dtcl/index.html
%%PORTDOCS%%share/doc/mod_dtcl/install.html
%%PORTDOCS%%share/doc/mod_dtcl/nav.html
%%PORTDOCS%%share/doc/mod_dtcl/other.html
%%PORTDOCS%%share/doc/mod_dtcl/top.html
%%PORTDOCS%%share/doc/mod_dtcl/asf_logo.gif
%%PORTDOCS%%share/doc/mod_dtcl/documentation.html
%%PORTDOCS%%share/doc/mod_dtcl/dtcl.gif