Skip to content

Commit

Permalink
Fixed handling of EAGAIN with sendfile in threads.
Browse files Browse the repository at this point in the history
  • Loading branch information
VBart committed Mar 14, 2016
1 parent 2b4a62c commit b3c1abd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/os/unix/ngx_linux_sendfile_chain.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,12 @@ ngx_linux_sendfile_thread(ngx_connection_t *c, ngx_buf_t *file, size_t size,
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;
Expand Down

0 comments on commit b3c1abd

Please sign in to comment.