httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: cvs commit: httpd-apreq-2/env/t/cgi-bin .cvsignore
Date Fri, 24 Oct 2003 17:43:47 GMT
Joe Schaefer wrote:

> ... I had some problems running the
> tests with apr's current cvs- apr_env_get's behavior may have changed
> slightly, and I was getting segfaults on cgi tests 1-9. Initializing
> value = NULL took care of those. 

What was the exact problem? apr_env_get hasn't changed and its implementation 
on unix (assuming that's where you had this problem) is as simple as:

APR_DECLARE(apr_status_t) apr_env_get(char **value,
                                       const char *envvar,
                                       apr_pool_t *pool)
{
#ifdef HAVE_GETENV

     char *val = getenv(envvar);
     if (!val)
         return APR_ENOENT;
     *value = val;
     return APR_SUCCESS;

#else
     return APR_ENOTIMPL;
#endif
}

As long as you check for APR_SUCCESS the value should be OK to you without 
initializing it. I think the workaround of initting it to NULL hides the real 
problem. I did suggested to use a macro APREQ_ENV_STATUS to make the testing 
concise,
but the problem with it is that it just warns about the problem, whereas it 
should die.
I wasn't sure what's the right way to do that. But the problem is definitely 
there. I'd suggest to revert it and figure out what's broken for real on the 
way fixing APREQ_ENV_STATUS to be fatal.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message