Author: joes
Date: Sat Jan 10 07:52:07 2009
New Revision: 733289

URL: http://svn.apache.org/viewvc?rev=733289&view=rev
Log:
add optional interface for apreq_handle_apache2()

Modified:
    httpd/apreq/branches/v2_10/CHANGES
    httpd/apreq/branches/v2_10/module/apache2/apreq_module_apache2.h
    httpd/apreq/branches/v2_10/module/apache2/filter.c
    
httpd/apreq/branches/v2_10/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c

Modified: httpd/apreq/branches/v2_10/CHANGES
URL: 
http://svn.apache.org/viewvc/httpd/apreq/branches/v2_10/CHANGES?rev=733289&r1=733288&r2=733289&view=diff
==============================================================================
--- httpd/apreq/branches/v2_10/CHANGES (original)
+++ httpd/apreq/branches/v2_10/CHANGES Sat Jan 10 07:52:07 2009
@@ -5,6 +5,9 @@
 @section v2_10 Changes with libapreq2-2.10 (released Nov 11, 2008)
 
 - C API [joes]
+  Add optional interface for apreq_handle_apache2().
+
+- C API [joes]
   Clean up buggy apreq_hook_find_param().
 
 - Perl Glue Build [Philip M. Gollucci]

Modified: httpd/apreq/branches/v2_10/module/apache2/apreq_module_apache2.h
URL: 
http://svn.apache.org/viewvc/httpd/apreq/branches/v2_10/module/apache2/apreq_module_apache2.h?rev=733289&r1=733288&r2=733289&view=diff
==============================================================================
--- httpd/apreq/branches/v2_10/module/apache2/apreq_module_apache2.h (original)
+++ httpd/apreq/branches/v2_10/module/apache2/apreq_module_apache2.h Sat Jan 10 
07:52:07 2009
@@ -19,6 +19,7 @@
 #define APREQ_APACHE2_H
 
 #include "apreq_module.h"
+#include "apr_optional.h"
 #include <httpd.h>
 
 #ifdef  __cplusplus
@@ -141,6 +142,12 @@
 APREQ_DECLARE(apreq_handle_t *) apreq_handle_apache2(request_rec *r);
 
 /**
+ *
+ *      
+ */
+APR_DECLARE_OPTIONAL_FN(apreq_handle_t *,apreq_handle_apache2, (request_rec 
*r));
+
+/**
  * The mod_apreq2 filter is named "apreq2", and may be used in Apache's
  * input filter directives, e.g.
  * @code

Modified: httpd/apreq/branches/v2_10/module/apache2/filter.c
URL: 
http://svn.apache.org/viewvc/httpd/apreq/branches/v2_10/module/apache2/filter.c?rev=733289&r1=733288&r2=733289&view=diff
==============================================================================
--- httpd/apreq/branches/v2_10/module/apache2/filter.c (original)
+++ httpd/apreq/branches/v2_10/module/apache2/filter.c Sat Jan 10 07:52:07 2009
@@ -417,6 +417,7 @@
                      "Failed to pre-initialize libapreq2");
         return HTTP_INTERNAL_SERVER_ERROR;
     }
+    APR_REGISTER_OPTIONAL_FN(apreq_handle_apache2);
     return OK;
 }
 

Modified: 
httpd/apreq/branches/v2_10/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c
URL: 
http://svn.apache.org/viewvc/httpd/apreq/branches/v2_10/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c?rev=733289&r1=733288&r2=733289&view=diff
==============================================================================
--- 
httpd/apreq/branches/v2_10/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c
 (original)
+++ 
httpd/apreq/branches/v2_10/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c
 Sat Jan 10 07:52:07 2009
@@ -69,11 +69,13 @@
     apreq_param_t *param;
     struct access_test_cfg *cfg = (struct access_test_cfg *)
         ap_get_module_config(r->per_dir_config, &apreq_access_test_module);
+    APR_OPTIONAL_FN_TYPE(apreq_handle_apache2) *fcn =
+        APR_RETRIEVE_OPTIONAL_FN(apreq_handle_apache2);
 
-    if (!cfg || !cfg->param)
+    if (!cfg || !cfg->param || !fcn)
         return DECLINED;
 
-    handle = apreq_handle_apache2(r);
+    handle = fcn(r);
     param = apreq_param(handle, cfg->param);
     if (param != NULL) {
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS,


Reply via email to