You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Issac Goldstand <ma...@beamartyr.net> on 2009/01/10 17:01:42 UTC

Re: svn commit: r733288 - in /httpd/apreq/trunk: CHANGES module/apache2/apreq_module_apache2.h module/apache2/filter.c module/t/c-modules/apreq_access_test/mod_apreq_access_test.c

Out of curiosity, what sort of use-cases did you have in mind with
this?  It certainly looks interesting, but I can't really see when we'd
use it...

  Issac

joes@apache.org wrote:
> Author: joes
> Date: Sat Jan 10 07:51:20 2009
> New Revision: 733288
>
> URL: http://svn.apache.org/viewvc?rev=733288&view=rev
> Log:
> add optional interface for apreq_handle_apache2()
>
> Modified:
>     httpd/apreq/trunk/CHANGES
>     httpd/apreq/trunk/module/apache2/apreq_module_apache2.h
>     httpd/apreq/trunk/module/apache2/filter.c
>     httpd/apreq/trunk/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c
>
> Modified: httpd/apreq/trunk/CHANGES
> URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/CHANGES?rev=733288&r1=733287&r2=733288&view=diff
> ==============================================================================
> --- httpd/apreq/trunk/CHANGES (original)
> +++ httpd/apreq/trunk/CHANGES Sat Jan 10 07:51:20 2009
> @@ -5,6 +5,9 @@
>  @section v2_10 Changes with libapreq2-2.10 (under developement)
>  
>  - 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/trunk/module/apache2/apreq_module_apache2.h
> URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/module/apache2/apreq_module_apache2.h?rev=733288&r1=733287&r2=733288&view=diff
> ==============================================================================
> --- httpd/apreq/trunk/module/apache2/apreq_module_apache2.h (original)
> +++ httpd/apreq/trunk/module/apache2/apreq_module_apache2.h Sat Jan 10 07:51:20 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/trunk/module/apache2/filter.c
> URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/module/apache2/filter.c?rev=733288&r1=733287&r2=733288&view=diff
> ==============================================================================
> --- httpd/apreq/trunk/module/apache2/filter.c (original)
> +++ httpd/apreq/trunk/module/apache2/filter.c Sat Jan 10 07:51:20 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/trunk/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c
> URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c?rev=733288&r1=733287&r2=733288&view=diff
> ==============================================================================
> --- httpd/apreq/trunk/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c (original)
> +++ httpd/apreq/trunk/module/t/c-modules/apreq_access_test/mod_apreq_access_test.c Sat Jan 10 07:51:20 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,
>
>   


Re: svn commit: r733288 - in /httpd/apreq/trunk: CHANGES module/apache2/apreq_module_apache2.h module/apache2/filter.c module/t/c-modules/apreq_access_test/mod_apreq_access_test.c

Posted by Issac Goldstand <ma...@beamartyr.net>.
Joe Schaefer wrote:
> ----- Original Message ----
>
>   
>> From: Issac Goldstand <ma...@beamartyr.net>
>> To: apreq-dev@httpd.apache.org
>> Sent: Saturday, January 10, 2009 11:01:42 AM
>> Subject: Re: svn commit: r733288 - in /httpd/apreq/trunk: CHANGES module/apache2/apreq_module_apache2.h module/apache2/filter.c module/t/c-modules/apreq_access_test/mod_apreq_access_test.c
>>
>> Out of curiosity, what sort of use-cases did you have in mind with
>> this?  It certainly looks interesting, but I can't really see when we'd
>> use it...
>>
>>   Issac
>>
>>     
>
> The point of the optional interface is to eliminate problems arising from
> module loading order.  Without the optional interface, C modules which depend
> on mod_apreq2 must be loaded by apache AFTER mod_apreq2 gets loaded.  With
> the optional interface, the load order does not matter.  It's just one less
> headache for users to not have to worry about the order of their LoadModule
> directives in httpd.conf.
>   

Ahhh...  Cute.

Re: svn commit: r733288 - in /httpd/apreq/trunk: CHANGES module/apache2/apreq_module_apache2.h module/apache2/filter.c module/t/c-modules/apreq_access_test/mod_apreq_access_test.c

Posted by Joe Schaefer <jo...@yahoo.com>.
----- Original Message ----

> From: Issac Goldstand <ma...@beamartyr.net>
> To: apreq-dev@httpd.apache.org
> Sent: Saturday, January 10, 2009 11:01:42 AM
> Subject: Re: svn commit: r733288 - in /httpd/apreq/trunk: CHANGES module/apache2/apreq_module_apache2.h module/apache2/filter.c module/t/c-modules/apreq_access_test/mod_apreq_access_test.c
> 
> Out of curiosity, what sort of use-cases did you have in mind with
> this?  It certainly looks interesting, but I can't really see when we'd
> use it...
> 
>   Issac
> 

The point of the optional interface is to eliminate problems arising from
module loading order.  Without the optional interface, C modules which depend
on mod_apreq2 must be loaded by apache AFTER mod_apreq2 gets loaded.  With
the optional interface, the load order does not matter.  It's just one less
headache for users to not have to worry about the order of their LoadModule
directives in httpd.conf.