You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_dtcl-cvs@tcl.apache.org by da...@apache.org on 2002/11/05 01:33:05 UTC
cvs commit: tcl-moddtcl/debian changelog
davidw 2002/11/04 16:33:05
Modified: . Makefile apache_cookie.c apache_cookie.h
apache_multipart_buffer.c apache_multipart_buffer.h
apache_request.c builddtcl.sh channel.c mod_dtcl.c
mod_dtcl.h tcl_commands.c
debian changelog
Log:
* Cleanup after HEAD requests.
* Make changes necessary for Tcl 8.4 compatibility.
* Update to latest httpd-apreq code.
Revision Changes Path
1.19 +5 -5 tcl-moddtcl/Makefile
Index: Makefile
===================================================================
RCS file: /home/cvs/tcl-moddtcl/Makefile,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Makefile 5 Sep 2001 12:01:22 -0000 1.18
+++ Makefile 5 Nov 2002 00:33:04 -0000 1.19
@@ -23,10 +23,10 @@
all: builddtcl_test shared
static: $(OBJECTS) docs/documentation.html
- $(TCL_STLIB_LD) $(STATICLIB) $(OBJECTS)
+ $(TCL_STLIB_LD) $(STATICLIB) $(OBJECTS)
shared: $(OBJECTS) docs/documentation.html
- $(TCL_SHLIB_LD) -o $(SHLIB) $(OBJECTS) $(TCL_LIB_SPEC) $(TCL_LIBS)
+ $(TCL_SHLIB_LD) $(TCL_SHLIB_CFLAGS) -o $(SHLIB) $(OBJECTS) $(TCL_LIB_SPEC) $(TCL_LIBS)
# I don't have too many C files, so it's just clearer to do things by
# hand
@@ -46,10 +46,10 @@
channel.o: channel.c mod_dtcl.h channel.h
$(COMPILE)
-clean:
+clean:
-rm -f $(STATICLIB) $(SHLIB) *.o *~ docs/documentation.txt docs/documentation.html
-version:
+version:
./cvsversion.tcl
docs/documentation.html:
1.5 +63 -64 tcl-moddtcl/apache_cookie.c
Index: apache_cookie.c
===================================================================
RCS file: /home/cvs/tcl-moddtcl/apache_cookie.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- apache_cookie.c 21 Jun 2001 17:47:08 -0000 1.4
+++ apache_cookie.c 5 Nov 2002 00:33:04 -0000 1.5
@@ -1,5 +1,8 @@
/* ====================================================================
- * Copyright (c) 1995-1999 The Apache Group. All rights reserved.
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -13,46 +16,44 @@
* the documentation and/or other materials provided with the
* distribution.
*
- * 3. All advertising materials mentioning features or use of this
- * software must display the following acknowledgment:
- * "This product includes software developed by the Apache Group
- * for use in the Apache HTTP server project (http://www.apache.org/)."
- *
- * 4. The names "Apache Server" and "Apache Group" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For written permission, please contact
- * apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * 6. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by the Apache Group
- * for use in the Apache HTTP server project (http://www.apache.org/)."
- *
- * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ * not be used to endorse or promote products derived from this
+ * software without prior written permission. For written
+ * permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * nor may "Apache" appear in their name, without prior written
+ * permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Group and was originally based
- * on public domain software written at the National Center for
- * Supercomputing Applications, University of Illinois, Urbana-Champaign.
- * For more information on the Apache Group and the Apache HTTP server
- * project, please see <http://www.apache.org/>.
- *
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ * Portions of this software are based upon public domain software
+ * originally written at the National Center for Supercomputing Applications,
+ * University of Illinois, Urbana-Champaign.
*/
#include "apache_cookie.h"
@@ -62,16 +63,15 @@
char *expires;
expires = ApacheUtil_expires(c->r->pool, time_str, EXPIRES_COOKIE);
- if (expires) {
+ if (expires)
c->expires = expires;
- }
return c->expires;
}
#define cookie_get_set(thing,val) \
-retval = thing; \
-if(val) thing = ap_pstrdup(c->r->pool, val)
+ retval = thing; \
+ if(val) thing = ap_pstrdup(c->r->pool, val)
char *ApacheCookie_attr(ApacheCookie *c, char *key, char *val)
{
@@ -130,9 +130,9 @@
for(;;) {
char *key, *val;
key = va_arg(args, char *);
- if (key == NULL) {
+ if (key == NULL)
break;
- }
+
val = va_arg(args, char *);
(void)ApacheCookie_attr(c, key, val);
}
@@ -147,35 +147,36 @@
ApacheCookieJar *retval =
ap_make_array(r->pool, 1, sizeof(ApacheCookie *));
- if (!data) {
- if (!(data = ap_table_get(r->headers_in, "Cookie"))) {
+ if (!data)
+ if (!(data = ap_table_get(r->headers_in, "Cookie")))
return retval;
- }
- }
while (*data && (pair = ap_getword(r->pool, &data, ';'))) {
const char *key, *val;
ApacheCookie *c;
- while (ap_isspace(*data)) {
+ while (ap_isspace(*data))
++data;
- }
+
key = ap_getword(r->pool, &pair, '=');
ap_unescape_url((char *)key);
c = ApacheCookie_new(r, "-name", key, NULL);
- if (c->values) {
+
+ if (c->values)
c->values->nelts = 0;
- }
- else {
+ else
c->values = ap_make_array(r->pool, 4, sizeof(char *));
- }
- if (!*pair) {
+ if (!*pair)
ApacheCookieAdd(c, "");
- }
- while (*pair && (val = ap_getword(r->pool, &pair, '&'))) {
+
+ while (*pair && (val = ap_getword_nulls(r->pool, &pair, '&'))) {
ap_unescape_url((char *)val);
+#ifdef DEBUG
+ ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
+ "[apache_cookie] added (%s)", val);
+#endif
ApacheCookieAdd(c, val);
}
ApacheCookieJarAdd(retval, c);
@@ -188,7 +189,7 @@
*(char **)ap_push_array(arr) = (char *)val
#define cookie_push_named(arr, name, val) \
- if(val) { \
+ if(val && strlen(val) > 0) { \
cookie_push_arr(arr, ap_pstrcat(p, name, "=", val, NULL)); \
}
@@ -198,6 +199,7 @@
char *end = result + strlen(result);
char *seek;
+ /* touchup result to ensure that special chars are escaped */
for ( seek = end-1; seek >= result; --seek) {
char *ptr, *replacement;
@@ -215,10 +217,8 @@
continue; /* next for() */
}
-
- for (ptr = end; ptr > seek; --ptr) {
- ptr[2] = ptr[0];
- }
+ for (ptr = end; ptr > seek; --ptr)
+ ptr[2] = ptr[0];
strncpy(seek, replacement, 3);
end += 2;
@@ -234,9 +234,8 @@
char *cookie, *retval;
int i;
- if (!c->name) {
+ if (!c->name)
return "";
- }
values = ap_make_array(p, 6, sizeof(char *));
cookie_push_named(values, "domain", c->domain);
@@ -250,7 +249,7 @@
for (i=0; i<c->values->nelts; i++) {
cookie = ap_pstrcat(p, cookie,
escape_url(p, ((char**)c->values->elts)[i]),
- (i < (c->values->nelts-1) ? "&" : NULL),
+ (i < (c->values->nelts -1) ? "&" : NULL),
NULL);
}
1.2 +13 -0 tcl-moddtcl/apache_cookie.h
Index: apache_cookie.h
===================================================================
RCS file: /home/cvs/tcl-moddtcl/apache_cookie.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- apache_cookie.h 19 Dec 2000 11:59:10 -0000 1.1
+++ apache_cookie.h 5 Nov 2002 00:33:04 -0000 1.2
@@ -1,3 +1,6 @@
+#ifndef _APACHE_COOKIE_H
+#define _APACHE_COOKIE_H
+
#include "apache_request.h"
typedef array_header ApacheCookieJar;
@@ -12,6 +15,10 @@
int secure;
} ApacheCookie;
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
#define ApacheCookieJarItems(arr) arr->nelts
#define ApacheCookieJarFetch(arr,i) \
@@ -41,4 +48,10 @@
char *ApacheCookie_expires(ApacheCookie *c, char *time_str);
void ApacheCookie_bake(ApacheCookie *c);
+#ifdef __cplusplus
+ }
+#endif
+
#define APC_ERROR APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, c->r
+
+#endif
1.6 +45 -37 tcl-moddtcl/apache_multipart_buffer.c
Index: apache_multipart_buffer.c
===================================================================
RCS file: /home/cvs/tcl-moddtcl/apache_multipart_buffer.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- apache_multipart_buffer.c 21 Jun 2001 17:47:09 -0000 1.5
+++ apache_multipart_buffer.c 5 Nov 2002 00:33:04 -0000 1.6
@@ -1,5 +1,8 @@
/* ====================================================================
- * Copyright (c) 1995-1999 The Apache Group. All rights reserved.
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -13,46 +16,44 @@
* the documentation and/or other materials provided with the
* distribution.
*
- * 3. All advertising materials mentioning features or use of this
- * software must display the following acknowledgment:
- * "This product includes software developed by the Apache Group
- * for use in the Apache HTTP server project (http://www.apache.org/)."
- *
- * 4. The names "Apache Server" and "Apache Group" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For written permission, please contact
- * apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * 6. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by the Apache Group
- * for use in the Apache HTTP server project (http://www.apache.org/)."
- *
- * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ * not be used to endorse or promote products derived from this
+ * software without prior written permission. For written
+ * permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * nor may "Apache" appear in their name, without prior written
+ * permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Group and was originally based
- * on public domain software written at the National Center for
- * Supercomputing Applications, University of Illinois, Urbana-Champaign.
- * For more information on the Apache Group and the Apache HTTP server
- * project, please see <http://www.apache.org/>.
- *
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ * Portions of this software are based upon public domain software
+ * originally written at the National Center for Supercomputing Applications,
+ * University of Illinois, Urbana-Champaign.
*/
#include "apache_multipart_buffer.h"
@@ -103,6 +104,13 @@
/* calculate the free space in the buffer */
bytes_to_read = self->bufsize - self->bytes_in_buffer;
+
+ if (bytes_to_read >= self->r->remaining) {
+ bytes_to_read = self->r->remaining - strlen(self->boundary);
+#ifdef DEBUG
+ ap_log_rerror(MPB_ERROR, "mozilla 0.97 hack: '%ld'", self->r->remaining);
+#endif
+ }
/* read the required number of bytes */
if(bytes_to_read > 0) {
1.2 +13 -0 tcl-moddtcl/apache_multipart_buffer.h
Index: apache_multipart_buffer.h
===================================================================
RCS file: /home/cvs/tcl-moddtcl/apache_multipart_buffer.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- apache_multipart_buffer.h 19 Dec 2000 11:59:10 -0000 1.1
+++ apache_multipart_buffer.h 5 Nov 2002 00:33:04 -0000 1.2
@@ -1,9 +1,16 @@
+#ifndef _APACHE_MULTIPART_BUFFER_H
+#define _APACHE_MULTIPART_BUFFER_H
+
#include "apache_request.h"
/*#define DEBUG 1*/
#define FILLUNIT (1024 * 5)
#define MPB_ERROR APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, self->r
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
typedef struct {
/* request info */
request_rec *r;
@@ -27,3 +34,9 @@
int multipart_buffer_read(multipart_buffer *self, char *buf, int bytes);
char *multipart_buffer_read_body(multipart_buffer *self);
int multipart_buffer_eof(multipart_buffer *self);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif
1.9 +71 -62 tcl-moddtcl/apache_request.c
Index: apache_request.c
===================================================================
RCS file: /home/cvs/tcl-moddtcl/apache_request.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- apache_request.c 23 Jun 2001 14:11:03 -0000 1.8
+++ apache_request.c 5 Nov 2002 00:33:04 -0000 1.9
@@ -1,5 +1,8 @@
/* ====================================================================
- * Copyright (c) 1995-1999 The Apache Group. All rights reserved.
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -13,50 +16,49 @@
* the documentation and/or other materials provided with the
* distribution.
*
- * 3. All advertising materials mentioning features or use of this
- * software must display the following acknowledgment:
- * "This product includes software developed by the Apache Group
- * for use in the Apache HTTP server project (http://www.apache.org/)."
- *
- * 4. The names "Apache Server" and "Apache Group" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For written permission, please contact
- * apache@apache.org.
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
*
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ * not be used to endorse or promote products derived from this
+ * software without prior written permission. For written
+ * permission, please contact apache@apache.org.
*
- * 6. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by the Apache Group
- * for use in the Apache HTTP server project (http://www.apache.org/)."
+ * 5. Products derived from this software may not be called "Apache",
+ * nor may "Apache" appear in their name, without prior written
+ * permission of the Apache Software Foundation.
*
- * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Group and was originally based
- * on public domain software written at the National Center for
- * Supercomputing Applications, University of Illinois, Urbana-Champaign.
- * For more information on the Apache Group and the Apache HTTP server
- * project, please see <http://www.apache.org/>.
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
*
+ * Portions of this software are based upon public domain software
+ * originally written at the National Center for Supercomputing Applications,
+ * University of Illinois, Urbana-Champaign.
*/
#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)
{
@@ -216,37 +218,27 @@
static char *my_urlword(pool *p, const char **line)
{
- int i;
-
- for (i = 0; urlword_dlm[i]; i++) {
- int stop = urlword_dlm[i];
- char *pos = strchr(*line, stop);
- char *res;
-
- if (!pos) {
- if (!urlword_dlm[i+1]) {
- int len = strlen(*line);
- res = ap_pstrndup(p, *line, len);
- *line += len;
- return res;
- }
- continue;
- }
-
- res = ap_pstrndup(p, *line, pos - *line);
+ char *res = NULL;
+ const char *pos = *line;
+ char ch;
- while (*pos == stop) {
- ++pos;
- }
+ while ( (ch = *pos) != '\0' && ch != ';' && ch != '&') {
+ ++pos;
+ }
- *line = pos;
+ res = ap_pstrndup(p, *line, pos - *line);
- return res;
+ while (ch == ';' || ch == '&') {
+ ++pos;
+ ch = *pos;
}
- return NULL;
+ *line = pos;
+
+ return res;
}
+
static void split_to_parms(ApacheRequest *req, const char *data)
{
request_rec *r = req->r;
@@ -380,11 +372,6 @@
multipart_buffer *mbuff;
ApacheUpload *upload = NULL;
- if (req->disable_uploads) {
- ap_log_rerror(REQ_ERROR, "[libapreq] file upload forbidden");
- return HTTP_FORBIDDEN;
- }
-
if (!ct) {
ap_log_rerror(REQ_ERROR, "[libapreq] no Content-type header!");
return HTTP_INTERNAL_SERVER_ERROR;
@@ -418,6 +405,14 @@
int blen, wlen;
if (!header) {
+#ifdef DEBUG
+ ap_log_rerror(REQ_ERROR,
+ "[libapreq] silently drop remaining '%ld' bytes", r->remaining);
+#endif
+ ap_hard_timeout("[libapreq] parse_multipart", r);
+ while ( ap_get_client_block(r, buff, sizeof(buff)) > 0 )
+ /* wait for more input to ignore */ ;
+ ap_kill_timeout(r);
return OK;
}
@@ -446,6 +441,12 @@
continue;
}
if (!param) continue; /* shouldn't happen, but just in case. */
+
+ if (req->disable_uploads) {
+ ap_log_rerror(REQ_ERROR, "[libapreq] file upload forbidden");
+ return HTTP_FORBIDDEN;
+ }
+
ap_table_add(req->parms, param, filename);
if (upload) {
@@ -464,6 +465,14 @@
upload->info = header;
upload->filename = ap_pstrdup(req->r->pool, filename);
upload->name = ap_pstrdup(req->r->pool, param);
+
+ /* mozilla empty-file (missing CRLF) hack */
+ fill_buffer(mbuff);
+ if( strEQN(mbuff->buf_begin, mbuff->boundary,
+ strlen(mbuff->boundary)) ) {
+ r->remaining -= 2;
+ continue;
+ }
while ((blen = multipart_buffer_read(mbuff, buff, sizeof(buff)))) {
if (req->upload_hook != NULL) {
1.16 +7 -7 tcl-moddtcl/builddtcl.sh
Index: builddtcl.sh
===================================================================
RCS file: /home/cvs/tcl-moddtcl/builddtcl.sh,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- builddtcl.sh 9 Oct 2001 15:29:47 -0000 1.15
+++ builddtcl.sh 5 Nov 2002 00:33:04 -0000 1.16
@@ -43,7 +43,7 @@
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# INC=$APACHE/src/include
-if [ -f $INC/httpd.h ]
+if [ -f $INC/httpd.h ]
then
echo "Apache includes in $INC"
INCLUDES="-I$INC" ; export INCLUDES
@@ -61,18 +61,18 @@
export TCLSH
export TCL_CC
-export TCL_CFLAGS_DEBUG
-export TCL_CFLAGS_OPTIMIZE
-export TCL_CFLAGS_WARNING
+export TCL_CFLAGS_DEBUG
+export TCL_CFLAGS_OPTIMIZE
+export TCL_CFLAGS_WARNING
export TCL_EXTRA_CFLAGS
export TCL_LIBS
-export TCL_LIB_FLAG
+export TCL_LIB_FLAG
export TCL_LIB_SPEC
export TCL_PREFIX
export TCL_SHLIB_CFLAGS
export TCL_SHLIB_LD
export TCL_SHLIB_SUFFIX
-export TCL_STLIB_LD
+export TCL_STLIB_LD
export TCL_SRC_DIR
BUILDDTCL="YES" ; export BUILDDTCL
1.2 +2 -2 tcl-moddtcl/channel.c
Index: channel.c
===================================================================
RCS file: /home/cvs/tcl-moddtcl/channel.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- channel.c 5 Sep 2001 12:01:22 -0000 1.1
+++ channel.c 5 Nov 2002 00:33:04 -0000 1.2
@@ -18,7 +18,7 @@
/* This is the output 'method' for the Memory Buffer Tcl 'File'
Channel that we create to divert stdout to */
-static int outputproc(ClientData instancedata, char *buf, int toWrite, int *errorCodePtr)
+static int outputproc(ClientData instancedata, CONST84 char *buf, int toWrite, int *errorCodePtr)
{
dtcl_server_conf *dsc = (dtcl_server_conf *)instancedata;
Tcl_DStringAppend(dsc->buffer, buf, toWrite);
@@ -34,7 +34,7 @@
}
static int setoptionproc(ClientData instancedata, Tcl_Interp *interp,
- char *optionname, char *value)
+ CONST84 char *optionname, CONST84 char *value)
{
return TCL_OK;
}
1.56 +2 -2 tcl-moddtcl/mod_dtcl.c
Index: mod_dtcl.c
===================================================================
RCS file: /home/cvs/tcl-moddtcl/mod_dtcl.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- mod_dtcl.c 2 Nov 2002 19:00:04 -0000 1.55
+++ mod_dtcl.c 5 Nov 2002 00:33:04 -0000 1.56
@@ -330,7 +330,7 @@
print_error(r, 1, "<b>Tcl_ErrorScript failed!</b>");
} else {
/* default action */
- errorinfo = Tcl_GetVar(interp, "errorInfo", 0);
+ errorinfo = (char *) Tcl_GetVar(interp, "errorInfo", 0);
print_error(r, 0, errorinfo);
print_error(r, 1, "<p><b>OUTPUT BUFFER:</b></p>");
print_error(r, 0, Tcl_GetStringFromObj(outbuf, (int *)NULL));
1.16 +5 -0 tcl-moddtcl/mod_dtcl.h
Index: mod_dtcl.h
===================================================================
RCS file: /home/cvs/tcl-moddtcl/mod_dtcl.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- mod_dtcl.h 26 Jun 2002 13:01:58 -0000 1.15
+++ mod_dtcl.h 5 Nov 2002 00:33:04 -0000 1.16
@@ -58,6 +58,11 @@
#define MULTIPART_FORM_DATA 1
/* #define DTCL_VERSION "X.X.X" */
+/* For Tcl 8.3/8.4 compatibility - see http://mini.net/tcl/3669 */
+#ifndef CONST84
+# define CONST84
+#endif
+
typedef struct {
Tcl_Interp *server_interp; /* per server Tcl interpreter */
Tcl_Obj *dtcl_global_init_script; /* run once when apache is first started */
1.26 +2 -2 tcl-moddtcl/tcl_commands.c
Index: tcl_commands.c
===================================================================
RCS file: /home/cvs/tcl-moddtcl/tcl_commands.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- tcl_commands.c 12 Sep 2002 06:41:18 -0000 1.25
+++ tcl_commands.c 5 Nov 2002 00:33:04 -0000 1.26
@@ -746,7 +746,7 @@
chan = Tcl_MakeFileChannel((ClientData)fileno(
ApacheUpload_FILE(upload)), TCL_READABLE);
Tcl_RegisterChannel(interp, chan);
- channelname = Tcl_GetChannelName(chan);
+ channelname = (char *)Tcl_GetChannelName(chan);
Tcl_SetStringObj(result, channelname, -1);
}
} else if (!strcmp(method, "save")) {
@@ -794,7 +794,7 @@
char *bytes = NULL;
Tcl_Channel chan = NULL;
- bytes = Tcl_Alloc(ApacheUpload_size(upload));
+ bytes = Tcl_Alloc((unsigned int)ApacheUpload_size(upload));
chan = Tcl_MakeFileChannel((ClientData)fileno(
ApacheUpload_FILE(upload)), TCL_READABLE);
Tcl_SetChannelOption(interp, chan, "-translation", "binary");
1.23 +10 -0 tcl-moddtcl/debian/changelog
Index: changelog
===================================================================
RCS file: /home/cvs/tcl-moddtcl/debian/changelog,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- changelog 12 Sep 2002 06:41:19 -0000 1.22
+++ changelog 5 Nov 2002 00:33:05 -0000 1.23
@@ -1,3 +1,13 @@
+libapache-mod-dtcl (1.0.0-1) unstable; urgency=low
+
+ * Cleanup after HEAD requests.
+
+ * Make changes necessary for Tcl 8.4 compatibility.
+
+ * Update to latest httpd-apreq code.
+
+ --
+
libapache-mod-dtcl (0.12.1-1) unstable; urgency=low
* tcl_commands.c (HGetVars): Don't call ap_clear_table, as it can
---------------------------------------------------------------------
To unsubscribe, e-mail: mod_dtcl-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: mod_dtcl-cvs-help@tcl.apache.org