details:   http://hg.nginx.org/nginx/rev/3b9c6b91d988
branches:  
changeset: 6431:3b9c6b91d988
user:      Valentin Bartenev <[email protected]>
date:      Mon Mar 14 22:42:35 2016 +0300
description:
Fixed handling of EAGAIN with sendfile in threads.

diffstat:

 src/os/unix/ngx_linux_sendfile_chain.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r 33aef5cd3d43 -r 3b9c6b91d988 src/os/unix/ngx_linux_sendfile_chain.c
--- a/src/os/unix/ngx_linux_sendfile_chain.c    Tue Mar 15 00:04:04 2016 +0300
+++ b/src/os/unix/ngx_linux_sendfile_chain.c    Mon Mar 14 22:42:35 2016 +0300
@@ -343,7 +343,12 @@ ngx_linux_sendfile_thread(ngx_connection
     if (task->event.complete) {
         task->event.complete = 0;
 
-        if (ctx->err && ctx->err != NGX_EAGAIN) {
+        if (ctx->err == NGX_EAGAIN) {
+            *sent = 0;
+            return NGX_AGAIN;
+        }
+
+        if (ctx->err) {
             wev->error = 1;
             ngx_connection_error(c, ctx->err, "sendfile() failed");
             return NGX_ERROR;

_______________________________________________
nginx-devel mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Reply via email to