Mercurial > hg > nginx-quic
annotate auto/lib/libgd/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 | f7e79596baf2 |
children |
rev | line source |
---|---|
2788 | 1 |
2 # Copyright (C) Igor Sysoev | |
4412 | 3 # Copyright (C) Nginx, Inc. |
2788 | 4 |
5 | |
6 ngx_feature="GD library" | |
7 ngx_feature_name= | |
8 ngx_feature_run=no | |
9 ngx_feature_incs="#include <gd.h>" | |
10 ngx_feature_path= | |
11 ngx_feature_libs="-lgd" | |
7327
f7e79596baf2
Configure: fixed compiler warnings with "-Wall -Wextra".
Sergey Kandaurov <pluknet@nginx.com>
parents:
6779
diff
changeset
|
12 ngx_feature_test="gdImagePtr img = gdImageCreateFromGifPtr(1, NULL); |
f7e79596baf2
Configure: fixed compiler warnings with "-Wall -Wextra".
Sergey Kandaurov <pluknet@nginx.com>
parents:
6779
diff
changeset
|
13 (void) img" |
2788 | 14 . auto/feature |
15 | |
16 | |
17 if [ $ngx_found = no ]; then | |
18 | |
19 # FreeBSD port | |
20 | |
21 ngx_feature="GD library in /usr/local/" | |
22 ngx_feature_path="/usr/local/include" | |
23 | |
24 if [ $NGX_RPATH = YES ]; then | |
25 ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lgd" | |
26 else | |
27 ngx_feature_libs="-L/usr/local/lib -lgd" | |
28 fi | |
29 | |
30 . auto/feature | |
31 fi | |
32 | |
33 | |
34 if [ $ngx_found = no ]; then | |
35 | |
36 # NetBSD port | |
37 | |
38 ngx_feature="GD library in /usr/pkg/" | |
5013
82a3f951feb3
Configure: fixed style of include directories.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
39 ngx_feature_path="/usr/pkg/include" |
2788 | 40 |
41 if [ $NGX_RPATH = YES ]; then | |
42 ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lgd" | |
43 else | |
44 ngx_feature_libs="-L/usr/pkg/lib -lgd" | |
45 fi | |
46 | |
47 . auto/feature | |
48 fi | |
49 | |
50 | |
51 if [ $ngx_found = no ]; then | |
52 | |
53 # MacPorts | |
54 | |
55 ngx_feature="GD library in /opt/local/" | |
56 ngx_feature_path="/opt/local/include" | |
57 | |
58 if [ $NGX_RPATH = YES ]; then | |
59 ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lgd" | |
60 else | |
61 ngx_feature_libs="-L/opt/local/lib -lgd" | |
62 fi | |
63 | |
64 . auto/feature | |
65 fi | |
66 | |
67 | |
68 if [ $ngx_found = yes ]; then | |
69 | |
2796 | 70 CORE_INCS="$CORE_INCS $ngx_feature_path" |
6383 | 71 |
72 if [ $USE_LIBGD = YES ]; then | |
73 CORE_LIBS="$CORE_LIBS $ngx_feature_libs" | |
74 fi | |
75 | |
76 NGX_LIB_LIBGD=$ngx_feature_libs | |
2788 | 77 |
6779
e4b00a021cea
Image filter: support for WebP.
Valentin Bartenev <vbart@nginx.com>
parents:
6383
diff
changeset
|
78 ngx_feature="GD WebP support" |
e4b00a021cea
Image filter: support for WebP.
Valentin Bartenev <vbart@nginx.com>
parents:
6383
diff
changeset
|
79 ngx_feature_name="NGX_HAVE_GD_WEBP" |
7327
f7e79596baf2
Configure: fixed compiler warnings with "-Wall -Wextra".
Sergey Kandaurov <pluknet@nginx.com>
parents:
6779
diff
changeset
|
80 ngx_feature_test="gdImagePtr img = gdImageCreateFromWebpPtr(1, NULL); |
f7e79596baf2
Configure: fixed compiler warnings with "-Wall -Wextra".
Sergey Kandaurov <pluknet@nginx.com>
parents:
6779
diff
changeset
|
81 (void) img" |
6779
e4b00a021cea
Image filter: support for WebP.
Valentin Bartenev <vbart@nginx.com>
parents:
6383
diff
changeset
|
82 . auto/feature |
e4b00a021cea
Image filter: support for WebP.
Valentin Bartenev <vbart@nginx.com>
parents:
6383
diff
changeset
|
83 |
2788 | 84 else |
85 | |
86 cat << END | |
87 | |
88 $0: error: the HTTP image filter module requires the GD library. | |
89 You can either do not enable the module or install the libraries. | |
90 | |
91 END | |
92 | |
93 exit 1 | |
94 | |
95 fi |