From ydavis@example.org Sat Sep 06 21:21:45 2008
Return-Path: <ydavis@example.org>
Delivered-To: ydavis@example.org
Received: (qmail 20049 invoked from network); 6 Sep 2008 21:21:45 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 6 Sep 2008 21:21:45 -0000
Received: (qmail 34171 invoked by uid 500); 6 Sep 2008 21:21:43 -0000
Delivered-To: ydavis@example.org
Received: (qmail 34156 invoked by uid 500); 6 Sep 2008 21:21:42 -0000
Mailing-List: contact ydavis@example.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:ydavis@example.org>
List-Unsubscribe: <mailto:ydavis@example.org>
List-Post: <mailto:ydavis@example.org>
List-Id: <rivet-cvs.tcl.apache.org>
Delivered-To: mailing list ydavis@example.org
Received: (qmail 34147 invoked by uid 99); 6 Sep 2008 21:21:42 -0000
Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Sep 2008 14:21:42 -0700
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Sep 2008 21:20:52 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id CE14D2388961; Sat,  6 Sep 2008 14:21:23 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r692740 - in /tcl/rivet/trunk: ChangeLog INSTALL
 src/apache-2/apache_multipart_buffer.c
 src/apache-2/apache_multipart_buffer.h src/apache-2/apache_request.c
 src/apache-2/apache_request.h
Date: Sat, 06 Sep 2008 21:21:23 -0000
To: ydavis@example.org
From: ydavis@example.org
X-Mailer: svnmailer-1.0.8
Message-Id: <ydavis@example.org>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: mxmanghi
Date: Sat Sep  6 14:21:23 2008
New Revision: 692740

URL: http://svn.apache.org/viewvc?rev=692740&view=rev
Log:
2008-09-06 Massimo Manghi <ydavis@example.org>

	* INSTALL: instructions for builing Rivet expanded with
	examples taken from real builds for Debian and Slackware.

	* src/apache-2/apache_request.[c|h]: removed TODO comments
	concerning ap_hard_timeout and ap_kill_timeout as these functions
	doesn't not exist anymore in the apache 2.x api.
	Added the Content-type as a new argumento to
	ApacheRequest_parse_multipart for parts boundary determination.
	The correctness of the content type has to be done before calling
	in order to do the check only once. Commented declarations of variables
	not used. The 'tempname' string is allocated now from the apache pool.
	Changed template for temporary file name generation. If 
	apr_file_mktemp fails a more descriptive error is logged.

	* src/apache-2/apache_multipart_buffer.[c|h]: removed line in
	multipart_buffer_read that lead the buffer pointer to fail following 
	the parsing process. Input buffer size changed to a larger and more 
	common size of 8192 bytes


Modified:
    tcl/rivet/trunk/ChangeLog
    tcl/rivet/trunk/INSTALL
    tcl/rivet/trunk/src/apache-2/apache_multipart_buffer.c
    tcl/rivet/trunk/src/apache-2/apache_multipart_buffer.h
    tcl/rivet/trunk/src/apache-2/apache_request.c
    tcl/rivet/trunk/src/apache-2/apache_request.h

Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=692740&r1=692739&r2=692740&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Sat Sep  6 14:21:23 2008
@@ -1,3 +1,24 @@
+2008-09-06 Massimo Manghi <ydavis@example.org>
+
+	* INSTALL: instructions for builing Rivet expanded with
+	examples taken from real builds for Debian and Slackware.
+
+	* src/apache-2/apache_request.[c|h]: removed TODO comments
+	concerning ap_hard_timeout and ap_kill_timeout as these functions
+	doesn't not exist anymore in the apache 2.x api.
+	Added the Content-type as a new argumento to
+	ApacheRequest_parse_multipart for parts boundary determination.
+	The correctness of the content type has to be done before calling
+	in order to do the check only once. Commented declarations of variables
+	not used. The 'tempname' string is allocated now from the apache pool.
+	Changed template for temporary file name generation. If 
+	apr_file_mktemp fails a more descriptive error is logged.
+
+	* src/apache-2/apache_multipart_buffer.[c|h]: removed line in
+	multipart_buffer_read that lead the buffer pointer to fail following 
+	the parsing process. Input buffer size changed to a larger and more 
+	common size of 8192 bytes
+
 2008-08-28 Massimo Manghi <ydavis@example.org>
 
 	* src/apache-2/mod_rivet.c: using the 'parse' command twice within

