httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sander Striker" <stri...@apache.org>
Subject RE: cvs commit: httpd-test/flood config.h.in flood_round_robin.c
Date Mon, 08 Sep 2003 01:20:46 GMT
> From: Jacek Prucia [mailto:jacek.prucia@acn.waw.pl]
> Sent: Monday, September 08, 2003 2:41 AM

> On Sun, 7 Sep 2003 20:06:09 -0400 (EDT)
> Cliff Woolley <jwoolley@virginia.edu> wrote:
> 
> > On Sun, 7 Sep 2003 jacekp@apache.org wrote:
> > 
> > >   +        if (apr_procattr_create(&procattr, rp->pool) != APR_SUCCESS)
{
> > >   +            apr_file_printf(local_stderr,
> > >   +                            "apr_procattr_create failed for '%s'\n",
> > >   +                            rp->url[rp->current_url].responsescript);
> > >   +            return APR_EGENERAL;
> > >   +        }
> > 
> > Why do all of these return APR_EGENERAL rather than catching the
> > apr_status_t from the function that was called (apr_procattr_create in
> > this case) and returning that?  Is this just a flood thing I don't know
> > about?
> 
> Nope. I'm not so familliar with APR, so a message to stderr plus APR_EGENERAL
> is a safe bet. If this looks really obscure considering APR concepts, then
> please feel free to commit a fix.

Basically do something like this:

  apr_status_t rv;
  ...

  rv = apr_procattr_create(&procattr, rp->pool);
  if (rv) { /* Or in full: if (rv != APR_SUCCESS) */
      apr_file_printf(local_stderr,
                      "apr_procattr_create failed for '%s'\n",
                      rp->url[rp->current_url].responsescript);
      return rv;
  }

IOW, preserve the error and pass it down back the calling chain.


Sander

Mime
View raw message