mirror of
https://github.com/nginx/nginx.git
synced 2024-12-03 04:39:00 +08:00
test event type to prevent errors
This commit is contained in:
parent
c340a2841b
commit
57ca2c8013
@ -147,6 +147,16 @@ ngx_select_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
if ((event == NGX_READ_EVENT && ev->write)
|
||||
|| (event == NGX_WRITE_EVENT && !ev->write))
|
||||
{
|
||||
ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
|
||||
"invalid select %s event fd:%d ev:%i",
|
||||
ev->write ? "write" : "read", c->fd, event);
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
|
||||
#if (NGX_WIN32)
|
||||
|
||||
if ((event == NGX_READ_EVENT) && (max_read >= FD_SETSIZE)
|
||||
|
Loading…
Reference in New Issue
Block a user