MCPcopy Create free account
hub / github.com/apache/httpd / x_merge_server_config

Function x_merge_server_config

modules/examples/mod_example_hooks.c:672–697  ·  view source on GitHub ↗

* This function gets called to merge two per-server configuration * records. This is typically done to cope with things like virtual hosts and * the default server configuration The routine has the responsibility of * creating a new record and merging the contents of the other two into it * appropriately. If the module doesn't declare a merge routine, the more * specific existing record is

Source from the content-addressed store, hash-verified

670 * containing the merged values.
671 */
672static void *x_merge_server_config(apr_pool_t *p, void *server1_conf,
673 void *server2_conf)
674{
675
676 x_cfg *merged_config = (x_cfg *) apr_pcalloc(p, sizeof(x_cfg));
677 x_cfg *s1conf = (x_cfg *) server1_conf;
678 x_cfg *s2conf = (x_cfg *) server2_conf;
679 char *note;
680
681 /*
682 * Our inheritance rules are our own, and part of our module's semantics.
683 * Basically, just note whence we came.
684 */
685 merged_config->cmode =
686 (s1conf->cmode == s2conf->cmode) ? s1conf->cmode : CONFIG_MODE_COMBO;
687 merged_config->local = s2conf->local;
688 merged_config->congenital = (s1conf->congenital | s1conf->local);
689 merged_config->loc = apr_pstrdup(p, s2conf->loc);
690 /*
691 * Trace our call, including what we were asked to merge.
692 */
693 note = apr_pstrcat(p, "x_merge_server_config(\"", s1conf->loc, "\",\"",
694 s2conf->loc, "\")", NULL);
695 trace_startup(p, NULL, merged_config, note);
696 return (void *) merged_config;
697}
698
699
700/*--------------------------------------------------------------------------*

Callers

nothing calls this directly

Calls 1

trace_startupFunction · 0.85

Tested by

no test coverage detected