]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mergeinfo for r1487458
authorJeff Trawick <trawick@apache.org>
Wed, 29 May 2013 12:35:00 +0000 (12:35 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 29 May 2013 12:35:00 +0000 (12:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1487459 13f79535-47bb-0310-9956-ffa450edef68

modules/experimental/mod_example.c
modules/filters/mod_ext_filter.c
modules/http/http_request.c
server/main.c

index a351e6bfd56069b535bffcccbb328f3be3e249ef..60a757f80bb7df753f21deb48a6b2721c60d02a4 100644 (file)
@@ -922,7 +922,7 @@ static const char *x_http_scheme(const request_rec *r)
     /*
      * Log the call and exit.
      */
-    trace_add(r->server, NULL, cfg, "x_http_scheme()");
+    trace_add(r->server, r, cfg, "x_http_scheme()");
     return "example";
 }
 
@@ -941,7 +941,7 @@ static apr_port_t x_default_port(const request_rec *r)
     /*
      * Log the call and exit.
      */
-    trace_add(r->server, NULL, cfg, "x_default_port()");
+    trace_add(r->server, r, cfg, "x_default_port()");
     return 80;
 }
 #endif /*0*/
@@ -961,7 +961,7 @@ static void x_insert_filter(request_rec *r)
     /*
      * Log the call and exit.
      */
-    trace_add(r->server, NULL, cfg, "x_insert_filter()");
+    trace_add(r->server, r, cfg, "x_insert_filter()");
 }
 
 /*
@@ -979,7 +979,7 @@ static int x_quick_handler(request_rec *r, int lookup_uri)
     /*
      * Log the call and exit.
      */
-    trace_add(r->server, NULL, cfg, "x_quick_handler()");
+    trace_add(r->server, r, cfg, "x_quick_handler()");
     return DECLINED;
 }
 
index fe92271625e5b1ccce7d42f010e0e71b40312c84..7a5a0c6f80c2ca818244e05644ddc51e2f043a55 100644 (file)
@@ -67,7 +67,7 @@ typedef struct ef_ctx_t {
     apr_procattr_t *procattr;
     ef_dir_t *dc;
     ef_filter_t *filter;
-    int noop;
+    int noop, hit_eos;
 #if APR_FILES_AS_SOCKETS
     apr_pollset_t *pollset;
 #endif
@@ -856,6 +856,7 @@ static int ef_unified_filter(ap_filter_t *f, apr_bucket_brigade *bb)
     if (eos) {
         b = apr_bucket_eos_create(c->bucket_alloc);
         APR_BRIGADE_INSERT_TAIL(bb, b);
+        ctx->hit_eos = 1;
     }
 
     return APR_SUCCESS;
@@ -939,6 +940,14 @@ static int ef_input_filter(ap_filter_t *f, apr_bucket_brigade *bb,
         ctx = f->ctx;
     }
 
+    if (ctx->hit_eos) {
+        /* Match behaviour of HTTP_IN if filter is re-invoked after
+         * hitting EOS: give back another EOS. */
+        apr_bucket *e = apr_bucket_eos_create(f->c->bucket_alloc);
+        APR_BRIGADE_INSERT_TAIL(bb, e);
+        return APR_SUCCESS;
+    }
+
     if (ctx->noop) {
         ap_remove_input_filter(f);
         return ap_get_brigade(f->next, bb, mode, block, readbytes);
index 9d63aca816bf94f738272d7154c988339ee556ce..38d5aefb62410ca8a4ab64fa2e0f0f9627360831 100644 (file)
@@ -243,16 +243,16 @@ static void check_pipeline_flush(request_rec *r)
         }
     }
 
-        e = apr_bucket_flush_create(c->bucket_alloc);
+    e = apr_bucket_flush_create(c->bucket_alloc);
 
-        /* We just send directly to the connection based filters.  At
-         * this point, we know that we have seen all of the data
-         * (request finalization sent an EOS bucket, which empties all
-         * of the request filters). We just want to flush the buckets
-         * if something hasn't been sent to the network yet.
-         */
-        APR_BRIGADE_INSERT_HEAD(bb, e);
-        ap_pass_brigade(r->connection->output_filters, bb);
+    /* We just send directly to the connection based filters.  At
+     * this point, we know that we have seen all of the data
+     * (request finalization sent an EOS bucket, which empties all
+     * of the request filters). We just want to flush the buckets
+     * if something hasn't been sent to the network yet.
+     */
+    APR_BRIGADE_INSERT_HEAD(bb, e);
+    ap_pass_brigade(r->connection->output_filters, bb);
 }
 
 void ap_process_request(request_rec *r)
index 0892b1f9ed0d0dfa650c168af22cc3712d1527c9..66e72fc9a76380132e8307bb53760ca670915b85 100644 (file)
@@ -626,6 +626,10 @@ int main(int argc, const char * const argv[])
      */
 
     ap_server_root = def_server_root;
+    if (ap_server_root_relative(ptemp, "foo") == NULL) {
+        fail();
+    }
+
     if (temp_error_log) {
         ap_replace_stderr_log(process->pool, temp_error_log);
     }
@@ -707,6 +711,10 @@ int main(int argc, const char * const argv[])
         apr_pool_create(&ptemp, pconf);
         apr_pool_tag(ptemp, "ptemp");
         ap_server_root = def_server_root;
+        if (ap_server_root_relative(ptemp, "foo") == NULL) {
+            fail();
+        }
+
         server_conf = ap_read_config(process, ptemp, confname, &ap_conftree);
         if (!server_conf) {
             destroy_and_exit_process(process, 1);