You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2017/10/12 09:45:35 UTC
svn commit: r1811930 - in /httpd/httpd/branches/2.4.x: STATUS
patches/backport-module-flags.diff
Author: icing
Date: Thu Oct 12 09:45:35 2017
New Revision: 1811930
URL: http://svn.apache.org/viewvc?rev=1811930&view=rev
Log:
proposing new module flag backport
Added:
httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff
Modified:
httpd/httpd/branches/2.4.x/STATUS
Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1811930&r1=1811929&r2=1811930&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Thu Oct 12 09:45:35 2017
@@ -212,6 +212,13 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK:
2.4.x patch: trunk works
+1: jorton, wrowe
+ *) core/mod_ssl: Add new flag int to module struct. Define first bit for keeping
+ server config records non-shared instances, set for mod_ssl to make manipulations
+ in post_config safe.
+ trunk patch: svn merge -c 1809302,1809303,1809305,1809311,1809314,1809713 ^/httpd/httpd/trunk .
+ 2.4.x patch: patches/backport-module-flags.diff (merge with alterations for mmn etc.)
+ +1: icing
+
PATCHES/ISSUES THAT ARE BEING WORKED
[ New entries should be added at the START of the list ]
Added: httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff?rev=1811930&view=auto
==============================================================================
--- httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff (added)
+++ httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff Thu Oct 12 09:45:35 2017
@@ -0,0 +1,171 @@
+Index: include/ap_mmn.h
+===================================================================
+--- include/ap_mmn.h (revision 1811919)
++++ include/ap_mmn.h (working copy)
+@@ -496,6 +496,8 @@
+ * to ap_[r]getline()
+ * 20120211.68 (2.4.26-dev) Add ap_get_basic_auth_components() and deprecate
+ * ap_get_basic_auth_pw()
++ * 20120211.69 (2.4.29-dev) Add flags field to module_struct and function
++ * ap_get_module_flags()
+ */
+
+ #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
+@@ -503,7 +505,7 @@
+ #ifndef MODULE_MAGIC_NUMBER_MAJOR
+ #define MODULE_MAGIC_NUMBER_MAJOR 20120211
+ #endif
+-#define MODULE_MAGIC_NUMBER_MINOR 68 /* 0...n */
++#define MODULE_MAGIC_NUMBER_MINOR 69 /* 0...n */
+
+ /**
+ * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+Index: include/http_config.h
+===================================================================
+--- include/http_config.h (revision 1811919)
++++ include/http_config.h (working copy)
+@@ -329,6 +329,12 @@
+ };
+
+ /**
++ * Flags associated with a module.
++ */
++#define AP_MODULE_FLAG_NONE (0)
++#define AP_MODULE_FLAG_ALWAYS_MERGE (1 << 0)
++
++/**
+ * Module structures. Just about everything is dispatched through
+ * these, directly or indirectly (through the command and handler
+ * tables).
+@@ -407,6 +413,9 @@
+ * @param p the pool to use for all allocations
+ */
+ void (*register_hooks) (apr_pool_t *p);
++
++ /** A bitmask of AP_MODULE_FLAG_* */
++ int flags;
+ };
+
+ /**
+@@ -519,6 +528,21 @@
+ AP_DECLARE(void) ap_set_module_config(ap_conf_vector_t *cv, const module *m,
+ void *val);
+
++/**
++ * When module flags have been introduced, and a way to check this.
++ */
++#define AP_MODULE_FLAGS_MMN_MAJOR 20161018
++#define AP_MODULE_FLAGS_MMN_MINOR 7
++#define AP_MODULE_HAS_FLAGS(m) \
++ AP_MODULE_MAGIC_AT_LEAST(AP_MODULE_FLAGS_MMN_MAJOR, \
++ AP_MODULE_FLAGS_MMN_MINOR)
++/**
++ * Generic accessor for the module's flags
++ * @param m The module to get the flags from.
++ * @return The module-specific flags
++ */
++AP_DECLARE(int) ap_get_module_flags(const module *m);
++
+ #if !defined(AP_DEBUG)
+
+ #define ap_get_module_config(v,m) \
+Index: modules/ssl/mod_ssl.c
+===================================================================
+--- modules/ssl/mod_ssl.c (revision 1811919)
++++ modules/ssl/mod_ssl.c (working copy)
+@@ -713,4 +713,7 @@
+ ssl_config_server_merge, /* merge per-server config structures */
+ ssl_config_cmds, /* table of configuration directives */
+ ssl_register_hooks /* register hooks */
++#if defined(AP_MODULE_HAS_FLAGS)
++ ,AP_MODULE_FLAG_ALWAYS_MERGE /* flags */
++#endif
+ };
+Index: server/config.c
+===================================================================
+--- server/config.c (revision 1811919)
++++ server/config.c (working copy)
+@@ -323,7 +323,7 @@
+ }
+
+ static void merge_server_configs(apr_pool_t *p, ap_conf_vector_t *base,
+- ap_conf_vector_t *virt)
++ server_rec *virt)
+ {
+ /* Can reuse the 'virt' vector for the spine of it, since we don't
+ * have to deal with the moral equivalent of .htaccess files here...
+@@ -330,7 +330,7 @@
+ */
+
+ void **base_vector = (void **)base;
+- void **virt_vector = (void **)virt;
++ void **virt_vector = (void **)virt->module_config;
+ module *modp;
+
+ for (modp = ap_top_module; modp; modp = modp->next) {
+@@ -337,10 +337,20 @@
+ merger_func df = modp->merge_server_config;
+ int i = modp->module_index;
+
+- if (!virt_vector[i])
+- virt_vector[i] = base_vector[i];
+- else if (df)
++ if (!virt_vector[i]) {
++ if (df && modp->create_server_config
++ && (ap_get_module_flags(modp) &
++ AP_MODULE_FLAG_ALWAYS_MERGE)) {
++ virt_vector[i] = (*modp->create_server_config)(p, virt);
++ }
++ else {
++ virt_vector[i] = base_vector[i];
++ df = NULL;
++ }
++ }
++ if (df) {
+ virt_vector[i] = (*df)(p, base_vector[i], virt_vector[i]);
++ }
+ }
+ }
+
+@@ -2322,8 +2332,7 @@
+ dconf->log = &main_server->log;
+
+ for (virt = main_server->next; virt; virt = virt->next) {
+- merge_server_configs(p, main_server->module_config,
+- virt->module_config);
++ merge_server_configs(p, main_server->module_config, virt);
+
+ virt->lookup_defaults =
+ ap_merge_per_dir_configs(p, main_server->lookup_defaults,
+Index: server/util_debug.c
+===================================================================
+--- server/util_debug.c (revision 1811919)
++++ server/util_debug.c (working copy)
+@@ -107,6 +107,17 @@
+ return ((void **)cv)[m->module_index];
+ }
+
++AP_DECLARE(int) ap_get_module_flags(const module *m)
++{
++ if (m->version < AP_MODULE_FLAGS_MMN_MAJOR
++ || (m->version == AP_MODULE_FLAGS_MMN_MAJOR
++ && (m->minor_version < AP_MODULE_FLAGS_MMN_MINOR))) {
++ return 0;
++ }
++
++ return m->flags;
++}
++
+ #if defined(ap_get_core_module_config)
+ #undef ap_get_core_module_config
+ AP_DECLARE(void *) ap_get_core_module_config(const ap_conf_vector_t *cv);
+Index: .
+===================================================================
+--- . (revision 1811919)
++++ . (working copy)
+
+Property changes on: .
+___________________________________________________________________
+Modified: svn:mergeinfo
+## -0,0 +0,1 ##
+ Merged /httpd/httpd/trunk:r1809302-1809303,1809305,1809311,1809314,1809713
Re: svn commit: r1811930 - in /httpd/httpd/branches/2.4.x: STATUS
patches/backport-module-flags.diff
Posted by Stefan Eissing <st...@greenbytes.de>.
Thanks for the review! Updated the patch.
-Stefan
> Am 06.11.2017 um 13:10 schrieb Yann Ylavic <yl...@gmail.com>:
>
> On Thu, Oct 12, 2017 at 11:45 AM, <ic...@apache.org> wrote:
>> Author: icing
>> Date: Thu Oct 12 09:45:35 2017
>> New Revision: 1811930
>>
>> URL: http://svn.apache.org/viewvc?rev=1811930&view=rev
>> Log:
>> proposing new module flag backport
>>
> []
>>
>> Added: httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff
>> URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff?rev=1811930&view=auto
>> ==============================================================================
>> --- httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff (added)
>> +++ httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff Thu Oct 12 09:45:35 2017
>> @@ -0,0 +1,171 @@
>> +Index: include/ap_mmn.h
>> +===================================================================
>> +--- include/ap_mmn.h (revision 1811919)
>> ++++ include/ap_mmn.h (working copy)
>> +@@ -496,6 +496,8 @@
>> + * to ap_[r]getline()
>> + * 20120211.68 (2.4.26-dev) Add ap_get_basic_auth_components() and deprecate
>> + * ap_get_basic_auth_pw()
>> ++ * 20120211.69 (2.4.29-dev) Add flags field to module_struct and function
>> ++ * ap_get_module_flags()
>> + */
>> +
>> + #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
>> +@@ -503,7 +505,7 @@
>> + #ifndef MODULE_MAGIC_NUMBER_MAJOR
>> + #define MODULE_MAGIC_NUMBER_MAJOR 20120211
>> + #endif
>> +-#define MODULE_MAGIC_NUMBER_MINOR 68 /* 0...n */
>> ++#define MODULE_MAGIC_NUMBER_MINOR 69 /* 0...n */
>> +
>> + /**
>> + * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
>> +Index: include/http_config.h
>> +===================================================================
>> +--- include/http_config.h (revision 1811919)
>> ++++ include/http_config.h (working copy)
> []
>> +@@ -519,6 +528,21 @@
>> + AP_DECLARE(void) ap_set_module_config(ap_conf_vector_t *cv, const module *m,
>> + void *val);
>> +
>> ++/**
>> ++ * When module flags have been introduced, and a way to check this.
>> ++ */
>> ++#define AP_MODULE_FLAGS_MMN_MAJOR 20161018
>> ++#define AP_MODULE_FLAGS_MMN_MINOR 7
>> ++#define AP_MODULE_HAS_FLAGS(m) \
>> ++ AP_MODULE_MAGIC_AT_LEAST(AP_MODULE_FLAGS_MMN_MAJOR, \
>> ++ AP_MODULE_FLAGS_MMN_MINOR)
>
> For 2.4.x, I think AP_MODULE_FLAGS_MMN_MAJOR and
> AP_MODULE_FLAGS_MMN_MINOR should be the ones (in 2.4.x) at the time of
> this backport, i.e. (per ap_mmn.h change above):
>
> +#define AP_MODULE_FLAGS_MMN_MAJOR 20120211
> +#define AP_MODULE_FLAGS_MMN_MINOR 69
>
>
> I'm still +1 for a "backport-module-flags-v2.diff" with this change ;)
Re: svn commit: r1811930 - in /httpd/httpd/branches/2.4.x: STATUS patches/backport-module-flags.diff
Posted by Yann Ylavic <yl...@gmail.com>.
On Thu, Oct 12, 2017 at 11:45 AM, <ic...@apache.org> wrote:
> Author: icing
> Date: Thu Oct 12 09:45:35 2017
> New Revision: 1811930
>
> URL: http://svn.apache.org/viewvc?rev=1811930&view=rev
> Log:
> proposing new module flag backport
>
[]
>
> Added: httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff
> URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff?rev=1811930&view=auto
> ==============================================================================
> --- httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff (added)
> +++ httpd/httpd/branches/2.4.x/patches/backport-module-flags.diff Thu Oct 12 09:45:35 2017
> @@ -0,0 +1,171 @@
> +Index: include/ap_mmn.h
> +===================================================================
> +--- include/ap_mmn.h (revision 1811919)
> ++++ include/ap_mmn.h (working copy)
> +@@ -496,6 +496,8 @@
> + * to ap_[r]getline()
> + * 20120211.68 (2.4.26-dev) Add ap_get_basic_auth_components() and deprecate
> + * ap_get_basic_auth_pw()
> ++ * 20120211.69 (2.4.29-dev) Add flags field to module_struct and function
> ++ * ap_get_module_flags()
> + */
> +
> + #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
> +@@ -503,7 +505,7 @@
> + #ifndef MODULE_MAGIC_NUMBER_MAJOR
> + #define MODULE_MAGIC_NUMBER_MAJOR 20120211
> + #endif
> +-#define MODULE_MAGIC_NUMBER_MINOR 68 /* 0...n */
> ++#define MODULE_MAGIC_NUMBER_MINOR 69 /* 0...n */
> +
> + /**
> + * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
> +Index: include/http_config.h
> +===================================================================
> +--- include/http_config.h (revision 1811919)
> ++++ include/http_config.h (working copy)
[]
> +@@ -519,6 +528,21 @@
> + AP_DECLARE(void) ap_set_module_config(ap_conf_vector_t *cv, const module *m,
> + void *val);
> +
> ++/**
> ++ * When module flags have been introduced, and a way to check this.
> ++ */
> ++#define AP_MODULE_FLAGS_MMN_MAJOR 20161018
> ++#define AP_MODULE_FLAGS_MMN_MINOR 7
> ++#define AP_MODULE_HAS_FLAGS(m) \
> ++ AP_MODULE_MAGIC_AT_LEAST(AP_MODULE_FLAGS_MMN_MAJOR, \
> ++ AP_MODULE_FLAGS_MMN_MINOR)
For 2.4.x, I think AP_MODULE_FLAGS_MMN_MAJOR and
AP_MODULE_FLAGS_MMN_MINOR should be the ones (in 2.4.x) at the time of
this backport, i.e. (per ap_mmn.h change above):
+#define AP_MODULE_FLAGS_MMN_MAJOR 20120211
+#define AP_MODULE_FLAGS_MMN_MINOR 69
I'm still +1 for a "backport-module-flags-v2.diff" with this change ;)