Modified: tcl/rivet/trunk/INSTALL
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/INSTALL?rev=692740&r1=692739&r2=692740&view=diff
==============================================================================
--- tcl/rivet/trunk/INSTALL (original)
+++ tcl/rivet/trunk/INSTALL Sat Sep  6 14:21:23 2008
@@ -3,19 +3,74 @@
 
 For more detailed instructions, see the docs/html/ directory.
 
-Rivet is now based on the auto tools - autoconf, automake and libtool,
+Rivet is now based on the autotools - autoconf, automake and libtool,
 and so compilation is simple.  For example:
 
-./configure --with-tcl=/usr/lib/tcl8.4/ --with-apxs=/usr/bin/apxs \
-	     --with-tclsh=/usr/bin/tclsh8.4
+if you have a clean source tree you have to prepare it for autotools
+
+  aclocal
+  autoreconf
+
+and then run 'configure' with the switches that suit your setup
+
+./configure --with-tcl=/usr/lib/tcl8.4/ 	\
+	    --with-apxs=/usr/bin/apxs 		\
+	    --with-tclsh=/usr/bin/tclsh8.4 	\
+	    --with-apache-version=1
 make
 make install
 
-Basic Apache configuration directives that are needed:
+Along with the usual 'configure' variables Rivet's configure script 
+handles other specific environmental variables. 
+
+--with-tclinclude=TCL_INCLUDES_DIR	Directory containing include
+					files for compiling code based 
+					on the Tcl C library.
+--with-apache-version=VER		Values are 1 or 2 depending
+					on the apache server you're 
+					builing the module for.
+--with-apache=DIR			Apache server's root directory.
+--with-apxs=FILE			Path to the apxs program to
+					be used in the compilation
+					process.
+--with-apache-include=DIR		Apache's include files path.
+--with-apr-config=FILE			Apache Portable Runtime 
+					metainformation program
+--with-rivet-target-dir=DIR		Rivet Tcl library installation
+					directory.
+
+These are the basic Apache configuration directives that are needed:
 
 # Loads the module.
 LoadModule rivet_module	/path/to/your/copy/of/mod_rivet.so
 
 # Let the module handle .rvt and .tcl files.
-AddType application/x-httpd-rivet .rvt
-AddType application/x-rivet-tcl .tcl
\ No newline at end of file
+AddType application/x-httpd-rivet  rvt
+AddType application/x-rivet-tcl    tcl
+
+# The default charset can be specified in the configuration
+
+AddType "application/x-httpd-rivet; charset=utf-8" rvt
+
+For Apache 2 a typical './configure' might look like this
+
+./configure --with-tcl=/usr/lib/tcl8.4 --with-apache-version=2 
+	    --with-tclsh=/usr/bin/tclsh8.4 --with-apache=/usr
+	    --with-rivet-target-dir=/usr/lib/myrivetlib
+
+If Apache1.x and Apache2.x coexist on the same system you must
+tell configure where the right apxs (apache extension tool) script is
+located. E.g.: on a Debian system apxs for Apache2.x is named apxs2
+
+./configure --with-apache-include=/usr/include/apr-1.0 		\
+	    --with-apache-version=2 --with-apxs=/usr/bin/apxs2 	\
+	    --with-tcl=/usr/lib/tcl8.4 --with-apache=/usr
+
+Here is another example reported by a user who successfully built 
+Rivet on Slackware 12.1
+
+aclocal
+autoreconf
+./configure --with-apache-version=2 --with-tcl=/usr/lib --with-apxs=/usr/bin/apxs 
+make
+

