nginx http 处理流程
2017-09-22 14:57:05 0 举报
AI智能生成
nginx是如何从事件框架中介入处理http的,处理http请求的流程/过程
作者其他创作
大纲/内容
epoll_wait
rev->handler(rev);
ngx_event_accept
ls->handler(c);
ngx_http_init_connection
rev->handler = ngx_http_wait_request_handler;
ngx_add_timer(rev, c->listening->post_accept_timeout);
ngx_handle_read_event(rev, 0)
ngx_add_event(rev, NGX_READ_EVENT, NGX_CLEAR_EVENT)
goto
ngx_epoll_process_events
ngx_http_wait_request_handler
n = c->recv(c, b->last, size)
c->data = ngx_http_create_request(c);
rev->handler = ngx_http_process_request_line;
ngx_http_process_request_line(rev);
n = ngx_http_read_request_header(r);
rc = ngx_http_parse_request_line(r, r->header_in);
ngx_http_process_request_uri
rev->handler = ngx_http_process_request_headers;
ngx_http_process_request_headers(rev);
loop
ngx_http_read_request_header
ngx_http_parse_header_line
hh = ngx_hash_find(&cmcf->headers_in_hash, h->hash,
h->lowcase_key, h->key.len);
hh->handler(r, h, hh->offset)
ngx_http_process_request_header
ngx_http_process_request
ngx_http_handler
r->write_event_handler = ngx_http_core_run_phases;
ngx_http_core_run_phases(r);
loop
ngx_http_run_posted_requests
goto
ngx_epoll_process_events
0 条评论
下一页