nginx根据Url发送文件解析

(gdb) bt
#0  ngx_http_run_posted_requests (c=0x78c2c0e0) at src/http/ngx_http_request.c:2211
#1  0x0808f8f3 in ngx_http_process_request (r=0x8873e38) at src/http/ngx_http_request.c:1913
#2  0x0808e87c in ngx_http_process_request_headers (rev=0x78bb3068) at src/http/ngx_http_request.c:1342
#3  0x0808de66 in ngx_http_process_request_line (rev=0x78bb3068) at src/http/ngx_http_request.c:1022
#4  0x08091a04 in ngx_http_keepalive_handler (rev=0x78bb3068) at src/http/ngx_http_request.c:3196
#5  0x0807f709 in ngx_epoll_process_events (cycle=0x886e5e8, timer=65000, flags=1) at src/event/modules/ngx_epoll_module.c:822
#6  0x0807368b in ngx_process_events_and_timers (cycle=0x886e5e8) at src/event/ngx_event.c:242
#7  0x0807da01 in ngx_worker_process_cycle (cycle=0x886e5e8, data=0x0) at src/os/unix/ngx_process_cycle.c:753
#8  0x0807af4b in ngx_spawn_process (cycle=0x886e5e8, proc=0x807d93e <ngx_worker_process_cycle>, data=0x0, name=0x80fc3cf "worker process", 
    respawn=-3) at src/os/unix/ngx_process.c:198
#9  0x0807cd08 in ngx_start_worker_processes (cycle=0x886e5e8, n=1, type=-3) at src/os/unix/ngx_process_cycle.c:358
#10 0x0807c56e in ngx_master_process_cycle (cycle=0x886e5e8) at src/os/unix/ngx_process_cycle.c:130
#11 0x08051626 in main (argc=1, argv=0xbff35874) at src/core/nginx.c:367

追踪之后处理流程如上,观察下向浏览器是怎么返回所请求的文件的

<pre name="code" class="cpp">void
ngx_http_run_posted_requests(ngx_connection_t *c)
{
    ngx_http_request_t         *r;
    ngx_http_posted_request_t  *pr;

    for ( ;; ) {

        if (c->destroyed) {
            return;
        }

        r = c->data;
        pr = r->main->posted_requests;

        if (pr == NULL) {
            return;
        }

        r->main->posted_requests = pr->next;

        r = pr->request;

        ngx_http_set_log_request(c->log, r);

        ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
                       "http posted request: \"%V?%V\"", &r->uri, &r->args);

        r->write_event_handler(r);
    }
}


 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

悟世者

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值