Modified: tcl/rivet/trunk/src/apache-2/apache_multipart_buffer.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/apache_multipart_buffer.c?rev=692740&r1=692739&r2=692740&view=diff
==============================================================================
--- tcl/rivet/trunk/src/apache-2/apache_multipart_buffer.c (original)
+++ tcl/rivet/trunk/src/apache-2/apache_multipart_buffer.c Sat Sep  6 14:21:23 2008
@@ -40,7 +40,7 @@
     while( (ptr = memchr(ptr, needle[0], len)) ) {
 	/* calculate length after match */
 	len = haystacklen - (ptr - (char *)haystack);
-	 ;
+
 	/* done if matches up to capacity of buffer */
 	if(memcmp(needle, ptr, needlen) == 0 &&
 	   (partial || len >= needlen))
@@ -64,6 +64,7 @@
     /* shift the existing data if necessary */
     if(self->bytes_in_buffer > 0 && self->buf_begin != self->buffer)
 	memmove(self->buffer, self->buf_begin, self->bytes_in_buffer);
+
     self->buf_begin = self->buffer;
 
     /* calculate the free space in the buffer */
@@ -79,11 +80,8 @@
     /* read the required number of bytes */
     if(bytes_to_read > 0) {
 	char *buf = self->buffer + self->bytes_in_buffer;
-    //TODO: fix ap_hard_timeout
-    //ap_hard_timeout("[libapreq] multipart_buffer.c:fill_buffer", self->r);
+    
 	actual_read = ap_get_client_block(self->r, buf, bytes_to_read);
-	//TODO: fix ap_kill_timeout()
-    //ap_kill_timeout(self->r);
 
 	/* update the buffer length */
 	if(actual_read > 0)
@@ -190,7 +188,7 @@
     self->bufsize = minsize;
     self->request_length = length;
     self->boundary = (char*) apr_pstrcat(r->pool, "--", boundary, NULL);
-    self->boundary_next = (char*) apr_pstrcat(r->pool, "\n", self->boundary+2, NULL);
+    self->boundary_next = (char*) apr_pstrcat(r->pool, "\n", self->boundary, NULL);
     self->buf_begin = self->buffer;
     self->bytes_in_buffer = 0;
 
@@ -201,15 +199,15 @@
 //table *multipart_buffer_headers(multipart_buffer *self)
 apr_table_t *multipart_buffer_headers(multipart_buffer *self)
 {
-    //table *tab;
     apr_table_t *tab;
     char *line;
 
     /* didn't find boundary, abort */
+
     if(!find_boundary(self, self->boundary)) return NULL;
 
     /* get lines of text, or CRLF_CRLF */
-    //tab = ap_make_table(self->r->pool, 10);
+
     tab = apr_table_make(self->r->pool, 10);
     while( (line = get_line(self)) && strlen(line) > 0 ) {
 	/* add header to table */
@@ -218,9 +216,9 @@
 
 	if(value) {
 	    *value = 0;
-	    do {
-            value++;
-        } while(apr_isspace(*value));
+	    do { 
+	    	value++; 
+	    } while (apr_isspace(*value));
 
 #ifdef DEBUG
 	    ap_log_rerror(MPB_ERROR,
@@ -229,8 +227,7 @@
 #endif
 
 	    apr_table_add(tab, key, value);
-	}
-	else {
+	} else {
 #ifdef DEBUG
 	    ap_log_rerror(MPB_ERROR,
 			  "multipart_buffer_headers: '%s' = ''", key);
@@ -255,8 +252,7 @@
     /* look for a potential boundary match, only read data up to that point */
     if( (bound = my_memstr(self->buf_begin, self->bytes_in_buffer,
 			   self->boundary_next, 1)) ) {
-	max = bound - self->buf_begin - 1 ;
-	self->bytes_in_buffer=max+1;
+	max = bound - self->buf_begin;
      } else {
 	max = self->bytes_in_buffer;
      }

Modified: tcl/rivet/trunk/src/apache-2/apache_multipart_buffer.h
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/apache_multipart_buffer.h?rev=692740&r1=692739&r2=692740&view=diff
==============================================================================
--- tcl/rivet/trunk/src/apache-2/apache_multipart_buffer.h (original)
+++ tcl/rivet/trunk/src/apache-2/apache_multipart_buffer.h Sat Sep  6 14:21:23 2008
@@ -1,10 +1,27 @@
+/* Copyright 2008 The Apache Software Foundation
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+   	http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+/* $Id: $ */
+
 #ifndef _APACHE_MULTIPART_BUFFER_H
 #define _APACHE_MULTIPART_BUFFER_H
 
 #include "apache_request.h"
 
 /* #define DEBUG 1 */
-#define FILLUNIT (1024 * 5)
+#define FILLUNIT (1024 * 8)
 #define MPB_ERROR APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, self->r
 
 #ifdef  __cplusplus
@@ -32,6 +49,7 @@
 ///*table*/apr_table_t *multipart_buffer_headers(multipart_buffer *self);
 int multipart_buffer_read(multipart_buffer *self, char *buf, int bytes);
 char *multipart_buffer_read_body(multipart_buffer *self); 
+apr_table_t *multipart_buffer_headers(multipart_buffer *self);
 int multipart_buffer_eof(multipart_buffer *self);
 
 #ifdef __cplusplus

Modified: tcl/rivet/trunk/src/apache-2/apache_request.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/apache_request.c?rev=692740&r1=692739&r2=692740&view=diff
==============================================================================
--- tcl/rivet/trunk/src/apache-2/apache_request.c (original)
+++ tcl/rivet/trunk/src/apache-2/apache_request.c Sat Sep  6 14:21:23 2008
@@ -56,9 +56,6 @@
 
         *rbuf = apr_pcalloc(r->pool, length + 1);
 
-        //TODO: fix ap_hard_timeout
-        //ap_hard_timeout("[libapreq] util_read", r);
-
         while ((len_read =
                     ap_get_client_block(r, buff, sizeof(buff))) > 0) {
             if ((rpos + len_read) > length) {
@@ -70,9 +67,6 @@
             memcpy((char*)*rbuf + rpos, buff, rsize);
             rpos += rsize;
         }
-
-        //TODO: fix ap_kill_timeout()
-        //ap_kill_timeout(r);
     }
 
     return rc;
@@ -226,8 +220,7 @@
     register char digit;
 
 #ifndef CHARSET_EBCDIC
-    digit = ((what[0] >= 'A') ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0'))
-;
+    digit = ((what[0] >= 'A') ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0'));
     digit *= 16;
     digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10 : (what[1] - '0'));
 #else /*CHARSET_EBCDIC*/
@@ -337,7 +330,7 @@
 	   return OK;
 }
 
-static int urlword_dlm[] = {'&', ';', 0};
+//static int urlword_dlm[] = {'&', ';', 0};
 
 static char *my_urlword(apr_pool_t *p, const char **line)
 {
@@ -346,14 +339,14 @@
     char ch;
 
     while ( (ch = *pos) != '\0' && ch != ';' && ch != '&') {
-	   ++pos;
+	++pos;
     }
 
     res = (char*) apr_pstrndup(p, *line, pos - *line);
 
     while (ch == ';' || ch == '&') {
-	   ++pos;
-	   ch = *pos;
+	++pos;
+	ch = *pos;
     }
 
     *line = pos;
@@ -376,7 +369,6 @@
         ap_unescape_url_u((char*)val);
         apr_table_add(req->parms, key, val);
     }
-
 }
 
 int ApacheRequest___parse(ApacheRequest *req)
@@ -391,15 +383,16 @@
 
     if (r->method_number == M_POST) {
         const char *ct = apr_table_get(r->headers_in, "Content-type");
+        if (ct) ap_log_rerror(REQ_INFO, "content-type: `%s'", ct);
         if (ct && strncaseEQ(ct, DEFAULT_ENCTYPE, DEFAULT_ENCTYPE_LENGTH)) {
             result = ApacheRequest_parse_urlencoded(req);
         } else if (ct && strncaseEQ(ct, TEXT_XML_ENCTYPE, TEXT_XML_ENCTYPE_LENGTH)) {
             result = ApacheRequest_parse_urlencoded(req);
         } else if (ct && strncaseEQ(ct, MULTIPART_ENCTYPE, MULTIPART_ENCTYPE_LENGTH)) {
-            result = ApacheRequest_parse_multipart(req);
+            result = ApacheRequest_parse_multipart(req,ct);
         } else {
             //TODO: fix logging apr_log_rerror
-            ap_log_rerror(REQ_ERROR,0, r->server, "unknown content-type: `%s'", ct);
+            ap_log_rerror(REQ_ERROR, "unknown content-type: `%s'", ct);
             result = HTTP_INTERNAL_SERVER_ERROR;
         }
     }
@@ -425,6 +418,7 @@
     	    !strncaseEQ(type, TEXT_XML_ENCTYPE, TEXT_XML_ENCTYPE_LENGTH)) {
     	    return DECLINED;
     	}
+
     	if ((rc = util_read(req, &data)) != OK) {
     	    return rc;
     	}
@@ -437,10 +431,10 @@
     return OK;
 }
 
-static void remove_tmpfile(void *data)
+static apr_status_t remove_tmpfile(void *data)
 {
     ApacheUpload *upload = (ApacheUpload *) data;
-    ApacheRequest *req = upload->req;
+//  ApacheRequest *req = upload->req;
 
     //TODO: fix ap_pfclose
     //if( ap_pfclose(req->r->pool, upload->fp) )
@@ -448,11 +442,14 @@
         //apr_log_rerror(REQ_ERROR,"[libapreq] close error on '%s'", upload->tempname);
 #ifndef DEBUG
     if( remove(upload->tempname) )
+    {
         //TODO: fix logging apr_log_rerror
         //apr_log_rerror(REQ_ERROR,"[libapreq] remove error on '%s'", upload->tempname);
+    }
 #endif
 
-    free(upload->tempname);
+//    free(upload->tempname);
+    return 0;
 }
 
 apr_file_t *ApacheRequest_tmpfile(ApacheRequest *req, ApacheUpload *upload)
@@ -461,52 +458,49 @@
     apr_file_t *fp = NULL;
     char *name = NULL;
     char *file = NULL ; 
-	const char *tempdir;
-	apr_status_t rv;
+    const char *tempdir;
+    apr_status_t rv;
 	
-	tempdir = req->temp_dir;
+    tempdir = req->temp_dir;
 /*	file = (char *)apr_palloc(r->pool,sizeof(apr_time_t)); */
-	file = apr_psprintf(r->pool,"%u", r->request_time);
-	rv = apr_temp_dir_get(&tempdir,r->pool); 
-	if (rv != APR_SUCCESS)  {
-		ap_log_perror(APLOG_MARK, APLOG_ERR, rv, r->pool, "No temp dir!");
-		return NULL;
-	}
-	rv = apr_filepath_merge(&name,tempdir,file,APR_FILEPATH_NATIVE,r->pool);
-	if (rv != APR_SUCCESS) {
-		ap_log_perror(APLOG_MARK, APLOG_ERR, rv, r->pool, "File path error!");
-		return NULL;
-	}
-	rv = apr_file_mktemp(&fp,name,0,r->pool);
-	if (rv != APR_SUCCESS) {
-		ap_log_perror(APLOG_MARK, APLOG_ERR, rv, r->pool, "Failed to open temp file!");
-		return NULL;
-	}
+    file = apr_psprintf(r->pool,"%u.XXXXXX", (unsigned int)r->request_time);
+    rv = apr_temp_dir_get(&tempdir,r->pool); 
+    if (rv != APR_SUCCESS)  {
+	ap_log_perror(APLOG_MARK, APLOG_ERR, rv, r->pool, "No temp dir!");
+	return NULL;
+    }
+	
+    rv = apr_filepath_merge(&name,tempdir,file,APR_FILEPATH_NATIVE,r->pool);
+    if (rv != APR_SUCCESS) {
+	ap_log_perror(APLOG_MARK, APLOG_ERR, rv, r->pool, "File path error!");
+	return NULL;
+    }
+    
+    rv = apr_file_mktemp(&fp,name,0,r->pool);
+    if (rv != APR_SUCCESS) {
+	char* errorBuffer = (char*) apr_palloc(r->pool,256);
+	ap_log_perror(APLOG_MARK, APLOG_ERR, rv, r->pool, "Failed to open temp file: %s",apr_strerror(rv,errorBuffer,256));
+	return NULL;
+    }
+
     upload->fp = fp;
     upload->tempname = name;
-    apr_pool_cleanup_register (r->pool, (void *)upload,
-			remove_tmpfile, apr_pool_cleanup_null);
+    apr_pool_cleanup_register (r->pool, (void *)upload, remove_tmpfile, apr_pool_cleanup_null);
     return fp;
 
 }
 
 int
-ApacheRequest_parse_multipart(ApacheRequest *req)
+ApacheRequest_parse_multipart(ApacheRequest *req,const char* ct)
 {
     request_rec *r = req->r;
     int rc = OK;
-    const char *ct = apr_table_get(r->headers_in, "Content-Type");
     long length;
     char *boundary;
     multipart_buffer *mbuff;
     ApacheUpload *upload = NULL;
-	apr_status_t  status;
-	char *error[1024];
-    if (!ct) {
-        //TODO: fix logging apr_log_rerror
-        //apr_log_rerror(REQ_ERROR, "[libapreq] no Content-type header!");
-        return HTTP_INTERNAL_SERVER_ERROR;
-    }
+    apr_status_t  status;
+    char *error[1024];
 
     if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) {
         return rc;
@@ -518,7 +512,7 @@
 
     if ((length = r->remaining) > req->post_max && req->post_max > 0) {
         //TODO: fix logging apr_log_rerror
-        //apr_log_rerror(REQ_ERROR, "[libapreq] entity too large (%d, max=%d)",
+        //apr_log_rerror(REQ_ERROR, "entity too large (%d, max=%d)",
         //        (int)length, req->post_max);
         return HTTP_REQUEST_ENTITY_TOO_LARGE;
     }
@@ -544,21 +538,15 @@
         apr_table_t *header = (apr_table_t*) multipart_buffer_headers(mbuff);
         const char *cd, *param=NULL, *filename=NULL;
         char buff[FILLUNIT];
-        int blen, wlen;
+        int blen;
 
         if (!header) {
 #ifdef DEBUG
-            //TODO: fix logging apr_log_rerror
-            //apr_log_rerror(REQ_ERROR,
-            //   "[libapreq] silently drop remaining '%ld' bytes", r->remaining);
+            apr_log_rerror(REQ_ERROR,"Silently dropping remaining '%ld' bytes", r->remaining);
 #endif
-            //TODO: fix ap_hard_timeout
-            //ap_hard_timeout("[libapreq] parse_multipart", r);
-            while ( ap_get_client_block(r, buff, sizeof(buff)) > 0 )
-                /* wait for more input to ignore */ ;
-            //TODO: fix ap_kill_timeout()     
-            //ap_kill_timeout(r);
-            return OK;
+	    do { } while ( ap_get_client_block(r, buff, sizeof(buff)) > 0 );
+            	
+	    return OK;
         }
 
         if ((cd = apr_table_get(header, "Content-Disposition"))) {
@@ -621,16 +609,16 @@
             }
 
             while ((blen = multipart_buffer_read(mbuff, buff, sizeof(buff)))) {
-				status = apr_file_write(upload->fp,buff,&blen);
-				if (status != 0) {	
-					apr_strerror(status,error,1024); 
-                   	return HTTP_INTERNAL_SERVER_ERROR;
-				}
-
+		apr_size_t bytes_to_write = (apr_size_t) blen;
+		status = apr_file_write(upload->fp,buff,&bytes_to_write);
+		if (status != 0) {
+		    apr_strerror(status,error,1024); 
+                    return HTTP_INTERNAL_SERVER_ERROR;
+		}
                 upload->size += blen;
             }
         }
-        }
+    }
 
     return OK;
 }

