From 2b31b4e34c8df07c5675d01a2a38b36e4ce6a0d1 Mon Sep 17 00:00:00 2001 From: chenwei Date: Thu, 14 Dec 2017 15:07:30 +0800 Subject: [PATCH] Nginx : The I/O functions with glue code may be called before ngx_max_sockets is initialized, fix this error. --- app/nginx-1.11.10/src/event/modules/ngx_ff_module.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/nginx-1.11.10/src/event/modules/ngx_ff_module.c b/app/nginx-1.11.10/src/event/modules/ngx_ff_module.c index c584edd79..0d37baff5 100644 --- a/app/nginx-1.11.10/src/event/modules/ngx_ff_module.c +++ b/app/nginx-1.11.10/src/event/modules/ngx_ff_module.c @@ -152,6 +152,10 @@ static inline int restore_fstack_fd(int sockfd) { /* Tell whether a 'sockfd' belongs to fstack. */ static inline int is_fstack_fd(int sockfd) { + if (unlikely(inited == 0)) { + return 0; + } + return sockfd >= ngx_max_sockets; }