Mercurial > hg > nginx-quic
annotate auto/lib/perl/conf @ 8895:457afc332c67
Stream: don't flush empty buffers created for read errors.
When we generate the last_buf buffer for an UDP upstream recv error, it does
not contain any data from the wire. ngx_stream_write_filter attempts to forward
it anyways, which is incorrect (e.g., UDP upstream ECONNREFUSED will be
translated to an empty packet).
This happens because we mark the buffer as both 'flush' and 'last_buf', and
ngx_stream_write_filter has special handling for flush with certain types of
connections (see d127837c714f, 32b0ba4855a6). The flags are meant to be
mutually exclusive, so the fix is to ensure that flush and last_buf are not set
at the same time.
Reproduction:
stream {
upstream unreachable {
server 127.0.0.1:8880;
}
server {
listen 127.0.0.1:8998 udp;
proxy_pass unreachable;
}
}
1 0.000000000 127.0.0.1 → 127.0.0.1 UDP 47 45588 → 8998 Len=5
2 0.000166300 127.0.0.1 → 127.0.0.1 UDP 47 51149 → 8880 Len=5
3 0.000172600 127.0.0.1 → 127.0.0.1 ICMP 75 Destination unreachable (Port
unreachable)
4 0.000202400 127.0.0.1 → 127.0.0.1 UDP 42 8998 → 45588 Len=0
Fixes d127837c714f.
author | Aleksei Bavshin <a.bavshin@f5.com> |
---|---|
date | Mon, 23 May 2022 11:29:44 -0700 |
parents | 30b6f1ff192b |
children |
rev | line source |
---|---|
599 | 1 |
2 # Copyright (C) Igor Sysoev | |
4412 | 3 # Copyright (C) Nginx, Inc. |
599 | 4 |
5 | |
6 echo "checking for perl" | |
7 | |
8 | |
9 NGX_PERL_VER=`$NGX_PERL -v 2>&1 | grep '^This is perl' 2>&1 \ | |
10 | sed -e 's/^This is perl, \(.*\)/\1/'` | |
11 | |
12 if test -n "$NGX_PERL_VER"; then | |
13 echo " + perl version: $NGX_PERL_VER" | |
14 | |
6821
30b6f1ff192b
Perl: removed special environment handling for the perl module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6700
diff
changeset
|
15 if [ "`$NGX_PERL -e 'use 5.008006; print "OK"'`" != "OK" ]; then |
599 | 16 echo |
6821
30b6f1ff192b
Perl: removed special environment handling for the perl module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6700
diff
changeset
|
17 echo "$0: error: perl 5.8.6 or higher is required" |
599 | 18 echo |
19 | |
20 exit 1; | |
21 fi | |
22 | |
4866
fac1cc762969
Configure: additional test for ExtUtils::Embed perl module presence.
Andrey Belov <defan@nginx.com>
parents:
4412
diff
changeset
|
23 if [ "`$NGX_PERL -MExtUtils::Embed -e 'print "OK"'`" != "OK" ]; then |
fac1cc762969
Configure: additional test for ExtUtils::Embed perl module presence.
Andrey Belov <defan@nginx.com>
parents:
4412
diff
changeset
|
24 echo |
fac1cc762969
Configure: additional test for ExtUtils::Embed perl module presence.
Andrey Belov <defan@nginx.com>
parents:
4412
diff
changeset
|
25 echo "$0: error: perl module ExtUtils::Embed is required" |
fac1cc762969
Configure: additional test for ExtUtils::Embed perl module presence.
Andrey Belov <defan@nginx.com>
parents:
4412
diff
changeset
|
26 echo |
fac1cc762969
Configure: additional test for ExtUtils::Embed perl module presence.
Andrey Belov <defan@nginx.com>
parents:
4412
diff
changeset
|
27 |
fac1cc762969
Configure: additional test for ExtUtils::Embed perl module presence.
Andrey Belov <defan@nginx.com>
parents:
4412
diff
changeset
|
28 exit 1; |
fac1cc762969
Configure: additional test for ExtUtils::Embed perl module presence.
Andrey Belov <defan@nginx.com>
parents:
4412
diff
changeset
|
29 fi |
fac1cc762969
Configure: additional test for ExtUtils::Embed perl module presence.
Andrey Belov <defan@nginx.com>
parents:
4412
diff
changeset
|
30 |
6700
0d2956dfc4e6
Perl: pass additional linker options to perl module.
Konstantin Pavlov <thresh@nginx.com>
parents:
6419
diff
changeset
|
31 NGX_PM_CFLAGS=`$NGX_PERL -MExtUtils::Embed -e ccopts` |
0d2956dfc4e6
Perl: pass additional linker options to perl module.
Konstantin Pavlov <thresh@nginx.com>
parents:
6419
diff
changeset
|
32 NGX_PM_LDFLAGS=`$NGX_PERL -MConfig -e 'print $Config{lddlflags}'` |
0d2956dfc4e6
Perl: pass additional linker options to perl module.
Konstantin Pavlov <thresh@nginx.com>
parents:
6419
diff
changeset
|
33 |
681 | 34 NGX_PERL_CFLAGS="$CFLAGS `$NGX_PERL -MExtUtils::Embed -e ccopts`" |
35 | |
36 # gcc 4.1/4.2 warn about unused values in pTHX_ | |
37 NGX_PERL_CFLAGS=`echo $NGX_PERL_CFLAGS \ | |
38 | sed -e 's/-Wunused-value/-Wno-unused-value/'` | |
39 # icc8 warns 'declaration hides parameter "my_perl"' in ENTER and LEAVE | |
40 NGX_PERL_CFLAGS=`echo $NGX_PERL_CFLAGS \ | |
41 | sed -e 's/-wd171/-wd171 -wd1599/'` | |
42 | |
599 | 43 ngx_perl_ldopts=`$NGX_PERL -MExtUtils::Embed -e ldopts` |
44 | |
5145
f6777aef5b2f
Configure: fixed perl module make rules.
Ruslan Ermilov <ru@nginx.com>
parents:
4866
diff
changeset
|
45 ngx_perl_dlext=`$NGX_PERL -MConfig -e 'print $Config{dlext}'` |
5743
dde2ae4701e1
Configure: restored "nginx/" missed in 6e4bb1d6679d.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5739
diff
changeset
|
46 ngx_perl_libdir="src/http/modules/perl/blib/arch/auto" |
dde2ae4701e1
Configure: restored "nginx/" missed in 6e4bb1d6679d.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5739
diff
changeset
|
47 ngx_perl_module="$ngx_perl_libdir/nginx/nginx.$ngx_perl_dlext" |
5145
f6777aef5b2f
Configure: fixed perl module make rules.
Ruslan Ermilov <ru@nginx.com>
parents:
4866
diff
changeset
|
48 |
599 | 49 if $NGX_PERL -V:usemultiplicity | grep define > /dev/null; then |
50 have=NGX_HAVE_PERL_MULTIPLICITY . auto/have | |
51 echo " + perl interpreter multiplicity found" | |
52 fi | |
53 | |
872
1c4a5b3f9110
Axe several perl interpreter instances: they may be useful in currently
Igor Sysoev <igor@sysoev.ru>
parents:
681
diff
changeset
|
54 if $NGX_PERL -V:useithreads | grep undef > /dev/null; then |
599 | 55 # FreeBSD port wants to link with -pthread non-threaded perl |
56 ngx_perl_ldopts=`echo $ngx_perl_ldopts | sed 's/ -pthread//'` | |
57 fi | |
58 | |
5722
baf2816d556d
Configure: workaround for system perl on OS X (ticket #576).
Maxim Dounin <mdounin@mdounin.ru>
parents:
5145
diff
changeset
|
59 if [ "$NGX_SYSTEM" = "Darwin" ]; then |
baf2816d556d
Configure: workaround for system perl on OS X (ticket #576).
Maxim Dounin <mdounin@mdounin.ru>
parents:
5145
diff
changeset
|
60 # OS X system perl wants to link universal binaries |
5739 | 61 ngx_perl_ldopts=`echo $ngx_perl_ldopts \ |
6308
7e241b36819d
Configure: improved workaround for system perl on OS X.
Ruslan Ermilov <ru@nginx.com>
parents:
5743
diff
changeset
|
62 | sed -e 's/-arch i386//' -e 's/-arch x86_64//'` |
5722
baf2816d556d
Configure: workaround for system perl on OS X (ticket #576).
Maxim Dounin <mdounin@mdounin.ru>
parents:
5145
diff
changeset
|
63 fi |
baf2816d556d
Configure: workaround for system perl on OS X (ticket #576).
Maxim Dounin <mdounin@mdounin.ru>
parents:
5145
diff
changeset
|
64 |
6419 | 65 if [ $USE_PERL = YES ]; then |
66 CORE_LINK="$CORE_LINK $ngx_perl_ldopts" | |
67 fi | |
68 | |
69 NGX_LIB_PERL="$ngx_perl_ldopts" | |
599 | 70 |
71 if test -n "$NGX_PERL_MODULES"; then | |
72 have=NGX_PERL_MODULES value="(u_char *) \"$NGX_PERL_MODULES\"" | |
73 . auto/define | |
950
9581fba9ea12
fix for nginx.pm default installation
Igor Sysoev <igor@sysoev.ru>
parents:
872
diff
changeset
|
74 NGX_PERL_MODULES_MAN=$NGX_PERL_MODULES/man3 |
599 | 75 fi |
76 | |
77 else | |
78 echo | |
6821
30b6f1ff192b
Perl: removed special environment handling for the perl module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6700
diff
changeset
|
79 echo "$0: error: perl 5.8.6 or higher is required" |
599 | 80 echo |
81 | |
82 exit 1; | |
83 fi |