Mercurial > hg > nginx
annotate auto/cc/owc @ 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 | b7b7f3a0cc28 |
children |
rev | line source |
---|---|
455 | 1 |
2 # Copyright (C) Igor Sysoev | |
4412 | 3 # Copyright (C) Nginx, Inc. |
455 | 4 |
5 | |
583 | 6 # Open Watcom C 1.0, 1.2, 1.3 |
455 | 7 |
8 # optimizations | |
9 | |
10 # maximize speed | |
11 CFLAGS="$CFLAGS -ot" | |
577 | 12 # reorder instructions for best pipeline usage |
455 | 13 CFLAGS="$CFLAGS -op" |
14 # inline intrinsic functions | |
15 CFLAGS="$CFLAGS -oi" | |
16 # inline expansion | |
17 CFLAGS="$CFLAGS -oe" | |
18 # disable stack checking calls | |
19 CFLAGS="$CFLAGS -s" | |
20 | |
21 case $CPU in | |
22 pentium) | |
23 # optimize for Pentium and Athlon | |
24 # register-based arguments passing conventions | |
25 CPU_OPT="-5r" | |
26 # stack-based arguments passing conventions | |
27 #CPU_OPT="-5s" | |
577 | 28 ;; |
455 | 29 |
30 pentiumpro) | |
31 # optimize for Pentium Pro, Pentium II and Pentium III | |
32 # register-based arguments passing conventions | |
33 CPU_OPT="-6r" | |
34 # stack-based arguments passing conventions | |
35 #CPU_OPT="-6s" | |
36 ;; | |
37 esac | |
38 | |
39 CFLAGS="$CFLAGS $CPU_OPT" | |
40 | |
41 | |
42 # warnings | |
43 | |
499 | 44 # maximum level |
45 CFLAGS="$CFLAGS -wx" | |
455 | 46 #CFLAGS="$CFLAGS -w3" |
47 | |
48 # stop on warning | |
49 CFLAGS="$CFLAGS -we" | |
50 | |
51 # built target is NT | |
52 CFLAGS="$CFLAGS -bt=nt" | |
53 | |
54 # multithreaded | |
55 CFLAGS="$CFLAGS -bm" | |
56 | |
57 # debug | |
58 CFLAGS="$CFLAGS -d2" | |
59 | |
60 # quiet | |
61 CFLAGS="$CFLAGS -zq" | |
62 | |
63 # Open Watcom C 1.2 | |
583 | 64 have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have |
455 | 65 |
461 | 66 |
577 | 67 # the precompiled headers |
5358
670ceaba03d8
Win32: Open Watcom C compatibility fixes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
68 #CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch" |
670ceaba03d8
Win32: Open Watcom C compatibility fixes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
69 #NGX_PCH="$NGX_OBJS/ngx_config.pch" |
670ceaba03d8
Win32: Open Watcom C compatibility fixes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
70 #NGX_BUILD_PCH="-fhq=$NGX_OBJS/ngx_config.pch" |
670ceaba03d8
Win32: Open Watcom C compatibility fixes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
71 #NGX_USE_PCH="-fh=$NGX_OBJS/ngx_config.pch" |
455 | 72 |
461 | 73 |
74 # the link flags, built target is NT GUI mode application | |
2725 | 75 #CORE_LINK="$CORE_LINK -l=nt_win" |
461 | 76 |
77 | |
78 # the resource file | |
469 | 79 NGX_RCC="wrc \$(CORE_INCS) -fo=$NGX_OBJS/nginx.res " |
80 NGX_RCC="$NGX_RCC $NGX_WIN32_RC $NGX_OBJS/nginx.exe" | |
461 | 81 |
455 | 82 |
83 ngx_include_opt="-i=" | |
84 ngx_objout="-fo" | |
85 ngx_binout="-fe=" | |
86 ngx_objext="obj" | |
87 | |
88 ngx_regex_dirsep='\\' | |
89 ngx_dirsep="\\" | |
2825
bb05c0834c8c
remove BMAKE (build make): a cc compiler should use own make
Igor Sysoev <igor@sysoev.ru>
parents:
2725
diff
changeset
|
90 |
2839
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
91 ngx_long_start=' ' |
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
92 ngx_long_end=' ' |
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
93 ngx_long_regex_cont=' \&\ |
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
94 ' |
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
95 ngx_long_cont=' & |
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
96 ' |
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
97 |
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
98 ngx_regex_cont=' \&\ |
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
99 ' |
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
100 ngx_cont=' & |
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
101 ' |
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
102 ngx_tab=' & |
cb7739c822c6
add miltilines in OpenWatcom makefiles
Igor Sysoev <igor@sysoev.ru>
parents:
2825
diff
changeset
|
103 ' |