request and connection machine
The ability to respond to and process datagrams Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
parent
19fafc6a8c
commit
c4f7f51fe8
12 changed files with 493 additions and 4254 deletions
55
muninn_core.c
Normal file
55
muninn_core.c
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#include "muninn.h"
|
||||
|
||||
|
||||
static char *mun_conf_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
|
||||
static void *mun_core_create_conf(ngx_cycle_t *cycle);
|
||||
|
||||
|
||||
static ngx_command_t ngx_muninn_core_commands[] = {
|
||||
{ ngx_string("muninn"),
|
||||
NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
|
||||
mun_conf_server,
|
||||
0, 0, NULL },
|
||||
|
||||
ngx_null_command
|
||||
};
|
||||
|
||||
static ngx_core_module_t ngx_muninn_core_module_ctx = {
|
||||
ngx_string("muninn_core"),
|
||||
mun_core_create_conf,
|
||||
NULL,
|
||||
};
|
||||
|
||||
ngx_module_t ngx_muninn_core_module = {
|
||||
NGX_MODULE_V1,
|
||||
&ngx_muninn_core_module_ctx,
|
||||
ngx_muninn_core_commands,
|
||||
NGX_CORE_MODULE,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NGX_MODULE_V1_PADDING
|
||||
};
|
||||
|
||||
|
||||
static void *mun_core_create_conf(ngx_cycle_t *cycle) {
|
||||
ngx_int_t *conf;
|
||||
if (!(conf = ngx_pcalloc(cycle->pool, sizeof(ngx_int_t))))
|
||||
return NULL;
|
||||
|
||||
return conf;
|
||||
}
|
||||
|
||||
static char *mun_conf_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) {
|
||||
if (!conf) return "no conf";
|
||||
if (**(ngx_int_t **) conf) return "duplicate block";
|
||||
|
||||
**(ngx_int_t **)conf = 1;
|
||||
cf->module_type = NGX_MUNINN_MODULE;
|
||||
cf->cmd_type = NGX_MUNINN_CONF;
|
||||
return ngx_conf_parse(cf, NULL);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue