httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r151415 - httpd/apreq/branches/multi-env-unstable/src/apreq.c
Date Fri, 04 Feb 2005 20:55:24 GMT
Author: joes
Date: Fri Feb  4 12:55:23 2005
New Revision: 151415

URL: http://svn.apache.org/viewcvs?view=rev&rev=151415
Log:
Spool bucket cleanups:

   There can only be one spool bucket for a given tempfile,
because that bucket marks where new data may be appended.
So fo now we mark copy() as unimplemented (may fix this later
once we determine whether the orignal, or the copy, keeps 
the spool tag). Now split() is corrected to convert
the lead bucket back to an ordinary apr_bucket_type_file.

Modified:
    httpd/apreq/branches/multi-env-unstable/src/apreq.c

Modified: httpd/apreq/branches/multi-env-unstable/src/apreq.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/src/apreq.c?view=diff&r1=151414&r2=151415
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/src/apreq.c (original)
+++ httpd/apreq/branches/multi-env-unstable/src/apreq.c Fri Feb  4 12:55:23 2005
@@ -343,12 +343,6 @@
         slen -= len;
     }
 
-    /*XXX fooo
-    memcpy(d,s,slen);
-    d[slen] = 0;
-    *dlen = slen;
-    return APR_SUCCESS;
-    */
     rv = url_decode(d, dlen, s, &slen);
     *dlen += len;
     return rv;
@@ -841,16 +835,9 @@
     return APR_NOTFOUND;
 }
 
-/* XXX: find a way to remove these spool_bucket_* functions.
- * The only reason joes uses them here, is because this assignment
- *
- *     static const apr_bucket_type_t spool_bucket = apr_bucket_type_file;
- *   
- * is (I think) illegal in C89, even though the RHS is declared constant.
- * Not sure its ok in C99 either.
- */
 
-#define BUCKET_IS_SPOOL(e) ((e)->type == &spool_bucket)
+
+#define BUCKET_IS_SPOOL(e) ((e)->type == &spool_bucket_type)
 #define FILE_BUCKET_LIMIT      ((apr_size_t)-1 - 1)
 
 static
@@ -872,20 +859,24 @@
     return apr_bucket_type_file.setaside(data, reqpool);
 }
 
-/* XXX: all we really need to do here is make a local copy of
- * apr_bucket_type_file; i.e.
- *
- *    static const apr_bucket_type_t spool_bucket = apr_bucket_type_file;
- */
-static const apr_bucket_type_t spool_bucket = {
-    "APREQ_SPOOL_BUCKET", 5, APR_BUCKET_DATA,
+static
+apr_status_t spool_bucket_split(apr_bucket *a, apr_size_t point)
+{
+    apr_status_t rv = apr_bucket_shared_split(a, point);
+    a->type = &apr_bucket_type_file;
+    return rv;
+}
+
+static const apr_bucket_type_t spool_bucket_type = {
+    "APREQ_SPOOL", 5, APR_BUCKET_DATA,
     spool_bucket_destroy,
     spool_bucket_read,
     spool_bucket_setaside,
-    apr_bucket_shared_split,
-    apr_bucket_shared_copy
+    spool_bucket_split,
+    apr_bucket_copy_notimpl,
 };
 
+
 APREQ_DECLARE(apr_status_t) apreq_brigade_concat(apr_pool_t *pool,
                                                  const char *temp_dir,
                                                  apr_size_t heap_limit,
@@ -937,7 +928,7 @@
 
         last_out = apr_bucket_file_create(file, wlen, 0, 
                                           out->p, out->bucket_alloc);
-        last_out->type = &spool_bucket;
+        last_out->type = &spool_bucket_type;
         APR_BRIGADE_INSERT_TAIL(out, last_out);
         f = last_out->data;
     }



Mime
View raw message