[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: svn commit: r1198930 - in /httpd/httpd/trunk: include/mod_core.h server/core.c server/main.c

On Fri, Aug 3, 2018 at 2:33 PM, Stefan Eissing
<stefan.eissing@xxxxxxxxxxxxx> wrote:
>>> Is a reference counting de-allocation not better fitting?
>> Not sure, at least for httpd, the first module loaded will be the last
>> cleaned up.
>> But refcounting and/or attaching the cleanup to the longest living
>> pool could be an option from a general usage POV.
> But that assumes that no module uses a function that uses a
> function...that calls crypto_init on a temp pool during conf test,
> for example, right?

This shouldn't be an issue from the APR's point of view (performance
is another matter).
But from the lib's POV this is another story though, for instance
openssl can't re-init so unless crypto_lib_init() was called at a
higher level you wouldn't be able to call that function multiple times
in the same program...
This is why the caller should be able to control the lifetime of
init/deinit (just like it controls the lifetime of DSOs), and here
call crypto_lib_init() outside the function (e.g. on a pool living at
least until that function is not called anymore).