diff options
| author | Maxim Dounin <mdounin@mdounin.ru> | 2012-05-11 13:33:06 +0000 |
|---|---|---|
| committer | Maxim Dounin <mdounin@mdounin.ru> | 2012-05-11 13:33:06 +0000 |
| commit | 0e3b423dc6c6653d600f4bf1687f0653be04a830 (patch) | |
| tree | 3b9f1e9cae0b9d73489bb1e046f6999dac1e445c /src/os/win32/ngx_errno.h | |
| parent | 74d939974d430a2c2e71b0134114d2a7b04dcc20 (diff) | |
| download | nginx-0e3b423dc6c6653d600f4bf1687f0653be04a830.tar.gz nginx-0e3b423dc6c6653d600f4bf1687f0653be04a830.tar.bz2 | |
Accept moderation in case of 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 'src/os/win32/ngx_errno.h')
| -rw-r--r-- | src/os/win32/ngx_errno.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/os/win32/ngx_errno.h b/src/os/win32/ngx_errno.h index 91b50db8c..5b11a65b0 100644 --- a/src/os/win32/ngx_errno.h +++ b/src/os/win32/ngx_errno.h @@ -54,6 +54,8 @@ typedef DWORD ngx_err_t; #define NGX_EALREADY WSAEALREADY #define NGX_EINVAL WSAEINVAL +#define NGX_EMFILE WSAEMFILE +#define NGX_ENFILE WSAEMFILE u_char *ngx_strerror(ngx_err_t err, u_char *errstr, size_t size); |
