nginx/src
Maxim Dounin 931ce7f02a Fixed timeouts with threaded sendfile() and subrequests.
If a write event happens after sendfile() but before we've got the
sendfile results in the main thread, this write event will be ignored.
And if no more events will happen, the connection will hang.

Removing the events works in the simple cases, but not always, as
in some cases events are added back by an unrelated code.  E.g.,
the upstream module adds write event in the ngx_http_upstream_init()
to track client aborts.

Fix is to use wev->complete instead.  It is now set to 0 before
a sendfile() task is posted, and it is set to 1 once a write event
happens.  If on completion of the sendfile() task wev->complete is 1,
we know that an event happened while we were executing sendfile(), and
the socket is still ready for writing even if sendfile() did not sent
all the data or returned EAGAIN.
2016-03-18 05:04:45 +03:00
..
core Fixed compilation with -Wmissing-prototypes. 2016-03-14 19:23:23 +03:00
event Fixed timeouts with threaded sendfile() and subrequests. 2016-03-18 05:04:45 +03:00
http Style. 2016-03-16 14:44:41 +03:00
mail Dynamic modules: changed ngx_modules to cycle->modules. 2016-02-04 18:30:21 +03:00
misc Style: fix typo. 2014-07-08 03:03:14 -07:00
mysql Copyright updated. 2012-01-18 15:07:43 +00:00
os Fixed timeouts with threaded sendfile() and subrequests. 2016-03-18 05:04:45 +03:00
stream Stream: post first read events from client and upstream. 2016-03-15 15:55:23 +03:00