httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tsach Moshkovits <tsach.moshkov...@exlibris.co.il>
Subject [users@httpd] using getenv in apache module
Date Mon, 29 Dec 2003 05:22:02 GMT
Hi,
I have an apache module written in C and I try to use getenv ,like a simple
ptr=getenv("QUERY_STRING"); , inside my module but the ptr is always NULL...
The only env variable the module "knows" are the env variables the process
which started the apache "knew". How can I get the server's variable any CGI
usually needs?

Here a short snapshots from the module code in C and from the httpd.conf :

static const handler_rec my_handlers[] = {

    {
     "*/*", my_handler}, {
                             NULL}
};
module MODULE_VAR_EXPORT my_module = {

    STANDARD_MODULE_STUFF, NULL,        /* initializer */
    NULL,                       /* create per-directory config structure */
    NULL,                       /* merge per-directory config structures */
    NULL,                       /* create per-server config structure */
    NULL,                       /* merge per-server config structures */
    my_cmds,                 /* command table */
    my_handlers,             /* handlers */
    NULL,                       /* translate_handler */
    NULL,                       /* check_user_id */
    NULL,                       /* check auth */
    NULL,                       /* check access */
    NULL,                       /* type_checker */
    NULL,                       /* pre-run fixups */
    NULL,                       /* logger */
    NULL,                       /* header parser */
    NULL,                       /* child_init */
    NULL,                       /* child_exit */
    NULL                        /* post read-request */
};

static int my_handler(request_rec * r)
{
.
. fprintf(stderr,"...getenv(QUERY_STRING)=%s\n",getenv("QUERY_STRING"));
.
.
}



and the httpd.conf looks like:
.
.
.
LoadModule my_module       /exlibris/aleph/a16_1/aleph/exe/mod_my_module.so
.
.


Any help will be appreciated

Tsach
	


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message