httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r966340 - in /httpd/httpd/branches/2.2.x: ./ CHANGES STATUS include/util_filter.h server/config.c
Date Wed, 21 Jul 2010 18:11:07 GMT
Author: pquerna
Date: Wed Jul 21 18:11:07 2010
New Revision: 966340

URL: http://svn.apache.org/viewvc?rev=966340&view=rev
Log:
Run filter "init" functions exactly once per request.  No longer run
init functions for connection filters (doing an "init" once per
handler invocation makes no sense for a connection filter).  No longer 
run init functions multiple times per request if a subrequest is used.

* include/util_filter.h (ap_filter_rec_t): Clarify use of the init
  function pointer.

* server/config.c (invoke_filter_init): Drop ap_ prefix for private
  function; take a request_rec pointer and only invoke filters with
  matching request.
  (ap_invoke_handler): Adjust accordingly.

PR: 49328
Reviewed by: rpluem

Modified:
    httpd/httpd/branches/2.2.x/   (props changed)
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/include/util_filter.h
    httpd/httpd/branches/2.2.x/server/config.c

Propchange: httpd/httpd/branches/2.2.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 21 18:11:07 2010
@@ -1 +1 @@
-/httpd/httpd/trunk:395552,417988,451572,583817,583830,611483,630858,639005,639010,647395,657354,657459,660461,660566,664330,678761,680082,681190,682369,683626,685112,686805,686809,687099,687754,693120,693392,693727-693728,696006,697093,706318,707163,708902,711421,719357,720250,729316-729317,729586,732414,732504,732832,733127,733134,733218-733219,734710,743589,755190,756671,756675,756678,756683,757741,761329,763394,764239,768535,769809,771587,771610,776325,777042,777091,778438-778439,778531,778942,780648,780655,780692,780697,780699,785457,785661,790587,803704,823536,823563,891282,932791,942209,955966
+/httpd/httpd/trunk:395552,417988,451572,583817,583830,611483,630858,639005,639010,647395,657354,657459,660461,660566,664330,678761,680082,681190,682369,683626,685112,686805,686809,687099,687754,693120,693392,693727-693728,696006,697093,706318,707163,708902,711421,719357,720250,729316-729317,729586,732414,732504,732832,733127,733134,733218-733219,734710,743589,755190,756671,756675,756678,756683,757741,761329,763394,764239,768535,769809,771587,771610,776325,777042,777091,778438-778439,778531,778942,780648,780655,780692,780697,780699,785457,785661,790587,803704,823536,823563,891282,932791,942209,953311,955966

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=966340&r1=966339&r2=966340&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Wed Jul 21 18:11:07 2010
@@ -5,6 +5,10 @@ Changes with Apache 2.2.16
      mod_proxy_ajp, mod_proxy_http, mod_reqtimeout: Fix timeout detection
      for platforms Windows, Netware and OS2.  PR: 49417. [Rainer Jung]
 
+  *) core: Filter init functions are now run strictly once per request
+     before handler invocation.  The init functions are no longer run
+     for connection filters.  PR 49328.  [Joe Orton]
+
   *) mod_filter: enable it to act on non-200 responses.
      PR 48377 [Nick Kew]
 

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=966340&r1=966339&r2=966340&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Wed Jul 21 18:11:07 2010
@@ -86,14 +86,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  * core: Filter init functions are now run strictly once per request
-    before handler invocation.  The init functions are no longer run
-    for connection filters.  PR 49328.
-    Trunk version of patch:
-       http://svn.apache.org/viewcvs.cgi?rev=953311&view=rev
-    Backport version for 2.2.x of patch:
-       Trunk version of patch works
-    +1: rpluem, jim, pquerna
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]

Modified: httpd/httpd/branches/2.2.x/include/util_filter.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/include/util_filter.h?rev=966340&r1=966339&r2=966340&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/include/util_filter.h (original)
+++ httpd/httpd/branches/2.2.x/include/util_filter.h Wed Jul 21 18:11:07 2010
@@ -221,10 +221,13 @@ struct ap_filter_rec_t {
     /** The function to call when this filter is invoked. */
     ap_filter_func filter_func;
 
-    /** The function to call before the handlers are invoked. Notice
-     * that this function is called only for filters participating in
-     * the http protocol. Filters for other protocols are to be
-     * initialized by the protocols themselves.
+    /** The function to call directly before the handlers are invoked
+     * for a request.  The init function is called once directly
+     * before running the handlers for a request or subrequest.  The
+     * init function is never called for a connection filter (with
+     * ftype >= AP_FTYPE_CONNECTION).  Any use of this function for
+     * filters for protocols other than HTTP is specified by the
+     * module supported that protocol.
      */
     ap_init_filter_func filter_init_func;
 

Modified: httpd/httpd/branches/2.2.x/server/config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/server/config.c?rev=966340&r1=966339&r2=966340&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/server/config.c (original)
+++ httpd/httpd/branches/2.2.x/server/config.c Wed Jul 21 18:11:07 2010
@@ -306,10 +306,14 @@ AP_CORE_DECLARE(ap_conf_vector_t *) ap_c
     return create_empty_config(p);
 }
 
-static int ap_invoke_filter_init(ap_filter_t *filters)
+/* Invoke the filter_init_func for all filters with FILTERS where f->r
+ * matches R.  Restricting to a matching R avoids re-running init
+ * functions for filters configured for r->main where r is a
+ * subrequest.  */
+static int invoke_filter_init(request_rec *r, ap_filter_t *filters)
 {
     while (filters) {
-        if (filters->frec->filter_init_func) {
+        if (filters->frec->filter_init_func && filters->r == r) {
             int result = filters->frec->filter_init_func(filters);
             if (result != OK) {
                 return result;
@@ -342,11 +346,11 @@ AP_CORE_DECLARE(int) ap_invoke_handler(r
      * run their init function to let them do any magic before we could
      * start generating data.
      */
-    result = ap_invoke_filter_init(r->input_filters);
+    result = invoke_filter_init(r, r->input_filters);
     if (result != OK) {
         return result;
     }
-    result = ap_invoke_filter_init(r->output_filters);
+    result = invoke_filter_init(r, r->output_filters);
     if (result != OK) {
         return result;
     }



Mime
View raw message