ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log,0,"http wait request handler");//连接超时if(rev->timedout) {//如果tcp连接建立后,等了client_header_timeout秒一直没有收到客户端的数据包过来,则关闭连接ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,"client timed out"); ngx_http_close_...
在ngx_http_upstream_connect处理完后,这个阶段就会结束了。我们会看到,相关调用会一层层结束,上图中红色虚箭头是回溯方向,最终会回到ngx_http_wait_request_handler调用,这个调用是客户端触发了可读事件导致的 rev->handler = ngx_http_wait_request_handler; 到这里,我们再梳理下,第一次触发epoll,是客户端连接到...
ngx_command_t *cmd,void*conf)//这里的cf是从ngx_conf_handler里面的if (cmd->type & NGX_DIRECT_CONF)判断里面确定了该cf为{//图形化参考:深入理解NGINX中的图9-2 图10-1 图4-2,结合图看,并可以配合http://tech.uc.cn
static void ngx_http_wait_request_handler(ngx_event_t *ev); static void ngx_http_process_request_line(ngx_event_t *rev); static void ngx_http_process_request_headers(ngx_event_t *rev); static ssize_t ngx_http_read_request_header(ngx_http_request_t *r);...
= ngx_http_wait_request_handler; c->write->handler = ngx_http_empty_handler; ......
目录一、HTTP Request解析流程图二、源码分析1. 等待read事件ngx_http_wait_request_handler2. 处理头部请求行ngx_http_process_request_line3. 处理HTTP协议的header部分ngx_http_process_request_headers4. 处理request信息ngx_http_process_request5. 核
/* 标志位,为1表示这个事件超时,用以提示handler做超时处理,它与timer_set都用了定时器 * ... if (wev->timedout) { wev->timedout = 0; ngx_http_perl_handle_request(r); return; } ... */ unsigned timer_set:1; /* 标志位,为1表示这个事件存在于定时器中 ...
ngx_http_lua_balancer_peer_data_t;typedef ngx_int_t (*ngx_http_lua_main_conf_handler_pt)(ngx_log_t *log, ngx_http_lua_main_conf_t *lmcf, lua_State *L);typedef ngx_int_t (*ngx_http_lua_srv_conf_handler_pt)(ngx_http_request_t *r, ...
"", "ping_request", "ping_response", }; return evt < sizeof(evts) / sizeof(evts[0]) ? evts[evt] : "?"; } #endif void ngx_rtmp_cycle(ngx_rtmp_session_t *s) { ngx_connection_t *c; c = s->connection; c->read->handler = ngx_rtmp_recv; ...
extern ngx_rtmp_live_proc_handler_t *ngx_rtmp_live_proc_handlers [NGX_RTMP_PROTOCOL_HTTP + 1]; extern ngx_module_t ngx_http_flv_live_module; static ngx_command_t ngx_rtmp_live_commands[] = { { ngx_string("live"), NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX...