Module: exit master

Laurent larles.gw at gmail.com
Fri Feb 3 13:25:21 UTC 2012


Hi,

I'm experiencing some troubles (and headaches) with my little nginx module.
I've seen a lot of module code lately, and a ton of stuff about nginx
modules but I can't manage to do what I need to.
Here is my problem:
I have created my own nginx module called "mymodule". Its loc_conf
structure looks like that:

typedef struct {
    void *serverConf;
    ngx_str_t server_file;
} ngx_http_mymodule_loc_conf_t;

its command structure looks like that:

static ngx_command_t ngx_http_mymodule_commands[] = {
  {
  ngx_string("mymodule"),
  NGX_HTTP_LOC_CONF | NGX_CONF_TAKE1,
  ngx_http_mymodule,
  NGX_HTTP_LOC_CONF_OFFSET,
  0,
  NULL
  },
ngx_null_command };

in the ngx_http_mymodule function I do some stuff and set the
serverConf pointer in the ngx_http_mymodule_loc_conf_t.
The problem is that I would like to retrieve that serverConf pointer
when the thread / process is exited. But the only parameter given to
ngx_module_t while exiting thread process or master is a ngx_cycle_t*
and I can't find how to retrieve the ngx_http_mymodule_loc_conf_t from
it in order to work on that serverConf pointer.

Any help or idea would be appreciated :)
Thanks in advance.

-- 
larles



More information about the nginx-devel mailing list