Modified: tcl/rivet/trunk/src/apache-2/apache_request.h
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/apache_request.h?rev=692740&r1=692739&r2=692740&view=diff
==============================================================================
--- tcl/rivet/trunk/src/apache-2/apache_request.h (original)
+++ tcl/rivet/trunk/src/apache-2/apache_request.h Sat Sep  6 14:21:23 2008
@@ -95,7 +95,7 @@
 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_multipart(ApacheRequest *req,const char* ct);
 int ApacheRequest_parse_urlencoded(ApacheRequest *req);
 char *ApacheRequest_script_name(ApacheRequest *req);
 char *ApacheRequest_script_path(ApacheRequest *req);
@@ -141,7 +141,8 @@
  }
 #endif
 
-#define REQ_ERROR APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, req->r
+#define REQ_ERROR  APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, APR_EGENERAL, req->r
+#define REQ_INFO   APLOG_MARK, APLOG_INFO, APR_EGENERAL, req->r
 
 #ifdef REQDEBUG
 #define REQ_DEBUG(a) (a)



---------------------------------------------------------------------
To unsubscribe, e-mail: ydavis@example.org
For additional commands, e-mail: ydavis@example.org


From ydavis@example.org Thu Sep 11 13:14:54 2008
Return-Path: <ydavis@example.org>
Delivered-To: ydavis@example.org
Received: (qmail 79000 invoked from network); 11 Sep 2008 13:14:54 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 11 Sep 2008 13:14:54 -0000
Received: (qmail 83083 invoked by uid 500); 11 Sep 2008 13:14:52 -0000
Delivered-To: ydavis@example.org
Received: (qmail 83071 invoked by uid 500); 11 Sep 2008 13:14:51 -0000
Mailing-List: contact ydavis@example.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:ydavis@example.org>
List-Unsubscribe: <mailto:ydavis@example.org>
List-Post: <mailto:ydavis@example.org>
List-Id: <rivet-cvs.tcl.apache.org>
Delivered-To: mailing list ydavis@example.org
Received: (qmail 83062 invoked by uid 99); 11 Sep 2008 13:14:51 -0000
Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 06:14:51 -0700
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 13:14:02 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id 1A0522388986; Thu, 11 Sep 2008 06:14:34 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r694239 - /tcl/rivet/trunk/ChangeLog
Date: Thu, 11 Sep 2008 13:14:33 -0000
To: ydavis@example.org
From: ydavis@example.org
X-Mailer: svnmailer-1.0.8
Message-Id: <ydavis@example.org>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: mxmanghi
Date: Thu Sep 11 06:14:32 2008
New Revision: 694239

