summaryrefslogtreecommitdiffhomepage
path: root/src/event/ngx_event.h
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2013-07-12 14:51:07 +0400
committerValentin Bartenev <vbart@nginx.com>2013-07-12 14:51:07 +0400
commit182a05b9d5b4321be89aa25ade89e41d00f0b4f7 (patch)
tree6732cf547663b6f5d0ac6154a27876fc3771ca91 /src/event/ngx_event.h
parent0f0502064dda4e702b4f379ee2af4bbddcb93214 (diff)
downloadnginx-182a05b9d5b4321be89aa25ade89e41d00f0b4f7.tar.gz
nginx-182a05b9d5b4321be89aa25ade89e41d00f0b4f7.tar.bz2
Events: support for EPOLLRDHUP (ticket #320).
Since Linux 2.6.17, epoll is able to report about peer half-closed connection using special EPOLLRDHUP flag on a read event.
Diffstat (limited to 'src/event/ngx_event.h')
-rw-r--r--src/event/ngx_event.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/event/ngx_event.h b/src/event/ngx_event.h
index 122b538a7..530c9486c 100644
--- a/src/event/ngx_event.h
+++ b/src/event/ngx_event.h
@@ -71,7 +71,7 @@ struct ngx_event_s {
unsigned deferred_accept:1;
- /* the pending eof reported by kqueue or in aio chain operation */
+ /* the pending eof reported by kqueue, epoll or in aio chain operation */
unsigned pending_eof:1;
#if !(NGX_THREADS)
@@ -349,6 +349,11 @@ extern ngx_event_actions_t ngx_event_actions;
#define NGX_VNODE_EVENT 0
+#if (NGX_HAVE_EPOLL) && !(NGX_HAVE_EPOLLRDHUP)
+#define EPOLLRDHUP 0
+#endif
+
+
#if (NGX_HAVE_KQUEUE)
#define NGX_READ_EVENT EVFILT_READ
@@ -392,7 +397,7 @@ extern ngx_event_actions_t ngx_event_actions;
#elif (NGX_HAVE_EPOLL)
-#define NGX_READ_EVENT EPOLLIN
+#define NGX_READ_EVENT (EPOLLIN|EPOLLRDHUP)
#define NGX_WRITE_EVENT EPOLLOUT
#define NGX_LEVEL_EVENT 0