Mercurial > hg > nginx-quic
annotate auto/install @ 7514:319242d2ddc9
Upstream: background cache update before cache send (ticket #1782).
In case of filter finalization, essential request fields like r->uri,
r->args etc could be changed, which affected the cache update subrequest.
Also, after filter finalization r->cache could be set to NULL, leading to
null pointer dereference in ngx_http_upstream_cache_background_update().
The fix is to create background cache update subrequest before sending the
cached response.
Since initial introduction in 1aeaae6e9446 (1.11.10) background cache update
subrequest was created after sending the cached response because otherwise it
blocked the parent request output. In 9552758a786e (1.13.1) background
subrequests were introduced to eliminate the delay before sending the final
part of the cached response. This also made it possible to create the
background cache update subrequest before sending the response.
Note that creating the subrequest earlier does not change the fact that in case
of filter finalization the background cache update subrequest will likely not
have enough time to successfully update the cache entry. Filter finalization
leads to the main request termination as soon the current iteration of request
processing is complete.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Mon, 03 Jun 2019 20:33:26 +0300 |
parents | 1cbd7f87c6ed |
children | 549b13cd793b |
rev | line source |
---|---|
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
1 |
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
2 # Copyright (C) Igor Sysoev |
4412 | 3 # Copyright (C) Nginx, Inc. |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
4 |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
5 |
6419 | 6 if [ $USE_PERL != NO ]; then |
599 | 7 |
8 cat << END >> $NGX_MAKEFILE | |
9 | |
10 install_perl_modules: | |
4841
95ce3172493e
Configure: fixed make macros to use parentheses instead of braces.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4740
diff
changeset
|
11 cd $NGX_OBJS/src/http/modules/perl && \$(MAKE) install |
599 | 12 END |
13 | |
14 NGX_INSTALL_PERL_MODULES=install_perl_modules | |
15 | |
16 fi | |
17 | |
18 | |
2758 | 19 case ".$NGX_SBIN_PATH" in |
20 ./*) | |
21 ;; | |
22 | |
23 *) | |
24 NGX_SBIN_PATH=$NGX_PREFIX/$NGX_SBIN_PATH | |
25 ;; | |
26 esac | |
27 | |
28 | |
6383 | 29 case ".$NGX_MODULES_PATH" in |
30 ./*) | |
31 ;; | |
32 | |
33 *) | |
34 NGX_MODULES_PATH=$NGX_PREFIX/$NGX_MODULES_PATH | |
35 ;; | |
36 esac | |
37 | |
38 NGX_MODULES_PATH=`dirname $NGX_MODULES_PATH/.` | |
39 | |
40 | |
2758 | 41 case ".$NGX_CONF_PATH" in |
42 ./*) | |
43 ;; | |
44 | |
45 *) | |
46 NGX_CONF_PATH=$NGX_PREFIX/$NGX_CONF_PATH | |
47 ;; | |
48 esac | |
49 | |
50 | |
51 NGX_CONF_PREFIX=`dirname $NGX_CONF_PATH` | |
52 | |
53 | |
54 case ".$NGX_PID_PATH" in | |
55 ./*) | |
56 ;; | |
57 | |
58 *) | |
59 NGX_PID_PATH=$NGX_PREFIX/$NGX_PID_PATH | |
60 ;; | |
61 esac | |
62 | |
63 | |
64 case ".$NGX_ERROR_LOG_PATH" in | |
4199
874a2f505e2a
Fixed configuration summary and manpage contents for the special
Ruslan Ermilov <ru@nginx.com>
parents:
4007
diff
changeset
|
65 ./* | .) |
2758 | 66 ;; |
67 | |
68 *) | |
69 NGX_ERROR_LOG_PATH=$NGX_PREFIX/$NGX_ERROR_LOG_PATH | |
70 ;; | |
71 esac | |
72 | |
73 | |
74 case ".$NGX_HTTP_LOG_PATH" in | |
75 ./*) | |
76 ;; | |
77 | |
78 *) | |
79 NGX_HTTP_LOG_PATH=$NGX_PREFIX/$NGX_HTTP_LOG_PATH | |
80 ;; | |
81 esac | |
82 | |
83 | |
4376
9346356e433d
configure on Solaris fixed
Sergey Budnevitch <sb@waeme.net>
parents:
4303
diff
changeset
|
84 if test -f man/nginx.8 ; then |
4303
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
85 NGX_MAN=man/nginx.8 |
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
86 else |
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
87 NGX_MAN=docs/man/nginx.8 |
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
88 fi |
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
89 |
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
90 if test -d html ; then |
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
91 NGX_HTML=html |
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
92 else |
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
93 NGX_HTML=docs/html |
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
94 fi |
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
95 |
469 | 96 cat << END >> $NGX_MAKEFILE |
467 | 97 |
4007
7e3c557c2604
Rebuild manpage only if needed.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3801
diff
changeset
|
98 manpage: $NGX_OBJS/nginx.8 |
7e3c557c2604
Rebuild manpage only if needed.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3801
diff
changeset
|
99 |
4303
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
100 $NGX_OBJS/nginx.8: $NGX_MAN $NGX_AUTO_CONFIG_H |
3788 | 101 sed -e "s|%%PREFIX%%|$NGX_PREFIX|" \\ |
102 -e "s|%%PID_PATH%%|$NGX_PID_PATH|" \\ | |
103 -e "s|%%CONF_PATH%%|$NGX_CONF_PATH|" \\ | |
4199
874a2f505e2a
Fixed configuration summary and manpage contents for the special
Ruslan Ermilov <ru@nginx.com>
parents:
4007
diff
changeset
|
104 -e "s|%%ERROR_LOG_PATH%%|${NGX_ERROR_LOG_PATH:-stderr}|" \\ |
4303
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
105 < $NGX_MAN > \$@ |
3788 | 106 |
6408
cfc3cfa434ec
Configure: added "build" target.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6383
diff
changeset
|
107 install: build $NGX_INSTALL_PERL_MODULES |
2009 | 108 test -d '\$(DESTDIR)$NGX_PREFIX' || mkdir -p '\$(DESTDIR)$NGX_PREFIX' |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
109 |
6426 | 110 test -d '\$(DESTDIR)`dirname "$NGX_SBIN_PATH"`' \\ |
2009 | 111 || mkdir -p '\$(DESTDIR)`dirname "$NGX_SBIN_PATH"`' |
6426 | 112 test ! -f '\$(DESTDIR)$NGX_SBIN_PATH' \\ |
113 || mv '\$(DESTDIR)$NGX_SBIN_PATH' \\ | |
2009 | 114 '\$(DESTDIR)$NGX_SBIN_PATH.old' |
115 cp $NGX_OBJS/nginx '\$(DESTDIR)$NGX_SBIN_PATH' | |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
116 |
6426 | 117 test -d '\$(DESTDIR)$NGX_CONF_PREFIX' \\ |
2009 | 118 || mkdir -p '\$(DESTDIR)$NGX_CONF_PREFIX' |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
119 |
2009 | 120 cp conf/koi-win '\$(DESTDIR)$NGX_CONF_PREFIX' |
121 cp conf/koi-utf '\$(DESTDIR)$NGX_CONF_PREFIX' | |
122 cp conf/win-utf '\$(DESTDIR)$NGX_CONF_PREFIX' | |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
123 |
6426 | 124 test -f '\$(DESTDIR)$NGX_CONF_PREFIX/mime.types' \\ |
2009 | 125 || cp conf/mime.types '\$(DESTDIR)$NGX_CONF_PREFIX' |
126 cp conf/mime.types '\$(DESTDIR)$NGX_CONF_PREFIX/mime.types.default' | |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
127 |
6426 | 128 test -f '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi_params' \\ |
2009 | 129 || cp conf/fastcgi_params '\$(DESTDIR)$NGX_CONF_PREFIX' |
6426 | 130 cp conf/fastcgi_params \\ |
2009 | 131 '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi_params.default' |
1352 | 132 |
6426 | 133 test -f '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi.conf' \\ |
3383 | 134 || cp conf/fastcgi.conf '\$(DESTDIR)$NGX_CONF_PREFIX' |
135 cp conf/fastcgi.conf '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi.conf.default' | |
136 | |
6426 | 137 test -f '\$(DESTDIR)$NGX_CONF_PREFIX/uwsgi_params' \\ |
3609 | 138 || cp conf/uwsgi_params '\$(DESTDIR)$NGX_CONF_PREFIX' |
6426 | 139 cp conf/uwsgi_params \\ |
3609 | 140 '\$(DESTDIR)$NGX_CONF_PREFIX/uwsgi_params.default' |
141 | |
6426 | 142 test -f '\$(DESTDIR)$NGX_CONF_PREFIX/scgi_params' \\ |
3637 | 143 || cp conf/scgi_params '\$(DESTDIR)$NGX_CONF_PREFIX' |
6426 | 144 cp conf/scgi_params \\ |
3637 | 145 '\$(DESTDIR)$NGX_CONF_PREFIX/scgi_params.default' |
146 | |
6426 | 147 test -f '\$(DESTDIR)$NGX_CONF_PATH' \\ |
2982
fe23e95ba993
name of file specified in --conf-path was not honored during installation
Igor Sysoev <igor@sysoev.ru>
parents:
2850
diff
changeset
|
148 || cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PATH' |
2009 | 149 cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PREFIX/nginx.conf.default' |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
150 |
6426 | 151 test -d '\$(DESTDIR)`dirname "$NGX_PID_PATH"`' \\ |
2009 | 152 || mkdir -p '\$(DESTDIR)`dirname "$NGX_PID_PATH"`' |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
153 |
6426 | 154 test -d '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`' \\ |
155 || mkdir -p '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`' | |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
156 |
6426 | 157 test -d '\$(DESTDIR)$NGX_PREFIX/html' \\ |
4303
b375a7f0d51a
Made it possible to build/install from the SVN checkout.
Ruslan Ermilov <ru@nginx.com>
parents:
4199
diff
changeset
|
158 || cp -R $NGX_HTML '\$(DESTDIR)$NGX_PREFIX' |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
159 END |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
160 |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
161 |
4199
874a2f505e2a
Fixed configuration summary and manpage contents for the special
Ruslan Ermilov <ru@nginx.com>
parents:
4007
diff
changeset
|
162 if test -n "$NGX_ERROR_LOG_PATH"; then |
469 | 163 cat << END >> $NGX_MAKEFILE |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
164 |
6426 | 165 test -d '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`' \\ |
166 || mkdir -p '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`' | |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
167 END |
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
168 |
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
169 fi |
2850
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
170 |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
171 |
6425
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
172 if test -n "$DYNAMIC_MODULES"; then |
6383 | 173 cat << END >> $NGX_MAKEFILE |
174 | |
6426 | 175 test -d '\$(DESTDIR)$NGX_MODULES_PATH' \\ |
6383 | 176 || mkdir -p '\$(DESTDIR)$NGX_MODULES_PATH' |
177 END | |
178 | |
179 fi | |
180 | |
181 | |
6425
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
182 for ngx_module in $DYNAMIC_MODULES |
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
183 do |
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
184 ngx_module=$ngx_module$ngx_modext |
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
185 |
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
186 cat << END >> $NGX_MAKEFILE |
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
187 |
6426 | 188 test ! -f '\$(DESTDIR)$NGX_MODULES_PATH/$ngx_module' \\ |
189 || mv '\$(DESTDIR)$NGX_MODULES_PATH/$ngx_module' \\ | |
6425
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
190 '\$(DESTDIR)$NGX_MODULES_PATH/$ngx_module.old' |
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
191 cp $NGX_OBJS/$ngx_module '\$(DESTDIR)$NGX_MODULES_PATH/$ngx_module' |
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
192 END |
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
193 |
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
194 done |
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
195 |
05c894a598ea
Dynamic modules: do not overwrite old modules on install.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6419
diff
changeset
|
196 |
2850
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
197 # create Makefile |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
198 |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
199 cat << END >> Makefile |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
200 |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
201 build: |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
202 \$(MAKE) -f $NGX_MAKEFILE |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
203 |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
204 install: |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
205 \$(MAKE) -f $NGX_MAKEFILE install |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
206 |
6418
8e6f34342eb6
Dynamic modules: expose the "modules" target.
Ruslan Ermilov <ru@nginx.com>
parents:
6408
diff
changeset
|
207 modules: |
8e6f34342eb6
Dynamic modules: expose the "modules" target.
Ruslan Ermilov <ru@nginx.com>
parents:
6408
diff
changeset
|
208 \$(MAKE) -f $NGX_MAKEFILE modules |
8e6f34342eb6
Dynamic modules: expose the "modules" target.
Ruslan Ermilov <ru@nginx.com>
parents:
6408
diff
changeset
|
209 |
2850
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
210 upgrade: |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
211 $NGX_SBIN_PATH -t |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
212 |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
213 kill -USR2 \`cat $NGX_PID_PATH\` |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
214 sleep 1 |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
215 test -f $NGX_PID_PATH.oldbin |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
216 |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
217 kill -QUIT \`cat $NGX_PID_PATH.oldbin\` |
4e05bd832e56
fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
218 END |