From 615d55884376040fc2b42d9f47f981cd700b384a Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Sat, 13 Jul 2013 03:24:30 +0400 Subject: Events: honor NGX_USE_GREEDY_EVENT when kqueue support is enabled. Currently this flag is needed for epoll and rtsig, and though these methods usually present on different platforms than kqueue, nginx can be compiled to support all of them. --- src/os/unix/ngx_readv_chain.c | 2 +- src/os/unix/ngx_recv.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/os/unix') diff --git a/src/os/unix/ngx_readv_chain.c b/src/os/unix/ngx_readv_chain.c index 7b6badfa8..c2c21b407 100644 --- a/src/os/unix/ngx_readv_chain.c +++ b/src/os/unix/ngx_readv_chain.c @@ -136,7 +136,7 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain) return n; } - if (n < size) { + if (n < size && !(ngx_event_flags & NGX_USE_GREEDY_EVENT)) { rev->ready = 0; } diff --git a/src/os/unix/ngx_recv.c b/src/os/unix/ngx_recv.c index 6a4a09966..1640cdb27 100644 --- a/src/os/unix/ngx_recv.c +++ b/src/os/unix/ngx_recv.c @@ -87,7 +87,9 @@ ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size) return n; } - if ((size_t) n < size) { + if ((size_t) n < size + && !(ngx_event_flags & NGX_USE_GREEDY_EVENT)) + { rev->ready = 0; } -- cgit