Mercurial > hg > nginx
annotate docs/GNUmakefile @ 9300:5be23505292b
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 | 1bc938b270dc |
children |
rev | line source |
---|---|
681 | 1 |
775 | 2 VER= $(shell grep 'define NGINX_VERSION' src/core/nginx.h \ |
5147
864030a4ff2a
Configure: unified nginx version computation constructs.
Ruslan Ermilov <ru@nginx.com>
parents:
4831
diff
changeset
|
3 | sed -e 's/^.*"\(.*\)".*/\1/') |
9214
1bc938b270dc
Free nginx: release process adjusted.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5585
diff
changeset
|
4 NGINX= freenginx-$(VER) |
681 | 5 TEMP= tmp |
5585
f303f3e43f7b
Docs: switched from java XSLScript to xslscript.pl.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5147
diff
changeset
|
6 XSLS?= xslscript.pl |
681 | 7 |
8 | |
4187
b9dade63fcc2
The reference documentation is moving elsewhere.
Ruslan Ermilov <ru@nginx.com>
parents:
4110
diff
changeset
|
9 all: changes |
4068
22364b1f61c9
Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents:
4013
diff
changeset
|
10 |
681 | 11 changes: $(TEMP)/$(NGINX)/CHANGES.ru \ |
12 $(TEMP)/$(NGINX)/CHANGES | |
13 | |
14 | |
4831
5e3bda6f5208
Pass changes.xml thru xmllint when generating CHANGES and CHANGES.ru.
Ruslan Ermilov <ru@nginx.com>
parents:
4776
diff
changeset
|
15 $(TEMP)/$(NGINX)/CHANGES.ru: docs/dtd/changes.dtd \ |
5e3bda6f5208
Pass changes.xml thru xmllint when generating CHANGES and CHANGES.ru.
Ruslan Ermilov <ru@nginx.com>
parents:
4776
diff
changeset
|
16 docs/xml/nginx/changes.xml \ |
4013
b427290fb6bc
- Added missing dependencies for the CHANGES{,ru} targets.
Ruslan Ermilov <ru@nginx.com>
parents:
3999
diff
changeset
|
17 docs/xml/change_log_conf.xml \ |
681 | 18 docs/xslt/changes.xslt |
19 | |
4776
3032f4854b81
Simplified makefile that builds CHANGES.
Ruslan Ermilov <ru@nginx.com>
parents:
4187
diff
changeset
|
20 mkdir -p $(TEMP)/$(NGINX) |
681 | 21 |
4831
5e3bda6f5208
Pass changes.xml thru xmllint when generating CHANGES and CHANGES.ru.
Ruslan Ermilov <ru@nginx.com>
parents:
4776
diff
changeset
|
22 xmllint --noout --valid docs/xml/nginx/changes.xml |
4013
b427290fb6bc
- Added missing dependencies for the CHANGES{,ru} targets.
Ruslan Ermilov <ru@nginx.com>
parents:
3999
diff
changeset
|
23 xsltproc --stringparam lang ru \ |
4776
3032f4854b81
Simplified makefile that builds CHANGES.
Ruslan Ermilov <ru@nginx.com>
parents:
4187
diff
changeset
|
24 -o $@ docs/xslt/changes.xslt docs/xml/nginx/changes.xml |
681 | 25 |
26 | |
4831
5e3bda6f5208
Pass changes.xml thru xmllint when generating CHANGES and CHANGES.ru.
Ruslan Ermilov <ru@nginx.com>
parents:
4776
diff
changeset
|
27 $(TEMP)/$(NGINX)/CHANGES: docs/dtd/changes.dtd \ |
5e3bda6f5208
Pass changes.xml thru xmllint when generating CHANGES and CHANGES.ru.
Ruslan Ermilov <ru@nginx.com>
parents:
4776
diff
changeset
|
28 docs/xml/nginx/changes.xml \ |
4013
b427290fb6bc
- Added missing dependencies for the CHANGES{,ru} targets.
Ruslan Ermilov <ru@nginx.com>
parents:
3999
diff
changeset
|
29 docs/xml/change_log_conf.xml \ |
681 | 30 docs/xslt/changes.xslt |
31 | |
4776
3032f4854b81
Simplified makefile that builds CHANGES.
Ruslan Ermilov <ru@nginx.com>
parents:
4187
diff
changeset
|
32 mkdir -p $(TEMP)/$(NGINX) |
681 | 33 |
4831
5e3bda6f5208
Pass changes.xml thru xmllint when generating CHANGES and CHANGES.ru.
Ruslan Ermilov <ru@nginx.com>
parents:
4776
diff
changeset
|
34 xmllint --noout --valid docs/xml/nginx/changes.xml |
4013
b427290fb6bc
- Added missing dependencies for the CHANGES{,ru} targets.
Ruslan Ermilov <ru@nginx.com>
parents:
3999
diff
changeset
|
35 xsltproc --stringparam lang en \ |
4776
3032f4854b81
Simplified makefile that builds CHANGES.
Ruslan Ermilov <ru@nginx.com>
parents:
4187
diff
changeset
|
36 -o $@ docs/xslt/changes.xslt docs/xml/nginx/changes.xml |
681 | 37 |
38 | |
5585
f303f3e43f7b
Docs: switched from java XSLScript to xslscript.pl.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5147
diff
changeset
|
39 docs/xslt/changes.xslt: docs/xsls/changes.xsls |
681 | 40 |
5585
f303f3e43f7b
Docs: switched from java XSLScript to xslscript.pl.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5147
diff
changeset
|
41 $(XSLS) -o $@ $< |