On Thu, Sep 21, 2017 at 7:00 AM, Yann Ylavic <ylavic....@gmail.com> wrote: > On Thu, Sep 21, 2017 at 11:48 AM, Stefan Eissing > <stefan.eiss...@greenbytes.de> wrote: >> >>> Am 21.09.2017 um 11:37 schrieb Yann Ylavic <ylavic....@gmail.com>: >>> >>> If the module defines its own server_config_create() which allocates >>> one, each vhost will have its own, and the module's >>> server_config_merge() can do whatever needs to for the members of the >>> config (pointer copy, shallow/deep copy, ...). >> >> Yes, but only *iff* there is every a directive of that module used in >> a VirtualHost. > > OK, I see know, thanks. > > I'd call that a premature optimization though, even if it matured for decades > :) > Only the module knows what to do when merging, so I think the core > config should still call config_create() and config_merge() for those, > precisely because post_config() is always called. > Modules also know how to merge configs that do nothing (usually), with > all those _set members all over the place, so it should work (untested > ;) even if it may consume more (not that much I think) initial memory > for large confs.
Maybe less intrusive for a module to make a copy of its config if it detects base/vh are the same and needs them to differ?