summaryrefslogtreecommitdiffhomepage
path: root/src/os/unix/ngx_errno.h
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2012-06-04 11:10:36 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2012-06-04 11:10:36 +0000
commit9732c655154b182497fb47fa47fbba69ffd25897 (patch)
tree2539b5c4b8cb248d9212579cc511a218f44fd929 /src/os/unix/ngx_errno.h
parent69d94a9c6deae87f75e4bce4fe12b92a6a0e2a27 (diff)
downloadnginx-9732c655154b182497fb47fa47fbba69ffd25897.tar.gz
nginx-9732c655154b182497fb47fa47fbba69ffd25897.tar.bz2
Merge of r4619: accept moderation on EMFILE/ENFILE.
In case of EMFILE/ENFILE returned from accept() we disable accept events, and (in case of no accept mutex used) arm timer to re-enable them later. With accept mutex we just drop it, and rely on normal accept mutex handling to re-enable accept events once it's acquired again. As we now handle errors in question, logging level was changed to "crit" (instead of "alert" used for unknown errors). Note: the code might call ngx_enable_accept_events() multiple times if there are many listen sockets. The ngx_enable_accept_events() function was modified to check if connection is already active (via c->read->active) and skip it then, thus making multiple calls safe.
Diffstat (limited to '')
-rw-r--r--src/os/unix/ngx_errno.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/os/unix/ngx_errno.h b/src/os/unix/ngx_errno.h
index 78af40bfe..2912dea04 100644
--- a/src/os/unix/ngx_errno.h
+++ b/src/os/unix/ngx_errno.h
@@ -29,6 +29,8 @@ typedef int ngx_err_t;
#define NGX_ENOTDIR ENOTDIR
#define NGX_EISDIR EISDIR
#define NGX_EINVAL EINVAL
+#define NGX_ENFILE ENFILE
+#define NGX_EMFILE EMFILE
#define NGX_ENOSPC ENOSPC
#define NGX_EPIPE EPIPE
#define NGX_EINPROGRESS EINPROGRESS