You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Harrie Hazewinkel <ha...@covalent.net> on 2001/12/12 23:14:30 UTC

Return types for register-hooks and pre-config.

HI,

Some time ago the post_config phase return types was changed from
void to int in order detect if a module could not be configured
correctly at this phase.

I was wondering if there is a reason why this was not done for
the register-hooks phase and the pre-config phase??


harrie

Re: Return types for register-hooks and pre-config.

Posted by Harrie Hazewinkel <ha...@covalent.net>.

--On Wednesday, December 12, 2001 2:32 PM -0800 Ryan Bloom 
<rb...@covalent.net> wrote:
>> Or for instance, the register_hooks fails where some
>> memory needed to be allocated. This function after all
>> gets an apr_pool_t...
>
> But we never try to recover from an out of memory error, because it can't
> be done reliably.

I don't see this, but OK.

>  As for the modules relying on each other, that is why
> we have optional functions, so that we can cleanly fail in a situation
> like that.  I guess the argument could be made that if you can't find a
> function, you may not want the server to start, but why?

Maybe you have common functionality which is used in multiple
modules and therefore, you put this in one common module.

> If that is the
> case, it should all be one module with static functions.

IMHO, this is not neccesarly true and it does not hurt
to provide the capability to return from the register-hooks
nad pre-config while indicating an error.

Also other things which could indicate errors in the
register-hooks and pre-config phases are for instance
the avaialability of files/directories for a perticular module.
There are many cases to think of.


On the other hand one can always doing an 'exit()',
but to avoid that the post_config now returning an int
also.


harrie

Re: Return types for register-hooks and pre-config.

Posted by Ryan Bloom <rb...@covalent.net>.
On Wednesday 12 December 2001 02:25 pm, Harrie Hazewinkel wrote:
> --On Wednesday, December 12, 2001 2:21 PM -0800 Ryan Bloom
>
> <rb...@covalent.net> wrote:
> > On Wednesday 12 December 2001 02:14 pm, Harrie Hazewinkel wrote:
> >> HI,
> >>
> >> Some time ago the post_config phase return types was changed from
> >> void to int in order detect if a module could not be configured
> >> correctly at this phase.
> >>
> >> I was wondering if there is a reason why this was not done for
> >> the register-hooks phase and the pre-config phase??
> >
> > How could either of those two phases fail?  If you are running
> > pre-config, and it fails, then you have something very wrong with your
> > module, or your machine.  Same goes for register_hooks.  What am I
> > missing?
>
> For instance, if some module provides common functionality for
> other modules and there for a registration needs to be done
> which fails?? Or it needs to allocate some memory. This function
> has even 3 kinds of apr_pools_t to his disposal.
>
> Or for instance, the register_hooks fails where some
> memory needed to be allocated. This function after all
> gets an apr_pool_t...

But we never try to recover from an out of memory error, because it can't
be done reliably.  As for the modules relying on each other, that is why
we have optional functions, so that we can cleanly fail in a situation like
that.  I guess the argument could be made that if you can't find a function,
you may not want the server to start, but why?  If that is the case, it should
all be one module with static functions.

Ryan

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: Return types for register-hooks and pre-config.

Posted by Harrie Hazewinkel <ha...@covalent.net>.

--On Wednesday, December 12, 2001 2:21 PM -0800 Ryan Bloom 
<rb...@covalent.net> wrote:

> On Wednesday 12 December 2001 02:14 pm, Harrie Hazewinkel wrote:
>> HI,
>>
>> Some time ago the post_config phase return types was changed from
>> void to int in order detect if a module could not be configured
>> correctly at this phase.
>>
>> I was wondering if there is a reason why this was not done for
>> the register-hooks phase and the pre-config phase??
>
> How could either of those two phases fail?  If you are running pre-config,
> and it fails, then you have something very wrong with your module, or your
> machine.  Same goes for register_hooks.  What am I missing?

For instance, if some module provides common functionality for
other modules and there for a registration needs to be done
which fails?? Or it needs to allocate some memory. This function
has even 3 kinds of apr_pools_t to his disposal.

Or for instance, the register_hooks fails where some
memory needed to be allocated. This function after all
gets an apr_pool_t...

Harrie

Re: Return types for register-hooks and pre-config.

Posted by Ryan Bloom <rb...@covalent.net>.
On Wednesday 12 December 2001 02:14 pm, Harrie Hazewinkel wrote:
> HI,
>
> Some time ago the post_config phase return types was changed from
> void to int in order detect if a module could not be configured
> correctly at this phase.
>
> I was wondering if there is a reason why this was not done for
> the register-hooks phase and the pre-config phase??

How could either of those two phases fail?  If you are running pre-config,
and it fails, then you have something very wrong with your module, or your
machine.  Same goes for register_hooks.  What am I missing?

Ryan

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------