nginx_module_t
2016-08-22 15:16:31 5 举报
AI智能生成
nginx_module_t
作者其他创作
大纲/内容
0. ngx_core_module
ngx_core_module_ctx
"core"
ngx_core_module_create_conf
ngx_core_conf_t
ngx_core_module_init_conf
对于unset值设置为默认值
ngx_core_commands
daemon
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_FLAG
ngx_conf_set_flag_slot
daemon
master_process
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_FLAG
ngx_conf_set_flag_slot
master
timer_resolution
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1
ngx_conf_set_msec_slot
timer_resolution
pid
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1
ngx_conf_set_str_slot
pid
lock_file
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1
ngx_conf_set_str_slot
lock_file
worker_processes
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1
ngx_set_worker_processes
worker_processes
debug_points
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1
ngx_conf_set_enum_slot
debug_points
user
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE12
ngx_set_user
user
pw_uid
group
gr_gid
worker_priority
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1
ngx_set_priority
priority
worker_cpu_affinity
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_1MORE
ngx_set_cpu_affinity
cpu_affinity_n
cpu_affinity
worker_rlimit_nofile
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1
ngx_conf_set_num_slot
rlimit_nofile
worker_rlimit_core
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1
ngx_conf_set_off_slot
rlimit_core
working_directory
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1
ngx_conf_set_str_slot
working_directory
env
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1
ngx_load_module
用于加载动态库
NGX_CORE_MODULE
1. ngx_errlog_module
ngx_errlog_module_ctx
errlog
ngx_errlog_commands
error_log
NGX_MAIN_CONF|NGX_CONF_1MORE
ngx_error_log
cycle->new_log
NGX_CORE_MODULE
2. ngx_conf_module
ngx_conf_commands
include
NGX_ANY_CONF|NGX_CONF_TAKE1
ngx_conf_include
NGX_CONF_MODULE
3. ngx_events_module
ngx_events_module_ctx
events
ngx_event_init_conf
仅用于确认配置是否存在,若不存在则直接报错
ngx_events_commands
events
NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS
ngx_events_block
创建NGX_EVENT_MODULE配置信息
ngx_conf_parse
设置配置文件信息到内存
对NGX_EVENT_MODULE未配置信息默认值初始化
NGX_CORE_MODULE
4. ngx_event_core_module
ngx_event_core_module_ctx
event_core
ngx_event_core_create_conf
ngx_event_core_init_conf
ngx_event_core_commands
worker_connections
NGX_EVENT_CONF|NGX_CONF_TAKE1
ngx_event_connections
cycle->connection_n = ecf->connections
use
NGX_EVENT_CONF|NGX_CONF_TAKE1
ngx_event_use
ecf->use = cf->cycle->modules[m]->ctx_index;
multi_accept
NGX_EVENT_CONF|NGX_CONF_FLAG
ngx_conf_set_flag_slot
multi_accept
accept_mutex
NGX_EVENT_CONF|NGX_CONF_FLAG
ngx_conf_set_flag_slot
accept_mutex
accept_mutex_delay
NGX_EVENT_CONF|NGX_CONF_TAKE1
ngx_conf_set_msec_slot
accept_mutex_delay
debug_connection
NGX_EVENT_CONF|NGX_CONF_TAKE1
ngx_event_debug_connection
debug_connection
NGX_EVENT_MODULE
ngx_event_module_init
ngx_event_process_init
accept_mutex
初始化超时时间红黑树
epoll.actions.init()
设置定时器
cycle->files = ngx_calloc(sizeof(ngx_connection_t *) * cycle->files_n, cycle->log);
cycle->connections = ngx_alloc(sizeof(ngx_connection_t) * cycle->connection_n, cycle->log);
c[i].data = next;
c[i].read = &cycle->read_events[i];
c[i].write = &cycle->write_events[i];
c[i].fd = (ngx_socket_t) -1;
next = &c[i];
cycle->read_events = ngx_alloc(sizeof(ngx_event_t) * cycle->connection_n, cycle->log);
rev[i].closed = 1;
rev[i].instance = 1;
cycle->write_events = ngx_alloc(sizeof(ngx_event_t) * cycle->connection_n, cycle->log);
wev[i].closed = 1;
将listen和connection关联,并添加可读事件
5. ngx_epoll_module
ngx_epoll_module_ctx
epoll
ngx_epoll_create_conf
ngx_epoll_init_conf
ngx_event_actions_t
add
ngx_epoll_add_event
del
ngx_epoll_del_event
enable
ngx_epoll_add_event
disable
ngx_epoll_del_event
add_conn
ngx_epoll_add_connection
del_conn
ngx_epoll_del_connection
notify
ngx_epoll_notify/NULL
process_events
ngx_epoll_process_events
init
ngx_epoll_init
done
ngx_epoll_done
ngx_epoll_commands
epoll_events
NGX_EVENT_CONF|NGX_CONF_TAKE1
ngx_conf_set_num_slot
events
worker_aio_requests
NGX_EVENT_CONF|NGX_CONF_TAKE1
ngx_conf_set_num_slot
aio_requests
NGX_EVENT_MODULE
6. ngx_http_module
ngx_http_module_ctx
http
ngx_http_commands
http
NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS
ngx_http_block
配置所有NGX_HTTP_MODULE配置
create_main_conf
create_srv_conf
create_loc_conf
对所有NGX_HTTP_MODULE预处理
NGX_HTTP_MODULE
根据配置文件处理http{}模块
对所有NGX_HTTP_MODULE未初始化项进行初始化
其他处理,还没看
NGX_CORE_MODULE
7. ngx_http_core_module
ngx_http_core_module_ctx
ngx_http_core_preconfiguration
ngx_http_core_postconfiguration
ngx_http_core_create_main_conf
ngx_http_core_init_main_conf
ngx_http_core_create_srv_conf
ngx_http_core_merge_srv_conf
ngx_http_core_create_loc_conf
ngx_http_core_merge_loc_conf
ngx_http_core_commands
variables_hash_max_size
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1
main_conf
ngx_conf_set_num_slot
variables_hash_max_size
variables_hash_bucket_size
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1
main_conf
ngx_conf_set_num_slot
variables_hash_bucket_size
server_names_hash_max_size
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1
main_conf
ngx_conf_set_num_slot
variables_hash_bucket_size
server_names_hash_bucket_size
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1
main_conf
ngx_conf_set_num_slot
server_names_hash_bucket_size
server
NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS
ngx_http_core_server
NGX_HTTP_MODULE
ctx->配置项名称,及初始化配置内存
commands->将各个配置项信息配置到ctx对应信息中
0 条评论
下一页