httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
Subject Re: [apreq-2] libapreq_cgi and getenv
Date Mon, 20 Oct 2003 05:40:07 GMT
On Sun, 19 Oct 2003, Stas Bekman wrote:

> Randy Kobes wrote:
>
> >>it doesn't hurt to check for failure. Probabaly write a macro to avoid noise
> >>(adopted from mp2):
> >>
> >>+ #define APREQ_ASSERT(rc_run) do { \
> >>+         apr_status_t rc = rc_run; \
> >>+         if (rc != APR_SUCCESS) { \
> >>+             ap_log_error(APLOG_MARK, APLOG_ERR, rc, NULL, "failed: "); \
> >>+         } \
> >>+     } while (0)
> [...]
> > Thanks, Stas! That is a good check ...
>
> well, ideally it should abort the execution as well...
>
> Also may be APREQ_ASSERT is not the best name, in mp2 it's called
> MP_FAILURE_CROAK()... may be APREQ_STATUS_CHECK? or something like that?

Perhaps APREQ_STATUS_CHECK?

I'm not sure it should abort, though, at least for
apr_get_env(); from what I gather, if the environment
variable for a given key doesn't exist, it just returns
that key (and sets the status accordingly), and it's up to
the caller to deal with that case?

-- 
best regards,
randy

Mime
View raw message