httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Schom├Ącker <henri.schomaec...@virtual-homes.de>
Subject no results with apr_env_get
Date Tue, 22 Mar 2005 12:08:04 GMT
Hi folks,

I have a problem getting the environment variables with apr_env_get in 
the request handler of my module.
What I need are HTTP_USER_AGENT and REMOTE_ADDRESS but I just don't get 
anything as a resullt in my char*.

Here's the code:
8<--------8<--------8<--------8<--------8<--------8<--------8<--
char* chUserAgent;*
if* (apr_env_get(&chUserAgent, "HTTP_USER_AGENT", r->pool) == APR_ENOENT) {
    ap_rputs( "chUserAgent: Kein Eintrag in APR!<br>\n", r );
}
*else* {
    ap_rprintf( r, "chUserAgent: %s<br>\n" , chUserAgent );
}

// I don't even get it using the getenv function:
char *chUserAgent2 = getenv("HTTP_USER_AGENT"); ap_rprintf( r, 
"chUserAgent2 using the getenv() function: %s<br>\n", chUserAgent2 );
8<--------8<--------8<--------8<--------8<--------8<--------8<--

I must have been missing something but I don't know what.

Many thanks for every reply,
    yours Henri





Mime
View raw message