Mercurial > hg > nginx
annotate auto/cc/name @ 9300:5be23505292b default tip
SSI: fixed incorrect or duplicate stub output.
Following 3518:eb3aaf8bd2a9 (0.8.37), r->request_output is only set
if there are data in the first buffer sent in the subrequest. As a
result, following the change mentioned this flag cannot be used to
prevent duplicate ngx_http_ssi_stub_output() calls, since it is not
set if there was already some output, but the first buffer was empty.
Still, when there are multiple subrequests, even an empty subrequest
response might be delayed by the postpone filter, leading to a second
call of ngx_http_ssi_stub_output() during finalization from
ngx_http_writer() the subreqest buffers are released by the postpone
filter. Since r->request_output is not set after the first call, this
resulted in duplicate stub output.
Additionally, checking only the first buffer might be wrong in some
unusual cases. For example, the first buffer might be empty if
$r->flush() is called before printing any data in the embedded Perl
module.
Depending on the postpone_output value and corresponding sizes, this
issue can result in either duplicate or unexpected stub output, or
"zero size buf in writer" alerts.
Following 8124:f5515e727656 (1.23.4), it became slightly easier to
reproduce the issue, as empty static files and empty cache items now
result in a response with an empty buffer. Before the change, an empty
proxied response can be used to reproduce the issue.
Fix is check all buffers and set r->request_output if any non-empty
buffers are sent. This ensures that all unusual cases of non-empty
responses are covered, and also that r->request_output will be set
after the first stub output, preventing duplicate output.
Reported by Jan Gassen.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Jul 2024 17:41:28 +0300 |
parents | 325b3042edd6 |
children |
rev | line source |
---|---|
455 | 1 |
2 # Copyright (C) Igor Sysoev | |
4412 | 3 # Copyright (C) Nginx, Inc. |
455 | 4 |
5 | |
946 | 6 if [ "$NGX_PLATFORM" != win32 ]; then |
7 | |
8 ngx_feature="C compiler" | |
9 ngx_feature_name= | |
10 ngx_feature_run=yes | |
11 ngx_feature_incs= | |
12 ngx_feature_path= | |
13 ngx_feature_libs= | |
14 ngx_feature_test= | |
15 . auto/feature | |
16 | |
17 if [ $ngx_found = no ]; then | |
18 echo | |
19 echo $0: error: C compiler $CC is not found | |
20 echo | |
21 exit 1 | |
22 fi | |
23 | |
24 fi | |
455 | 25 |
26 | |
577 | 27 if [ "$CC" = cl ]; then |
6397
78f8ac479735
Win32: simplified and improved handling of MSVC versions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5187
diff
changeset
|
28 NGX_CC_NAME=msvc |
78f8ac479735
Win32: simplified and improved handling of MSVC versions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5187
diff
changeset
|
29 echo " + using Microsoft Visual C++ compiler" |
455 | 30 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
31 elif [ "$CC" = wcl386 ]; then |
455 | 32 NGX_CC_NAME=owc |
946 | 33 echo " + using Open Watcom C compiler" |
455 | 34 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
35 elif [ "$CC" = bcc32 ]; then |
455 | 36 NGX_CC_NAME=bcc |
946 | 37 echo " + using Borland C++ compiler" |
455 | 38 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
39 elif `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then |
4492
4871a7dc12a9
Configure: moved icc detection before gcc.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
40 NGX_CC_NAME=icc |
4871a7dc12a9
Configure: moved icc detection before gcc.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
41 echo " + using Intel C++ compiler" |
4871a7dc12a9
Configure: moved icc detection before gcc.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
42 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
43 elif `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then |
455 | 44 NGX_CC_NAME=gcc |
946 | 45 echo " + using GNU C compiler" |
455 | 46 |
7161
325b3042edd6
Configure: fixed clang detection on MINIX.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6397
diff
changeset
|
47 elif `$CC -v 2>&1 | grep 'clang version' >/dev/null 2>&1`; then |
325b3042edd6
Configure: fixed clang detection on MINIX.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6397
diff
changeset
|
48 NGX_CC_NAME=clang |
325b3042edd6
Configure: fixed clang detection on MINIX.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6397
diff
changeset
|
49 echo " + using Clang C compiler" |
325b3042edd6
Configure: fixed clang detection on MINIX.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6397
diff
changeset
|
50 |
325b3042edd6
Configure: fixed clang detection on MINIX.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6397
diff
changeset
|
51 elif `$CC -v 2>&1 | grep 'LLVM version' >/dev/null 2>&1`; then |
4762
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
4758
diff
changeset
|
52 NGX_CC_NAME=clang |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
4758
diff
changeset
|
53 echo " + using Clang C compiler" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
4758
diff
changeset
|
54 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
55 elif `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then |
561 | 56 NGX_CC_NAME=sunc |
946 | 57 echo " + using Sun C compiler" |
561 | 58 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
59 elif `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then |
455 | 60 NGX_CC_NAME=ccc |
946 | 61 echo " + using Compaq C compiler" |
455 | 62 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
63 elif `$CC -V 2>&1 | grep '^aCC: ' >/dev/null 2>&1`; then |
455 | 64 NGX_CC_NAME=acc |
946 | 65 echo " + using HP aC++ compiler" |
455 | 66 |
67 else | |
517 | 68 NGX_CC_NAME=unknown |
455 | 69 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
70 fi |