#if defined nginx_version && nginx_version >= 8011 r->main->count++;#endif这句话中 r->main->count++;有什么作用?具体是如何实现的呢?求教,希望能举例说明,谢谢大家了 -- sp要查看更多选项,请访问 https://groups.google.com/groups/opt_out。
增加请求时候的引用计数,在释放资源(函数:ngx_http_finalize_request)时候使用。ngx_http_finalize_request 函数位于 src/http/ngx_http_request.c:1937。在好多模块里都会有这样的调用示例哦,比如:ngx_lua、drizzle-module等等。--smallfish http://chenxiaoyu.org 2013/3/7 maeleven <maxi...@tydtech.com> #if defined nginx_version && nginx_version >= 8011 r->main->count++;#endif这句话中 r->main->count++;有什么作用?具体是如何实现的呢?求教,希望能举例说明,谢谢大家了 -- sp要查看更多选项,请访问 https://groups.google.com/groups/opt_out。
那这种引用计数对于释放资源有 什么好处呢?可以提点一下吗?谢谢
发件人: openresty@googlegroups.com [mailto:openresty@googlegroups.com] 代表 smallfish 发送时间: 2013年3月7日 16:53 收件人: openresty@googlegroups.com 主题: Re: [openresty] 关于nginx 源码的问题:
增加请求时候的引用计数,在释放资源(函数:ngx_http_finalize_request)时候使用。
ngx_http_finalize_request 函数位于 src/http/ngx_http_request.c:1937。
在好多模块里都会有这样的调用示例哦,比如:ngx_lua、drizzle-module等等。
--
smallfish http://chenxiaoyu.org
2013/3/7 maeleven <maxi...@tydtech.com>
#if defined nginx_version && nginx_version >= 8011
r->main->count++;
#endif
这句话中 r->main->count++;有什么作用?具体是如何实现的呢?求教,希望能举例说明,谢谢大家了
-- -- --- 您收到此 --- 您收到此邮件是因为您订阅了 Google 网上论坛“openresty”中的主题。 要退订此主题,请访问 https://groups.google.com/d/topic/openresty/1ZdZRk7Ycc8/unsubscribe?hl=zh-CN。 要退订此论坛及其所有主题,请发送电子邮件到 openresty+unsubscribe@googlegroups.com。 要查看更多选项,请访问 https://groups.google.com/groups/opt_out。
哦,说错了不是释放资源。是在结束请求或者连接时候用。可以看到有很多类似这样的调用:ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT);--smallfish http://chenxiaoyu.org 2013/3/7 smallfish <small...@gmail.com> 增加请求时候的引用计数,在释放资源(函数:ngx_http_finalize_request)时候使用。ngx_http_finalize_request 函数位于 src/http/ngx_http_request.c:1937。在好多模块里都会有这样的调用示例哦,比如:ngx_lua、drizzle-module等等。--smallfish http://chenxiaoyu.org 2013/3/7 maeleven <maxi...@tydtech.com> #if defined nginx_version && nginx_version >= 8011 r->main->count++;#endif这句话中 r->main->count++;有什么作用?具体是如何实现的呢?求教,希望能举例说明,谢谢大家了 -- #xA0要查看更多选项,请访问 https://groups.google.com/groups/opt_out。 -- JinglongSoftware EngineerServer Platforms Team at Taobao maxiaotong 它是如何操作的呢?可以给简单介绍下吗? 发件人: openresty@googlegroups.com [mailto:openresty@googlegroups.com] 代表 smallfish 发送时间: 2013年3月7日 16:54 收件人: openresty@googlegroups.com 主题: Re: [openresty] 关于nginx 源码的问题: 哦,说错了不是释放资源。是在结束请求或者连接时候用。可以看到有很多类似这样的调用: ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT); -- smallfish http://chenxiaoyu.org 2013/3/7 smallfish <small...@gmail.com> 增加请求时候的引用计数,在释放资源(函数:ngx_http_finalize_request)时候使用。 ngx_http_finalize_request 函数位于 src/http/ngx_http_request.c:1937。 在好多模块里都会有这样的调用示例哦,比如:ngx_lua、drizzle-module等等。 -- smallfish http://chenxiaoyu.org 2013/3/7 maeleven <maxi...@tydtech.com> #if defined nginx_version && nginx_version >= 8011 r->main->count++; #endif 这句话中 r->main->count++;有什么作用?具体是如何实现的呢?求教,希望能举例说明,谢谢大家了 -- -- --- 您收到此 --- 您收到此邮件是因为您订阅了 Google 网上论坛“openresty”中的主题。 要退订此主题,请访问 https://groups.google.com/d/topic/openresty/1ZdZRk7Ycc8/unsubscribe?hl=zh-CN。 要退订此论坛及其所有主题,请发送电子邮件到 openresty+unsubscribe@googlegroups.com。 要查看更多选项,请访问 https://groups.google.com/groups/opt_out。 maxiaotong 嗯,了解了,我再去调查看看,十分感谢~ 发件人: openresty@googlegroups.com [mailto:openresty@googlegroups.com] 代表 pengqi 发送时间: 2013年3月7日 17:12 收件人: openresty 主题: Re: [openresty] 关于nginx 源码的问题: 恩,简单的说count就是请求的引用计数,某些情况一下需要hold住请求时就将其count加1。 理解它的话需要看一下请求的处理过程,ngx_http_core_run_phases->phase-handler->ngx_http_finalize_request->ngx_http_finalize_connection->ngx_http_close_request,一般在某个phase-handler如果需求hold住请求(比如需要等待某个事件发生),一般可以将count加1,并返回合适的返回值,进入ngx_http_finalize_request,然后会调用ngx_http_close_request,此函数会将count--,并检查如果count等于0则释放该请求及连接,如果大于0则说明该请求还为处理完,则直接返回,等到下一次事件处理。 2013/3/7 smallfish <small...@gmail.com> 哦,说错了不是释放资源。是在结束请求或者连接时候用。可以看到有很多类似这样的调用: ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT); -- smallfish http://chenxiaoyu.org 2013/3/7 smallfish <small...@gmail.com> 增加请求时候的引用计数,在释放资源(函数:ngx_http_finalize_request)时候使用。 ngx_http_finalize_request 函数位于 src/http/ngx_http_request.c:1937。 在好多模块里都会有这样的调用示例哦,比如:ngx_lua、drizzle-module等等。 -- smallfish http://chenxiaoyu.org 2013/3/7 maeleven <maxi...@tydtech.com> #if defined nginx_version && nginx_version >= 8011 r->main->count++; #endif 这句话中 r->main->count++;有什么作用?具体是如何实现的呢?求教,希望能举例说明,谢谢大家了 -- -- --- 您收到此 --- 您收到此 --- 您收到此邮件是因为您订阅了 Google 网上论坛“openresty”中的主题。 要退订此主题,请访问 https://groups.google.com/d/topic/openresty/1ZdZRk7Ycc8/unsubscribe?hl=zh-CN。 要退订此论坛及其所有主题,请发送电子邮件到 openresty+unsubscribe@googlegroups.com。 要查看更多选项,请访问 https://groups.google.com/groups/opt_out。 maxiaotong 谁能给我解释一下nginx 处理post请求的具体过程,最好是关键简单代码加解释的那种的,比如以upload模块或者其他模块代码为例。 谢谢 发件人: openresty@googlegroups.com [mailto:openresty@googlegroups.com] 代表 马晓童 发送时间: 2013年3月7日 18:07 收件人: openresty@googlegroups.com 主题: 答复: [openresty] 关于nginx 源码的问题: 嗯,了解了,我再去调查看看,十分感谢~ 发件人: openresty@googlegroups.com [mailto:openresty@googlegroups.com] 代表 pengqi 发送时间: 2013年3月7日 17:12 收件人: openresty 主题: Re: [openresty] 关于nginx 源码的问题: 恩,简单的说count就是请求的引用计数,某些情况一下需要hold住请求时就将其count加1。 理解它的话需要看一下请求的处理过程,ngx_http_core_run_phases->phase-handler->ngx_http_finalize_request->ngx_http_finalize_connection->ngx_http_close_request,一般在某个phase-handler如果需求hold住请求(比如需要等待某个事件发生),一般可以将count加1,并返回合适的返回值,进入ngx_http_finalize_request,然后会调用ngx_http_close_request,此函数会将count--,并检查如果count等于0则释放该请求及连接,如果大于0则说明该请求还为处理完,则直接返回,等到下一次事件处理。 2013/3/7 smallfish <small...@gmail.com> 哦,说错了不是释放资源。是在结束请求或者连接时候用。可以看到有很多类似这样的调用: ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT); -- smallfish http://chenxiaoyu.org 2013/3/7 smallfish <small...@gmail.com> 增加请求时候的引用计数,在释放资源(函数:ngx_http_finalize_request)时候使用。 ngx_http_finalize_request 函数位于 src/http/ngx_http_request.c:1937。 在好多模块里都会有这样的调用示例哦,比如:ngx_lua、drizzle-module等等。 -- smallfish http://chenxiaoyu.org 2013/3/7 maeleven <maxi...@tydtech.com> #if defined nginx_version && nginx_version >= 8011 r->main->count++; #endif 这句话中 r->main->count++;有什么作用?具体是如何实现的呢?求教,希望能举例说明,谢谢大家了 -- -- --- 您收到此 --- 您收到此 --- 您收到此 --- 您收到此邮件是因为您订阅了 Google 网上论坛的“openresty”论坛。 要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 openresty+unsubscribe@googlegroups.com。 要查看更多选项,请访问 https://groups.google.com/groups/opt_out。 fengmo.q hi,可以看一下我之前写的,nginx读取请求体 (http://tengine.taobao.org/book/chapter_12.html#id5) 在 2013年3月8日下午5:11,马晓童 <maxi...@tydtech.com>写道: 谁能给我解释一下nginx 处理post请求的具体过程,最好是关键简单代码加解释的那种的,比如以upload模块或者其他模块代码为例。 谢谢 发件人: openresty@googlegroups.com [mailto:openresty@googlegroups.com] 代表 马晓童 发送时间: 2013年3月7日 18:07 收件人: openresty@googlegroups.com 主题: 答复: [openresty] 关于nginx 源码的问题: 嗯,了解了,我再去调查看看,十分感谢~ 发件人: openresty@googlegroups.com [mailto:openresty@googlegroups.com] 代表 pengqi 发送时间: 2013年3月7日 17:12 收件人: openresty 主题: Re: [openresty] 关于nginx 源码的问题: 恩,简单的说count就是请求的引用计数,某些情况一下需要hold住请求时就将其count加1。 理解它的话需要看一下请求的处理过程,ngx_http_core_run_phases->phase-handler->ngx_http_finalize_request->ngx_http_finalize_connection->ngx_http_close_request,一般在某个phase-handler如果需求hold住请求(比如需要等待某个事件发生),一般可以将count加1,并返回合适的返回值,进入ngx_http_finalize_request,然后会调用ngx_http_close_request,此函数会将count--,并检查如果count等于0则释放该请求及连接,如果大于0则说明该请求还为处理完,则直接返回,等到下一次事件处理。 2013/3/7 smallfish <small...@gmail.com> 哦,说错了不是释放资源。是在结束请求或者连接时候用。可以看到有很多类似这样的调用: ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT); -- smallfish http://chenxiaoyu.org 2013/3/7 smallfish <small...@gmail.com> 增加请求时候的引用计数,在释放资源(函数:ngx_http_finalize_request)时候使用。 ngx_http_finalize_request 函数位于 src/http/ngx_http_request.c:1937。 在好多模块里都会有这样的调用示例哦,比如:ngx_lua、drizzle-module等等。 -- smallfish http://chenxiaoyu.org 2013/3/7 maeleven <maxi...@tydtech.com> #if defined nginx_version && nginx_version >= 8011 r->main->count++; #endif 这句话中 r->main->count++;有什么作用?具体是如何实现的呢?求教,希望能举例说明,谢谢大家了 -- -- --- 您收到此 --- 您收到此 --- 您收到此 --- https://groups.google.com/groups/opt_out。 -- JinglongSoftware EngineerServer Platforms Team at Taobao
增加请求时候的引用计数,在释放资源(函数:ngx_http_finalize_request)时候使用。ngx_http_finalize_request 函数位于 src/http/ngx_http_request.c:1937。在好多模块里都会有这样的调用示例哦,比如:ngx_lua、drizzle-module等等。--smallfish http://chenxiaoyu.org 2013/3/7 maeleven <maxi...@tydtech.com> #if defined nginx_version && nginx_version >= 8011 r->main->count++;#endif这句话中 r->main->count++;有什么作用?具体是如何实现的呢?求教,希望能举例说明,谢谢大家了 -- #xA0要查看更多选项,请访问 https://groups.google.com/groups/opt_out。 -- JinglongSoftware EngineerServer Platforms Team at Taobao
#if defined nginx_version && nginx_version >= 8011 r->main->count++;#endif这句话中 r->main->count++;有什么作用?具体是如何实现的呢?求教,希望能举例说明,谢谢大家了 -- #xA0要查看更多选项,请访问 https://groups.google.com/groups/opt_out。
它是如何操作的呢?可以给简单介绍下吗?
发件人: openresty@googlegroups.com [mailto:openresty@googlegroups.com] 代表 smallfish 发送时间: 2013年3月7日 16:54 收件人: openresty@googlegroups.com 主题: Re: [openresty] 关于nginx 源码的问题:
哦,说错了不是释放资源。是在结束请求或者连接时候用。可以看到有很多类似这样的调用:
ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT);
2013/3/7 smallfish <small...@gmail.com>
嗯,了解了,我再去调查看看,十分感谢~
发件人: openresty@googlegroups.com [mailto:openresty@googlegroups.com] 代表 pengqi 发送时间: 2013年3月7日 17:12 收件人: openresty 主题: Re: [openresty] 关于nginx 源码的问题:
恩,简单的说count就是请求的引用计数,某些情况一下需要hold住请求时就将其count加1。
理解它的话需要看一下请求的处理过程,ngx_http_core_run_phases->phase-handler->ngx_http_finalize_request->ngx_http_finalize_connection->ngx_http_close_request,一般在某个phase-handler如果需求hold住请求(比如需要等待某个事件发生),一般可以将count加1,并返回合适的返回值,进入ngx_http_finalize_request,然后会调用ngx_http_close_request,此函数会将count--,并检查如果count等于0则释放该请求及连接,如果大于0则说明该请求还为处理完,则直接返回,等到下一次事件处理。
-- -- --- 您收到此 --- 您收到此 --- 您收到此邮件是因为您订阅了 Google 网上论坛“openresty”中的主题。 要退订此主题,请访问 https://groups.google.com/d/topic/openresty/1ZdZRk7Ycc8/unsubscribe?hl=zh-CN。 要退订此论坛及其所有主题,请发送电子邮件到 openresty+unsubscribe@googlegroups.com。 要查看更多选项,请访问 https://groups.google.com/groups/opt_out。
谁能给我解释一下nginx 处理post请求的具体过程,最好是关键简单代码加解释的那种的,比如以upload模块或者其他模块代码为例。 谢谢
发件人: openresty@googlegroups.com [mailto:openresty@googlegroups.com] 代表 马晓童 发送时间: 2013年3月7日 18:07 收件人: openresty@googlegroups.com 主题: 答复: [openresty] 关于nginx 源码的问题:
-- -- --- 您收到此 --- 您收到此 --- 您收到此 --- 您收到此邮件是因为您订阅了 Google 网上论坛的“openresty”论坛。 要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 openresty+unsubscribe@googlegroups.com。 要查看更多选项,请访问 https://groups.google.com/groups/opt_out。
谁能给我解释一下nginx 处理post请求的具体过程,最好是关键简单代码加解释的那种的,比如以upload模块或者其他模块代码为例。 谢谢 发件人: openresty@googlegroups.com [mailto:openresty@googlegroups.com] 代表 马晓童 发送时间: 2013年3月7日 18:07 收件人: openresty@googlegroups.com 主题: 答复: [openresty] 关于nginx 源码的问题: 嗯,了解了,我再去调查看看,十分感谢~ 发件人: openresty@googlegroups.com [mailto:openresty@googlegroups.com] 代表 pengqi 发送时间: 2013年3月7日 17:12 收件人: openresty 主题: Re: [openresty] 关于nginx 源码的问题: 恩,简单的说count就是请求的引用计数,某些情况一下需要hold住请求时就将其count加1。 理解它的话需要看一下请求的处理过程,ngx_http_core_run_phases->phase-handler->ngx_http_finalize_request->ngx_http_finalize_connection->ngx_http_close_request,一般在某个phase-handler如果需求hold住请求(比如需要等待某个事件发生),一般可以将count加1,并返回合适的返回值,进入ngx_http_finalize_request,然后会调用ngx_http_close_request,此函数会将count--,并检查如果count等于0则释放该请求及连接,如果大于0则说明该请求还为处理完,则直接返回,等到下一次事件处理。 2013/3/7 smallfish <small...@gmail.com> 哦,说错了不是释放资源。是在结束请求或者连接时候用。可以看到有很多类似这样的调用: ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT); -- smallfish http://chenxiaoyu.org 2013/3/7 smallfish <small...@gmail.com> 增加请求时候的引用计数,在释放资源(函数:ngx_http_finalize_request)时候使用。 ngx_http_finalize_request 函数位于 src/http/ngx_http_request.c:1937。 在好多模块里都会有这样的调用示例哦,比如:ngx_lua、drizzle-module等等。 -- smallfish http://chenxiaoyu.org 2013/3/7 maeleven <maxi...@tydtech.com> #if defined nginx_version && nginx_version >= 8011 r->main->count++; #endif 这句话中 r->main->count++;有什么作用?具体是如何实现的呢?求教,希望能举例说明,谢谢大家了 -- -- --- 您收到此 --- 您收到此 --- 您收到此 --- https://groups.google.com/groups/opt_out。 -- JinglongSoftware EngineerServer Platforms Team at Taobao
-- -- --- 您收到此 --- 您收到此 --- 您收到此 --- https://groups.google.com/groups/opt_out。