<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><font color="#333333"><span style="line-height: 24px;">You're right. It still can hang. I have another question:</span></font><div><font color="#333333"><span style="line-height: 24px;"><br></span></font></div><div><font color="#333333"><span style="line-height: 24px;">What's the meaning for "</span></font><span style="white-space: pre-wrap; line-height: 1.7;">c->sent - sent >= limit - (off_t) (2 * ngx_pagesize))"?</span></div><div><span style="white-space: pre-wrap;"><br></span></div><div><span style="white-space: pre-wrap;">I don't understand it. Why "2 * ngx_pagesize"? Can you help to explain the logic?</span></div><div><span style="white-space: pre-wrap;"><br></span></div><div><span style="white-space: pre-wrap;">Thanks.<br></span><br><br><br><div></div><div id="divNeteaseMailCard"></div><br><pre><br>At 2014-06-26 02:12:33,"Maxim Dounin" <mdounin@mdounin.ru> wrote:
>Hello!
>
>On Wed, Jun 25, 2014 at 10:00:35PM +0800, flygoast wrote:
>
>> At here:
>> in ngx_http_write_filter():
>>
>>
>> if (limit
>> && c->write->ready
>> && c->sent - sent >= limit - (off_t) (2 * ngx_pagesize))
>> {
>> c->write->delayed = 1;
>> ngx_add_timer(c->write, 1);
>> }
>>
>>
>> limit's value from clcf->sendfile_max_chunk. In my nginx.conf, I set "sendfile_max_chunk 8k;". I attached a debug log for this situation in last mail.
>
>Well, so the problem happens with sendfile_max_chunk set lower
>than proxy_buffer_size. While I don't think that
>sendfile_max_chunk 8k is practical, it probably worth fixing.
>
>I don't think that suggested patch is right
>though - it will not prevent infinite stall of transfering a big
>enough data chunk, as timer set by write filter will be removed.
>
>--
>Maxim Dounin
>http://nginx.org/
>
>_______________________________________________
>nginx-devel mailing list
>nginx-devel@nginx.org
>http://mailman.nginx.org/mailman/listinfo/nginx-devel
</pre></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>