httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r157752 - in httpd/apreq/branches/multi-env-unstable: glue/perl/xsbuilder/APR/Request/Cookie/ glue/perl/xsbuilder/APR/Request/Param/ include/ library/ library/t/ module/ module/apache/t/c-modules/apreq_cookie_test/
Date Wed, 16 Mar 2005 13:59:40 GMT
Author: joes
Date: Wed Mar 16 05:59:36 2005
New Revision: 157752

URL: http://svn.apache.org/viewcvs?view=rev&rev=157752
Log:
s/TAINT/TAINTED/g to be consistent (and better match perl's SvTAINTED flag).


Modified:
    httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs
    httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/Param.xs
    httpd/apreq/branches/multi-env-unstable/include/apreq.h
    httpd/apreq/branches/multi-env-unstable/include/apreq_cookie.h
    httpd/apreq/branches/multi-env-unstable/include/apreq_param.h
    httpd/apreq/branches/multi-env-unstable/library/cookie.c
    httpd/apreq/branches/multi-env-unstable/library/param.c
    httpd/apreq/branches/multi-env-unstable/library/parser_header.c
    httpd/apreq/branches/multi-env-unstable/library/parser_multipart.c
    httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded.c
    httpd/apreq/branches/multi-env-unstable/library/t/params.c
    httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_cookie_test/mod_apreq_cookie_test.c
    httpd/apreq/branches/multi-env-unstable/module/test_cgi.c

Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs
(original)
+++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs
Wed Mar 16 05:59:36 2005
@@ -296,9 +296,9 @@
 
     if (items == 2) {
         if (SvTRUE(val))
-           apreq_cookie_taint_on(obj);
+           apreq_cookie_tainted_on(obj);
         else
-           apreq_cookie_taint_off(obj);
+           apreq_cookie_tainted_off(obj);
     }
 
   OUTPUT:
@@ -338,7 +338,7 @@
     v = SvPV(val, vlen);
     RETVAL = apreq_cookie_make(pool, n, nlen, v, vlen);
     if (SvTAINTED(name) || SvTAINTED(val))
-        apreq_cookie_taint_on(RETVAL);
+        apreq_cookie_tainted_on(RETVAL);
 
   OUTPUT:
     RETVAL

Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/Param.xs
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/Param.xs?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/Param.xs
(original)
+++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/Param.xs
Wed Mar 16 05:59:36 2005
@@ -430,9 +430,9 @@
 
     if (items == 2) {
         if (SvTRUE(val))
-           apreq_param_taint_on(obj);
+           apreq_param_tainted_on(obj);
         else
-           apreq_param_taint_off(obj);
+           apreq_param_tainted_off(obj);
     }
 
   OUTPUT:
@@ -474,7 +474,7 @@
     v = SvPV(val, vlen);
     RETVAL = apreq_param_make(pool, n, nlen, v, vlen);
     if (SvTAINTED(name) || SvTAINTED(val))
-        apreq_param_taint_on(RETVAL);
+        apreq_param_tainted_on(RETVAL);
 
   OUTPUT:
     RETVAL

Modified: httpd/apreq/branches/multi-env-unstable/include/apreq.h
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/include/apreq.h?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/include/apreq.h (original)
+++ httpd/apreq/branches/multi-env-unstable/include/apreq.h Wed Mar 16 05:59:36 2005
@@ -28,6 +28,14 @@
  extern "C" {
 #endif 
 
+/**
+ * @file apreq.h
+ * @brief Main header file...
+ * @ingroup libapreq2
+ *
+ * Define the generic APREQ_ macros and common data structures.
+ */
+
 #ifndef WIN32
 #define APREQ_DECLARE(d)                APR_DECLARE(d)
 #define APREQ_DECLARE_NONSTD(d)         APR_DECLARE_NONSTD(d)
@@ -38,8 +46,6 @@
 #define APREQ_DECLARE_DATA              __declspec(dllexport)
 #endif
 
-
-
 #define APREQ_DEFAULT_READ_BLOCK_SIZE   (64  * 1024)
 #define APREQ_DEFAULT_READ_LIMIT        (64 * 1024 * 1024)
 #define APREQ_DEFAULT_BRIGADE_LIMIT     (256 * 1024)
@@ -59,10 +65,11 @@
 #define APREQ_CHARSET_MASK        255
 
 #define APREQ_CHARSET_ASCII         0
+#define APREQ_CHARSET_ISO_8529_1    1
 #define APREQ_CHARSET_UTF8          8
 
-#define APREQ_TAINT_BIT             8
-#define APREQ_TAINT_MASK            1
+#define APREQ_TAINTED_BIT           8
+#define APREQ_TAINTED_MASK          1
 
 #define APREQ_COOKIE_VERSION_BIT   11
 #define APREQ_COOKIE_VERSION_MASK   3

Modified: httpd/apreq/branches/multi-env-unstable/include/apreq_cookie.h
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/include/apreq_cookie.h?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/include/apreq_cookie.h (original)
+++ httpd/apreq/branches/multi-env-unstable/include/apreq_cookie.h Wed Mar 16 05:59:36 2005
@@ -40,8 +40,10 @@
  *
  */
 
-/** XXX: move this to apreq_module_t ...
-    Maximum length of a single Set-Cookie(2) header */
+/** @todo convert this macro to an apreq_module_t method.
+ *
+ * Maximum length of a single Set-Cookie(2) header.
+ */
 #define APREQ_COOKIE_MAX_LENGTH            4096
 
 /** @brief Cookie type, supporting both Netscape and RFC cookie specifications.
@@ -61,7 +63,7 @@
 } apreq_cookie_t;
 
 
-/** Upgrades cookie jar table values to apreq_cookie_t structs. */
+/** Upgrades a jar's table values to apreq_cookie_t structs. */
 static APR_INLINE
 apreq_cookie_t *apreq_value_to_cookie(const char *val)
 {
@@ -108,19 +110,19 @@
 /** @return 1 if the taint flag is set, 0 otherwise. */
 static APR_INLINE
 unsigned apreq_cookie_is_tainted(const apreq_cookie_t *c) {
-    return APREQ_FLAGS_GET(c->flags, APREQ_TAINT);
+    return APREQ_FLAGS_GET(c->flags, APREQ_TAINTED);
 }
 
 /** Sets the cookie's tainted flag. */
 static APR_INLINE
-void apreq_cookie_taint_on(apreq_cookie_t *c) {
-    APREQ_FLAGS_ON(c->flags, APREQ_TAINT);
+void apreq_cookie_tainted_on(apreq_cookie_t *c) {
+    APREQ_FLAGS_ON(c->flags, APREQ_TAINTED);
 }
 
-/** Turns off the cookie's taint flag. */
+/** Turns off the cookie's tainted flag. */
 static APR_INLINE
-void apreq_cookie_taint_off(apreq_cookie_t *c) {
-    APREQ_FLAGS_OFF(c->flags, APREQ_TAINT);
+void apreq_cookie_tainted_off(apreq_cookie_t *c) {
+    APREQ_FLAGS_OFF(c->flags, APREQ_TAINTED);
 }
 
 /**
@@ -129,7 +131,14 @@
  * @param pool pool which allocates the cookies
  * @param jar table where parsed cookies are stored
  * @param header the header value
- * @return APR_SUCCESS or an error code
+ *
+ * @return APR_SUCCESS.
+ * @return ::APREQ_ERROR_BADSEQ if an unparseable character sequence appears.
+ * @return ::APREQ_ERROR_MISMATCH if an rfc-cookie attribute appears in a
+ *         netscape cookie header.
+ * @return ::APR_ENOTIMPL if an unrecognized rfc-cookie attribute appears.
+ * @return ::APREQ_ERROR_NOTOKEN if a required token was not present.
+ * @return ::APREQ_ERROR_BADCHAR if an unexpected token was present.
  */
 APREQ_DECLARE(apr_status_t) apreq_parse_cookie_header(apr_pool_t *pool,
                                                       apr_table_t *jar,
@@ -143,6 +152,7 @@
  * @param nlen  Length of name.
  * @param value The cookie's value.
  * @param vlen  Length of value.
+ *
  * @return the new cookie
  */
 APREQ_DECLARE(apreq_cookie_t *) apreq_cookie_make(apr_pool_t *pool, 
@@ -155,8 +165,10 @@
  * Returns a string that represents the cookie as it would appear 
  * in a valid "Set-Cookie*" header.
  *
- * @param c The cookie.
- * @param p The pool.
+ * @param c cookie.
+ * @param p pool which allocates the returned string.
+ *
+ * @return header string.
  */
 APREQ_DECLARE(char*) apreq_cookie_as_string(const apreq_cookie_t *c,
                                             apr_pool_t *p);
@@ -168,11 +180,12 @@
  * The return value has the same semantics as that of apr_snprintf,
  * including the special behavior for a "len = 0" argument.
  *
- * @param c The cookie.
- * @param buf Storage location for the result.
- * @param len Size of buf's storage area. 
+ * @param c   cookie.
+ * @param buf storage location for the result.
+ * @param len size of buf's storage area. 
+ *
+ * @return size of resulting header string.
  */
-
 APREQ_DECLARE(int) apreq_cookie_serialize(const apreq_cookie_t *c,
                                           char *buf, apr_size_t len);
 

Modified: httpd/apreq/branches/multi-env-unstable/include/apreq_param.h
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/include/apreq_param.h?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/include/apreq_param.h (original)
+++ httpd/apreq/branches/multi-env-unstable/include/apreq_param.h Wed Mar 16 05:59:36 2005
@@ -44,19 +44,19 @@
 /** @return 1 if the taint flag is set, 0 otherwise. */
 static APR_INLINE
 unsigned apreq_param_is_tainted(const apreq_param_t *p) {
-    return APREQ_FLAGS_GET(p->flags, APREQ_TAINT);
+    return APREQ_FLAGS_GET(p->flags, APREQ_TAINTED);
 }
 
 /** Sets the tainted flag. */
 static APR_INLINE
-void apreq_param_taint_on(apreq_param_t *p) {
-    APREQ_FLAGS_ON(p->flags, APREQ_TAINT);
+void apreq_param_tainted_on(apreq_param_t *p) {
+    APREQ_FLAGS_ON(p->flags, APREQ_TAINTED);
 }
 
 /** Turns off the taint flag. */
 static APR_INLINE
-void apreq_param_taint_off(apreq_param_t *p) {
-    APREQ_FLAGS_OFF(p->flags, APREQ_TAINT);
+void apreq_param_tainted_off(apreq_param_t *p) {
+    APREQ_FLAGS_OFF(p->flags, APREQ_TAINTED);
 }
 
 /** @return 1 if the UTF-8 flag is set, 0 otherwise. */

Modified: httpd/apreq/branches/multi-env-unstable/library/cookie.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/cookie.c?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/cookie.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/cookie.c Wed Mar 16 05:59:36 2005
@@ -355,7 +355,7 @@
                 return status;
 
             c = apreq_cookie_make(p, name, nlen, value, vlen);
-            APREQ_FLAGS_ON(c->flags, APREQ_TAINT);
+            apreq_cookie_tainted_on(c);
             if (version != NETSCAPE)
                 apreq_cookie_version_set(c, version);
         }

Modified: httpd/apreq/branches/multi-env-unstable/library/param.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/param.c?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/param.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/param.c Wed Mar 16 05:59:36 2005
@@ -150,7 +150,7 @@
                 if (s != APR_SUCCESS)
                     return s;
 
-                APREQ_FLAGS_ON(param->flags, APREQ_TAINT);
+                apreq_param_tainted_on(param);
                 apreq_value_table_add(&param->v, t);
             }
 

Modified: httpd/apreq/branches/multi-env-unstable/library/parser_header.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/parser_header.c?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/parser_header.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/parser_header.c Wed Mar 16 05:59:36 2005
@@ -143,7 +143,7 @@
     while ((f = APR_BRIGADE_FIRST(bb)) != e)
         apr_bucket_delete(f);
 
-    APREQ_FLAGS_ON(param->flags, APREQ_TAINT);
+    apreq_param_tainted_on(param);
     *p = param;
     return APR_SUCCESS;
 

Modified: httpd/apreq/branches/multi-env-unstable/library/parser_multipart.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/parser_multipart.c?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/parser_multipart.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/parser_multipart.c Wed Mar 16 05:59:36
2005
@@ -418,7 +418,7 @@
 
                         param = apreq_param_make(pool, name, nlen, 
                                                  filename, flen);
-                        APREQ_FLAGS_ON(param->flags, APREQ_TAINT);
+                        apreq_param_tainted_on(param);
                         param->info = ctx->info;
                         param->upload = apr_brigade_create(pool, 
                                                        ctx->bb->bucket_alloc);
@@ -441,7 +441,7 @@
                         nlen = strlen(name);
                         param = apreq_param_make(pool, name, nlen, 
                                                  filename, flen);
-                        APREQ_FLAGS_ON(param->flags, APREQ_TAINT);
+                        apreq_param_tainted_on(param);
                         param->info = ctx->info;
                         param->upload = apr_brigade_create(pool, 
                                                        ctx->bb->bucket_alloc);
@@ -465,7 +465,7 @@
                 flen = 0;
                 param = apreq_param_make(pool, name, nlen, 
                                          filename, flen);
-                APREQ_FLAGS_ON(param->flags, APREQ_TAINT);
+                apreq_param_tainted_on(param);
                 param->info = ctx->info;
                 param->upload = apr_brigade_create(pool, 
                                                ctx->bb->bucket_alloc);
@@ -502,7 +502,7 @@
                 len = off;
                 param = apreq_param_make(pool, ctx->param_name, 
                                          strlen(ctx->param_name), NULL, len);
-                APREQ_FLAGS_ON(param->flags, APREQ_TAINT);
+                apreq_param_tainted_on(param);
                 param->info = ctx->info;
 
                 *(const apreq_value_t **)&v = &param->v;

Modified: httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded.c?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded.c Wed Mar 16 05:59:36
2005
@@ -130,7 +130,7 @@
     while ((f = APR_BRIGADE_FIRST(bb)) != e)
         apr_bucket_delete(f);
 
-    APREQ_FLAGS_ON(param->flags, APREQ_TAINT);
+    apreq_param_tainted_on(param);
     *p = param;
     return APR_SUCCESS;
 }

Modified: httpd/apreq/branches/multi-env-unstable/library/t/params.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/t/params.c?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/t/params.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/t/params.c Wed Mar 16 05:59:36 2005
@@ -127,10 +127,10 @@
     AT_mem_eq(val, "20", 2);
 
     s = apreq_header_attribute(hdr, "age", 3, &val, &vlen);
-    AT_int_eq(s, APREQ_ERROR_BADTOKEN);
+    AT_int_eq(s, APREQ_ERROR_BADSEQ);
 
     s = apreq_header_attribute(hdr, "no-quote", 8, &val, &vlen);
-    AT_int_eq(s, APREQ_ERROR_BADTOKEN);
+    AT_int_eq(s, APREQ_ERROR_BADSEQ);
 
 }
 

Modified: httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_cookie_test/mod_apreq_cookie_test.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_cookie_test/mod_apreq_cookie_test.c?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_cookie_test/mod_apreq_cookie_test.c
(original)
+++ httpd/apreq/branches/multi-env-unstable/module/apache/t/c-modules/apreq_cookie_test/mod_apreq_cookie_test.c
Wed Mar 16 05:59:36 2005
@@ -72,11 +72,11 @@
     ap_set_content_type(r, "text/plain");
 
     if (strcmp(test, "bake") == 0) {
-        apreq_cookie_taint_off(cookie);
+        apreq_cookie_tainted_off(cookie);
         s = apreq_cookie_bake(cookie, req);
     }
     else if (strcmp(test, "bake2") == 0) {
-        apreq_cookie_taint_off(cookie);
+        apreq_cookie_tainted_off(cookie);
         s = apreq_cookie_bake2(cookie, req);
     }
     else {

Modified: httpd/apreq/branches/multi-env-unstable/module/test_cgi.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/test_cgi.c?view=diff&r1=157751&r2=157752
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/test_cgi.c (original)
+++ httpd/apreq/branches/multi-env-unstable/module/test_cgi.c Wed Mar 16 05:59:36 2005
@@ -95,11 +95,11 @@
         }
 
         if (strcmp(test->v.data, "bake") == 0) {
-            apreq_cookie_taint_off(cookie);
+            apreq_cookie_tainted_off(cookie);
             apreq_cookie_bake(cookie, req);
         }
         else if (strcmp(test->v.data, "bake2") == 0) {
-            apreq_cookie_taint_off(cookie);
+            apreq_cookie_tainted_off(cookie);
             apreq_cookie_bake2(cookie, req);
         }
 



Mime
View raw message