URL: http://svn.apache.org/viewvc?rev=694239&view=rev
Log:
commit of a missing entry in the Changelog

Modified:
    tcl/rivet/trunk/ChangeLog

Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=694239&r1=694238&r2=694239&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Thu Sep 11 06:14:32 2008
@@ -19,6 +19,15 @@
 	the parsing process. Input buffer size changed to a larger and more 
 	common size of 8192 bytes
 
+2008-08-30 Massimo Manghi <ydavis@example.org>
+
+	* doc/rivet.[xml|xsl], doc/html/*.html: changed a couple of rule 
+	in rivet.xsl: they basically make example boxes a 
+	bit more flexible for html browsing and made their 
+	background color a bit more "neutral". I also made the character 
+	in them slighly smaller in order to have more 
+	space for code lines.
+
 2008-08-28 Massimo Manghi <ydavis@example.org>
 
 	* src/apache-2/mod_rivet.c: using the 'parse' command twice within



---------------------------------------------------------------------
To unsubscribe, e-mail: ydavis@example.org
For additional commands, e-mail: ydavis@example.org


From rivetydavis@example.org Fri Sep 26 11:20:02 2008
Return-Path: <rivetydavis@example.org>
Delivered-To: ydavis@example.org
Received: (qmail 92399 invoked from network); 26 Sep 2008 11:19:55 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 26 Sep 2008 11:19:55 -0000
Received: (qmail 58010 invoked by uid 500); 26 Sep 2008 11:19:52 -0000
Delivered-To: ydavis@example.org
Received: (qmail 57960 invoked by uid 500); 26 Sep 2008 11:19:52 -0000
Mailing-List: contact ydavis@example.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:ydavis@example.org>
List-Unsubscribe: <mailto:ydavis@example.org>
List-Post: <mailto:ydavis@example.org>
List-Id: <rivet-dev.tcl.apache.org>
Delivered-To: mailing list ydavis@example.org
Received: (qmail 57949 invoked by uid 99); 26 Sep 2008 11:19:52 -0000
Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Sep 2008 04:19:52 -0700
X-ASF-Spam-Status: No, hits=-0.0 required=10.0
	tests=SPF_PASS
X-Spam-Check-By: apache.org
Received-SPF: pass (athena.apache.org: local policy)
Received: from [83.161.120.155] (HELO julesv.cce.unipr.it) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Sep 2008 11:18:49 +0000
Received: from pachelbel.biol.unipr.it (pachelbel.biol.unipr.it [83.161.120.155])
	by julesv.cce.unipr.it (8.13.8/8.13.8) with ESMTP id m8QBH1kX027481
	for <ydavis@example.org>; Fri, 26 Sep 2008 13:17:01 +0200
Received: from [83.161.120.155] (localhost [83.161.120.155])
	by pachelbel.biol.unipr.it (Postfix) with ESMTP id 2FF7771B92
	for <ydavis@example.org>; Fri, 26 Sep 2008 13:15:40 +0200 (CEST)
Message-ID: <ydavis@example.org>
Date: Fri, 26 Sep 2008 13:15:40 +0200
From: Massimo Manghi <ydavis@example.org>
Organization: =?ISO-8859-1?Q?Universit=E0_di_Parma?=
User-Agent: Mozilla-Thunderbird 83.161.120.155 (X11/20080724)
MIME-Version: 1.0
To: Rivet_dev <ydavis@example.org>
Subject: config.h symbols redefinition
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-CCE-UniPR-MailScanner-Information: CCE
X-MailScanner-ID: m8QBH1kX027481
X-CCE-UniPR-Juv-MailScanner: Found to be clean
X-CCE-UniPR-Juv-MailScanner-SpamCheck: not spam, SpamAssassin (not cached,
	score=-2.599, required 6, autolearn=not spam, BAYES_00 -2.60)
X-CCE-UniPR-MailScanner-From: ydavis@example.org
X-Virus-Checked: Checked by ClamAV on apache.org

as those who compiled Rivet for Apache2 might have noticed, there
are many conflicting definitions between rivet's autotools generated
config.h and apache's same file.

I'm experimenting with the macro AX_PREFIX_CONFIG_H
taken from the autotools macro archive
(a GPLed project visible at http://git.cryp.to/autoconf-archive)
that is able to rename config.h into whatever you tell it to do.
This macro renames the preprocessor symbols in <whatever_config.h>
by prefixing them with a predefined string that defaults to the project name
as defined in AC_INIT. The people working on this project were very helpful
and I will look into their site more closely for other stuff which we
might benefit from.

The implications are quite simple: the macro should be added to the 
repository
(I put it in a m4 directory for possible inclusions of other macros) and
various things  have to be changed in the code.  I'm in the process of  
doing  it
and it looks like a straightforward task. I just wonder  what is  your  
opinion
and if ther's some general objection raised against this before
proceeding with a commit of these changes.

ciao

 -- Massimo


---------------------------------------------------------------------
To unsubscribe, e-mail: ydavis@example.org
For additional commands, e-mail: ydavis@example.org



{'source': 'Apache Software Foundation Public Mail Archives'}