内核提供的参数
八个回调方法
http模块初始化流程
(1)初始化所有Http模块的ngx_index序号
(2)分配解析Main级别配置项时存放http模块结构体指针的三个数组
(3)--》(5)依次调用上图中void左面括号中的方法
(6)调用所有 preconfiguration方法
(7)解析http{..}模块下所有main级别的配置项
(8)调用所有http模块的init_main_conf方法
(9)合并main 、srv、 loc级别下server、location相关的配置项
会调用merge_srv_conf merge_loc_conf 方法
(10)构造Location组成的静态二叉平衡查找树
(11)初始化可添加处理方法的7个http阶段的动态数组
(12)调用所有http模块的postconfiguration方法使之可以介入http阶段
(13)根据各http模块介入的处理方法构造出构造出 phase_engine handlers数组
(14)构造server虚拟主机构成的支持通配符的散列表
(15)构造监听端口与server间的关联关系,设置新连接事务的回调方法
后面都是 ngx_http_request_t *r
C语言中加入static后 后面的变量只能在本文件里面生效
高并发时用户态携程自动切换
实际上这个结果只有X-Second2 .因为上下文的关系
当if两次TRUE时会产生覆盖,因此if很容易出问题,不要使用连续的if主动产生内存断的错误
sigsegv意味着指针所对应的地址是无效地址,没有物理内存对应该地址。
postpone延迟
面向tcp协议