httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r154847 - in httpd/apreq/branches/multi-env-unstable: glue/perl/t/apreq/cgi.t include/apreq_error.h module/apache2/filter.c module/t/c-modules/apreq_access_test/mod_apreq_access_test.c module/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c
Date Tue, 22 Feb 2005 14:00:51 GMT
Author: joes
Date: Tue Feb 22 06:00:49 2005
New Revision: 154847

URL: http://svn.apache.org/viewcvs?view=rev&rev=154847
Log:

Sync module/t/c-modules with apreq_params change.  Also add
APREQ_ERROR_INTERRUPT again, mainly to fix the error condition
check in apreq_filter.

Modified:
    httpd/apreq/branches/multi-env-unstable/glue/perl/t/apreq/cgi.t
    httpd/apreq/branches/multi-env-unstable/include/apreq_error.h
    httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c
    httpd/apreq/branches/multi-env-unstable/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c
    httpd/apreq/branches/multi-env-unstable/module/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c

Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/t/apreq/cgi.t
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/glue/perl/t/apreq/cgi.t?view=diff&r1=154846&r2=154847
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/glue/perl/t/apreq/cgi.t (original)
+++ httpd/apreq/branches/multi-env-unstable/glue/perl/t/apreq/cgi.t Tue Feb 22 06:00:49 2005
@@ -36,7 +36,7 @@
 my @big_keys    = ('a'..'z');
 
 plan tests => 10 + @key_len * @key_num + @big_key_len * @big_key_num +
-  @names * @methods, under_construction;#, have_lwp, have_cgi;
+  @names * @methods, have_lwp && have_cgi;
 
 my $location = '/cgi-bin';
 my $script = $location . '/test_cgi.pl';
@@ -209,16 +209,16 @@
 use Apache2;
 use APR;
 use APR::Pool;
-use Apache::Request;
-use Apache::Cookie;
-use Apache::Upload;
+use APR::Request::Param;
+use APR::Request::Cookie;
+use APR::Request::CGI;
 use File::Spec;
 require File::Basename;
 
 my $p = APR::Pool->new();
 
-apreq_log("Creating Apache::Request object");
-my $req = Apache::Request->new($p);
+apreq_log("Creating APR::Request::CGI object");
+my $req = APR::Request::CGI->new($p);
 
 my $foo = $req->param("foo");
 my $bar = $req->param("bar");
@@ -240,7 +240,7 @@
 }
     
 elsif ($test && $key) {
-    my %cookies = Apache::Cookie->fetch($p);
+    my %cookies = %{ $req->jar };
     apreq_log("Fetching cookie $key");
     if ($cookies{$key}) {
         if ($test eq "bake") {

Modified: httpd/apreq/branches/multi-env-unstable/include/apreq_error.h
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/include/apreq_error.h?view=diff&r1=154846&r2=154847
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/include/apreq_error.h (original)
+++ httpd/apreq/branches/multi-env-unstable/include/apreq_error.h Tue Feb 22 06:00:49 2005
@@ -54,7 +54,7 @@
 #define APREQ_ERROR_NOATTR         (APREQ_ERROR_NODATA   +  1)
 #define APREQ_ERROR_NOHEADER       (APREQ_ERROR_NODATA   +  2)
 #define APREQ_ERROR_NOPARSER       (APREQ_ERROR_NODATA   +  3)
-
+#define APREQ_ERROR_INTERRUPT      (APREQ_ERROR_NODATA   +  4)
 
 /* 30's: configuration conflicts */
 #define APREQ_ERROR_MISMATCH       (APREQ_ERROR_GENERAL  + 30)

Modified: httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c?view=diff&r1=154846&r2=154847
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c (original)
+++ httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c Tue Feb 22 06:00:49 2005
@@ -285,6 +285,7 @@
  * before the filter chain is stacked by ap_get_brigade.
  */
 
+
 static apr_status_t apreq_filter_init(ap_filter_t *f)
 {
     request_rec *r = f->r;
@@ -318,11 +319,27 @@
     if (handle->f == f) {
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, 
                      "disabling stale protocol filter");
+        if (ctx->status == APR_INCOMPLETE)
+            ctx->status = APREQ_ERROR_INTERRUPT;
         handle->f = NULL;
     }
     return APR_SUCCESS;
 }
 
+static APR_INLINE
+unsigned apreq_filter_status_is_error(apr_status_t s)
+{
+    switch (s) {
+    case APR_INCOMPLETE:
+    case APREQ_ERROR_INTERRUPT:
+    case APR_SUCCESS:
+        return 0;
+    default:
+        return 1;
+    }
+}
+
+
 apr_status_t apreq_filter(ap_filter_t *f,
                           apr_bucket_brigade *bb,
                           ap_input_mode_t mode,
@@ -350,15 +367,10 @@
 
     ctx = f->ctx;
 
-    switch (ctx->status) {
-
-    case APR_EINIT:
+    if (ctx->status == APR_EINIT)
         apreq_filter_init_context(f);
-        if (ctx->status == APR_INCOMPLETE)
-            break;
 
-    case APREQ_ERROR_NOPARSER:
-        assert(bb != NULL);
+    if (apreq_filter_status_is_error(ctx->status)) {
         rv = ap_get_brigade(f->next, bb, mode, block, readbytes);
         ap_remove_input_filter(f);
         return rv;
@@ -556,7 +568,8 @@
         ctx = f->next->ctx;
 
         switch (ctx->status) {
-        case APR_INCOMPLETE:
+        case APREQ_ERROR_INTERRUPT:
+            ctx->status = APR_INCOMPLETE;
         case APR_SUCCESS:
 
             if (d != NULL) {

Modified: httpd/apreq/branches/multi-env-unstable/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c?view=diff&r1=154846&r2=154847
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c
(original)
+++ httpd/apreq/branches/multi-env-unstable/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c
Tue Feb 22 06:00:49 2005
@@ -80,7 +80,7 @@
         return OK;
     }
     else {
-        const apr_table_t *t = apreq_params(r->pool, handle);
+        const apr_table_t *t = apreq_params(handle, r->pool);
         if (t != NULL) {
             ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_EGENERAL, r, 
                           "%s not found: parsing error detected (%d params)",

Modified: httpd/apreq/branches/multi-env-unstable/module/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c?view=diff&r1=154846&r2=154847
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c
(original)
+++ httpd/apreq/branches/multi-env-unstable/module/t/c-modules/apreq_big_request_test/mod_apreq_big_request_test.c
Tue Feb 22 06:00:49 2005
@@ -39,16 +39,16 @@
 
 static int apreq_big_request_test_handler(request_rec *r)
 {
-    apreq_handle_t *env;
+    apreq_handle_t *req;
     apr_table_t *params;
     int count = 0;
 
     if (strcmp(r->handler, "apreq_big_request_test") != 0)
         return DECLINED;
 
-    env = apreq_handle_apache2(r);
+    req = apreq_handle_apache2(r);
 
-    params = apreq_params(r->pool, env);
+    params = apreq_params(req, r->pool);
     apr_table_do(dump_table, &count, params, NULL);
     ap_set_content_type(r, "text/plain");
     ap_rprintf(r, "%d", count);



Mime
View raw message