Nginx : The I/O functions with glue code may be called before ngx_max_sockets is initialized, fix this error.

This commit is contained in:
chenwei 2017-12-14 15:07:30 +08:00
parent df18ef7de7
commit 2b31b4e34c
1 changed files with 4 additions and 0 deletions

View File

@ -152,6 +152,10 @@ static inline int restore_fstack_fd(int sockfd) {
/* Tell whether a 'sockfd' belongs to fstack. */ /* Tell whether a 'sockfd' belongs to fstack. */
static inline int is_fstack_fd(int sockfd) { static inline int is_fstack_fd(int sockfd) {
if (unlikely(inited == 0)) {
return 0;
}
return sockfd >= ngx_max_sockets; return sockfd >= ngx_max_sockets;
} }