Re: libapreq2 upload question

[prev] [thread] [next] [Date index for 2004/12/20]

From: Joe Schaefer
Subject: Re: libapreq2 upload question
Date: 22:46 on 20 Dec 2004
Joe Schaefer <joe+apache@xxxxxxxxxx.xxx> writes:

> From this, it looks to me like libapreq is parsing the POST data correctly
> (the gif filename showing up as the eps param value is a tell-tale sign that
> the upload was parsed ok).  So the now question is: why isn't $mm->upload()
> detecting that body table entry as being an upload?


I found the bug, thanks eps for helping to track it down!  Here's the 
patch against apreq/trunk (some of the upload-related table callbacks
were emitting the wrong return value, which prematurely terminates the
upload search). 


Index: src/apreq_params.c
===================================================================
--- src/apreq_params.c	(revision 112718)
+++ src/apreq_params.c	(working copy)
@@ -21,9 +21,8 @@
 
 #define MAX_LEN         (1024 * 1024)
 #define MAX_BRIGADE_LEN (1024 * 256)
-#define MAX_FIELDS      (200)
 #define MAX_READ_AHEAD  (1024 * 64)
-    
+
 APREQ_DECLARE(apreq_param_t *) apreq_make_param(apr_pool_t *p, 
                                                 const char *name, 
                                                 const apr_size_t nlen, 
@@ -147,7 +146,7 @@
     apr_array_header_t *arr = data;
     *(apreq_param_t **)apr_array_push(arr) = 
         apreq_value_to_param(apreq_strtoval(val));
-    return 1;
+    return 1;   /* keep going */
 }
 
 
@@ -323,7 +322,7 @@
     apreq_param_t *p = apreq_value_to_param(apreq_strtoval(val));
     if (p->bb)
         apr_table_addn(t, key, val);
-    return 0;
+    return 1;   /* keep going */
 }
 
 
@@ -354,10 +353,10 @@
     apreq_param_t **q = data;
     if (p->bb) {
         *q = p;
-        return 1; /* upload found, stop */
+        return 0; /* upload found, stop */
     }
     else
-        return 0; /* keep searching */
+        return 1; /* keep searching */
 }
 
 

        -- 
        Joe Schaefer


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

libapreq2 upload question
eps com estem 15:29 on 19 Dec 2004

Re: libapreq2 upload question
Joe Schaefer 16:18 on 19 Dec 2004

Re: libapreq2 upload question
Randy Kobes 19:31 on 19 Dec 2004

Re: libapreq2 upload question
eps com estem 08:26 on 20 Dec 2004

Re: libapreq2 upload question
Randy Kobes 15:06 on 20 Dec 2004

Re: libapreq2 upload question
Joe Schaefer 15:18 on 20 Dec 2004

Re: libapreq2 upload question
eps com estem 20:17 on 20 Dec 2004

Re: libapreq2 upload question
Joe Schaefer 21:31 on 20 Dec 2004

Re: libapreq2 upload question
Joe Schaefer 22:46 on 20 Dec 2004

Re: libapreq2 upload question
eps com estem 22:53 on 20 Dec 2004

Re: libapreq2 upload question
eps com estem 23:15 on 20 Dec 2004

Re: libapreq2 upload question
Joe Schaefer 23:46 on 20 Dec 2004

Re: libapreq2 upload question
Randy Kobes 05:37 on 21 Dec 2004

Re: libapreq2 upload question
eps com estem 08:04 on 21 Dec 2004

Re: libapreq2 upload question
Randy Kobes 15:54 on 21 Dec 2004

Re: libapreq2 upload question
Joe Schaefer 16:26 on 21 Dec 2004

Re: libapreq2 upload question
eps com estem 23:46 on 05 Jan 2005

Re: libapreq2 upload question
eps com estem 14:21 on 20 Feb 2005

Re: libapreq2 upload question
Joe Schaefer 00:33 on 21 Feb 2005

Generated at 12:48 on 22 Feb 2005 by mariachi v0.52