httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: error handling suggestion
Date Wed, 19 Jul 2000 00:21:25 GMT
On Tue, Jul 18, 2000 at 11:49:35PM +0100, Tony Finch wrote:
> Greg Stein wrote:
> >
> >*) note that errors must be dynamically allocated. most APR functions have a
> >   pool that can be used. ->msg can typically be a const string, but if it
> >   must be constructed, then it would also use the pool.
> 
> In addition to what Ryan said, if a function returns NULL to indicate "no
> error" how does it indicate "no memory"?

exit()

:-)

Seriously, there are two ways this could be done:

1) there is the "out of mem" callback. that could "do something". no idea
   what, though.

2) the parameters in an out-of-mem error are fixed/constant. it would be
   entirely possible to "return &ap_nomem_error;". I said "dynamically
   allocated" simply on the assumption that people aren't going to be
   setting up a bazillion global/const ap_error structures. I also wanted to
   emphasize that returning a pointer to an automatic variable would be way
   wrong :-), and returning a structure itself would also be badness
   (because it makes it hard to link them together)


In sort: the out-of-mem can be handled. No big deal.

The real question is whether there is any possibly consensus on an error
structure nowadays.
[ the past is past; we are free to rearchitect if we so choose, and are
  willing to accept the dev hit. ]

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message