WIP: request and connection machine

Just need a simple request logging phase to wrap this up

Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2026-05-04 20:29:35 +00:00
parent 19fafc6a8c
commit 0e2621a7d2
12 changed files with 456 additions and 4254 deletions

55
muninn_core.c Normal file
View 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);
}