Mercurial > hg > nginx
annotate auto/lib/perl/make @ 8018:5119c8150478
Fixed runtime handling of systems without EPOLLRDHUP support.
In 7583:efd71d49bde0 (nginx 1.17.5) along with introduction of the
ioctl(FIONREAD) support proper handling of systems without EPOLLRDHUP
support in the kernel (but with EPOLLRDHUP in headers) was broken.
Before the change, rev->available was never set to 0 unless
ngx_use_epoll_rdhup was also set (that is, runtime test for EPOLLRDHUP
introduced in 6536:f7849bfb6d21 succeeded). After the change,
rev->available might reach 0 on systems without runtime EPOLLRDHUP
support, stopping further reading in ngx_readv_chain() and ngx_unix_recv().
And, if EOF happened to be already reported along with the last event,
it is not reported again by epoll_wait(), leading to connection hangs
and timeouts on such systems.
This affects Linux kernels before 2.6.17 if nginx was compiled
with newer headers, and, more importantly, emulation layers, such as
DigitalOcean's App Platform's / gVisor's epoll emulation layer.
Fix is to explicitly check ngx_use_epoll_rdhup before the corresponding
rev->pending_eof tests in ngx_readv_chain() and ngx_unix_recv().
author | Marcus Ball <marcus.ball@live.com> |
---|---|
date | Mon, 30 May 2022 02:38:07 +0300 |
parents | 53ea5694d1cc |
children |
rev | line source |
---|---|
599 | 1 |
2 # Copyright (C) Igor Sysoev | |
4412 | 3 # Copyright (C) Nginx, Inc. |
599 | 4 |
5 | |
6 cat << END >> $NGX_MAKEFILE | |
7 | |
6419 | 8 $NGX_OBJS/src/http/modules/perl/ngx_http_perl_module.o: \\ |
9 $NGX_OBJS/$ngx_perl_module | |
10 | |
11 $NGX_OBJS/$ngx_perl_module: \\ | |
5143
6dd4875eb526
Configure: improved layout of the generated makefile.
Ruslan Ermilov <ru@nginx.com>
parents:
5070
diff
changeset
|
12 \$(CORE_DEPS) \$(HTTP_DEPS) \\ |
6dd4875eb526
Configure: improved layout of the generated makefile.
Ruslan Ermilov <ru@nginx.com>
parents:
5070
diff
changeset
|
13 src/http/modules/perl/ngx_http_perl_module.h \\ |
599 | 14 $NGX_OBJS/src/http/modules/perl/Makefile |
4841
95ce3172493e
Configure: fixed make macros to use parentheses instead of braces.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4740
diff
changeset
|
15 cd $NGX_OBJS/src/http/modules/perl && \$(MAKE) |
599 | 16 |
740
5187a63d9fca
force perl modules reinstallation after rebuilding
Igor Sysoev <igor@sysoev.ru>
parents:
681
diff
changeset
|
17 rm -rf $NGX_OBJS/install_perl |
5187a63d9fca
force perl modules reinstallation after rebuilding
Igor Sysoev <igor@sysoev.ru>
parents:
681
diff
changeset
|
18 |
599 | 19 |
5143
6dd4875eb526
Configure: improved layout of the generated makefile.
Ruslan Ermilov <ru@nginx.com>
parents:
5070
diff
changeset
|
20 $NGX_OBJS/src/http/modules/perl/Makefile: \\ |
5265
9f17e765a21e
Configure: perl Makefile rebuild after configure.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5180
diff
changeset
|
21 $NGX_AUTO_CONFIG_H \\ |
5146
f45b83d20cfb
Simplified nginx version maintenance.
Ruslan Ermilov <ru@nginx.com>
parents:
5145
diff
changeset
|
22 src/core/nginx.h \\ |
5143
6dd4875eb526
Configure: improved layout of the generated makefile.
Ruslan Ermilov <ru@nginx.com>
parents:
5070
diff
changeset
|
23 src/http/modules/perl/Makefile.PL \\ |
5144
273754fad787
Configure: improved make dependencies for perl module.
Ruslan Ermilov <ru@nginx.com>
parents:
5143
diff
changeset
|
24 src/http/modules/perl/nginx.pm \\ |
273754fad787
Configure: improved make dependencies for perl module.
Ruslan Ermilov <ru@nginx.com>
parents:
5143
diff
changeset
|
25 src/http/modules/perl/nginx.xs \\ |
273754fad787
Configure: improved make dependencies for perl module.
Ruslan Ermilov <ru@nginx.com>
parents:
5143
diff
changeset
|
26 src/http/modules/perl/typemap |
6848
53ea5694d1cc
Configure: detect nginx version for nginx.pm at make time.
Ruslan Ermilov <ru@nginx.com>
parents:
6700
diff
changeset
|
27 grep 'define NGINX_VERSION' src/core/nginx.h \\ |
53ea5694d1cc
Configure: detect nginx version for nginx.pm at make time.
Ruslan Ermilov <ru@nginx.com>
parents:
6700
diff
changeset
|
28 | sed -e 's/^.*"\(.*\)".*/\1/' > \\ |
53ea5694d1cc
Configure: detect nginx version for nginx.pm at make time.
Ruslan Ermilov <ru@nginx.com>
parents:
6700
diff
changeset
|
29 $NGX_OBJS/src/http/modules/perl/version |
53ea5694d1cc
Configure: detect nginx version for nginx.pm at make time.
Ruslan Ermilov <ru@nginx.com>
parents:
6700
diff
changeset
|
30 sed "s/%%VERSION%%/\`cat $NGX_OBJS/src/http/modules/perl/version\`/" \\ |
53ea5694d1cc
Configure: detect nginx version for nginx.pm at make time.
Ruslan Ermilov <ru@nginx.com>
parents:
6700
diff
changeset
|
31 src/http/modules/perl/nginx.pm > \\ |
5146
f45b83d20cfb
Simplified nginx version maintenance.
Ruslan Ermilov <ru@nginx.com>
parents:
5145
diff
changeset
|
32 $NGX_OBJS/src/http/modules/perl/nginx.pm |
f45b83d20cfb
Simplified nginx version maintenance.
Ruslan Ermilov <ru@nginx.com>
parents:
5145
diff
changeset
|
33 cp -p src/http/modules/perl/nginx.xs $NGX_OBJS/src/http/modules/perl/ |
599 | 34 cp -p src/http/modules/perl/typemap $NGX_OBJS/src/http/modules/perl/ |
35 cp -p src/http/modules/perl/Makefile.PL $NGX_OBJS/src/http/modules/perl/ | |
36 | |
5143
6dd4875eb526
Configure: improved layout of the generated makefile.
Ruslan Ermilov <ru@nginx.com>
parents:
5070
diff
changeset
|
37 cd $NGX_OBJS/src/http/modules/perl \\ |
6dd4875eb526
Configure: improved layout of the generated makefile.
Ruslan Ermilov <ru@nginx.com>
parents:
5070
diff
changeset
|
38 && NGX_PM_CFLAGS="\$(NGX_PM_CFLAGS) -g $NGX_CC_OPT" \\ |
6700
0d2956dfc4e6
Perl: pass additional linker options to perl module.
Konstantin Pavlov <thresh@nginx.com>
parents:
6419
diff
changeset
|
39 NGX_PM_LDFLAGS="$NGX_LD_OPT \$(NGX_PM_LDFLAGS)" \\ |
5180
2db6bdcaedc0
Configure: fixed perl Makefile generation (ticket #334).
Maxim Dounin <mdounin@mdounin.ru>
parents:
5168
diff
changeset
|
40 NGX_INCS="$CORE_INCS $NGX_OBJS $HTTP_INCS" \\ |
5168
482fda984556
Configure: fixed nginx.so rebuild (broken by r5145).
Maxim Dounin <mdounin@mdounin.ru>
parents:
5146
diff
changeset
|
41 NGX_DEPS="\$(CORE_DEPS) \$(HTTP_DEPS)" \\ |
5143
6dd4875eb526
Configure: improved layout of the generated makefile.
Ruslan Ermilov <ru@nginx.com>
parents:
5070
diff
changeset
|
42 $NGX_PERL Makefile.PL \\ |
6dd4875eb526
Configure: improved layout of the generated makefile.
Ruslan Ermilov <ru@nginx.com>
parents:
5070
diff
changeset
|
43 LIB=$NGX_PERL_MODULES \\ |
950
9581fba9ea12
fix for nginx.pm default installation
Igor Sysoev <igor@sysoev.ru>
parents:
948
diff
changeset
|
44 INSTALLSITEMAN3DIR=$NGX_PERL_MODULES_MAN |
599 | 45 |
46 END |