Thanks .<br><br>This is patch:<br><br>Index: src/http/ngx_http_request_body.c<br>===================================================================<br>--- src/http/ngx_http_request_body.c    (revision 4146)<br>+++ src/http/ngx_http_request_body.c    (working copy)<br>

@@ -476,10 +476,6 @@<br> <br>     r->read_event_handler = ngx_http_discarded_request_body_handler;<br> <br>-    if (ngx_handle_read_event(rev, 0) != NGX_OK) {<br>-        return NGX_HTTP_INTERNAL_SERVER_ERROR;<br>-    }<br>

-<br>     if (ngx_http_read_discarded_request_body(r) == NGX_OK) {<br>         r->lingering_close = 0;<br> <br>@@ -488,6 +484,10 @@<br>         r->discard_body = 1;<br>     }<br> <br>+    if (ngx_handle_read_event(rev, 0) != NGX_OK) {<br>

+        return NGX_HTTP_INTERNAL_SERVER_ERROR;<br>+    }<br>+<br>     return NGX_OK;<br> }<br><br><br><div class="gmail_quote">On Mon, Sep 26, 2011 at 11:08 PM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello!<br>
<div class="im"><br>
On Mon, Sep 26, 2011 at 10:42:20PM +0800, Simon Liu wrote:<br>
<br>
> Hi all.<br>
><br>
> My nginx version is svn trunk.<br>
><br>
> Nginx will call ngx_handle_read_event, and then<br>
> call ngx_http_read_discarded_request_body In ngx_http_discard_request_body .<br>
>  So this will cause client's body read  incomplete data , because<br>
> ngx_handle_read_event<br>
> may delete read event when use level event.<br>
><br>
> ngx_handle_read_event:<br>
><br>
> else if (ngx_event_flags & NGX_USE_LEVEL_EVENT) {<br>
><br>
>         /* select, poll, /dev/poll */<br>
> .................................................................<br>
><br>
>         if (rev->active && (rev->ready || (flags & NGX_CLOSE_EVENT))) {<br>
>             if (ngx_del_event(rev, NGX_READ_EVENT, NGX_LEVEL_EVENT | flags)<br>
>                 == NGX_ERROR)<br>
>             {<br>
>                 return NGX_ERROR;<br>
>             }<br>
><br>
>             return NGX_OK;<br>
>         }<br>
><br>
><br>
> ngx_http_discard_request_body:<br>
><br>
>     r->read_event_handler = ngx_http_discarded_request_body_handler;<br>
><br>
>     if (ngx_handle_read_event(rev, 0) != NGX_OK) {<br>
>         return NGX_HTTP_INTERNAL_SERVER_ERROR;<br>
>     }<br>
><br>
>     if (ngx_http_read_discarded_request_body(r) == NGX_OK) {<br>
>         r->lingering_close = 0;<br>
><br>
><br>
> thanks!<br>
<br>
</div>Ack, ngx_handle_read_event() should be after<br>
ngx_http_read_discarded_request_body() call, like it's done in<br>
ngx_http_discarded_request_body_handler().<br>
<br>
Care to provide patch?<br>
<br>
Maxim Dounin<br>
<br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
</blockquote></div><br><br><br>