httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <sreedhar.b...@wipro.com>
Subject RE: Setting Environment variables
Date Sat, 27 Dec 2003 08:26:52 GMT

Thanks very much for the reply.
Following is the sample piece of code we are using to set the
environment variables. On Windows it is exactly crashing at the
statement ap_table_setn(pVars, "Name", "Sreedhar") in the following
code. Moreover, the same piece of code is not crashing on HP, SOLARIS
and LINUX. But it is not setting the environment variable. Can anyone
let me know what is wrong in the following code.

typedef struct
{
    table *vars;
    char *unsetenv;
    int vars_present;
} env_dir_config_rec;
module MODULE_VAR_EXPORT env_module;
static int AuthenticateUser (request_rec* pRequestRec)
{
	env_dir_config_rec *pEnv = NULL;
	table *pVars = NULL;
	pEnv = (env_dir_config_rec
*)ap_get_module_config(pRequestRec->per_dir_config, &env_module);
	pVars = pEnv->vars;
	if(pVars)
    	{
		ap_table_setn(pVars, "Name", "Sreedhar");
		pRequestRec->subprocess_env =
ap_overlay_tables(pRequestRec->pool, pRequestRec->subprocess_env,
pVars);
    	}
	return HTTP_OK;
}

Regards,
Sreedhar


-----Original Message-----
From: friedo@friedo.com [mailto:friedo@friedo.com]
Sent: Friday, December 26, 2003 8:52 PM
To: dev@httpd.apache.org
Subject: Re: Setting Environment variables


Take a look at the ap_table_setn function.

http://httpd.apache.org/dev/apidoc/apidoc_ap_table_setn.html

The table that contains the environment variables is r->subprocess_env.

>
> Hi,
>
>     We are writing a plugin for the Apache 1.3.29 Windows version.
> Here one of the requirement is that we have to set the Customized
> environment variables. Can anyone let me know how to set the custom
> environment variables in Apache.
>
> Regards,
> Sreedhar
>
>
> Confidentiality Notice
>
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> addressee(s) and may contain confidential or privileged information.
> If you are not the intended recipient, please notify the sender at
> Wipro or Mailadmin@wipro.com immediately and destroy all copies of
> this message and any attachments.



Confidentiality Notice

The information contained in this electronic message and any attachments to this message are
intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information.
If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com
immediately
and destroy all copies of this message and any attachments.

Mime
View raw message