# HG changeset patch # User Igor Sysoev # Date 1214164800 -14400 # Node ID 984bb0b1399bffe332ad1fe5cd8d4d7862fa18d8 # Parent 23d1555141d98d025d1a162f5194435d7010f23f nginx 0.7.3 *) Change: the "rss" extension MIME type has been changed to "application/rss+xml". *) Change: now the "gzip_vary" directive turned on issues a "Vary: Accept-Encoding" header line for uncompressed responses too. *) Feature: now the "rewrite" directive does a redirect automatically if the "https://" protocol is used. *) Bugfix: the "proxy_pass" directive did not work with the HTTPS protocol; the bug had appeared in 0.6.9. diff --git a/CHANGES b/CHANGES --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,19 @@ +Changes with nginx 0.7.3 23 Jun 2008 + + *) Change: the "rss" extension MIME type has been changed to + "application/rss+xml". + + *) Change: now the "gzip_vary" directive turned on issues a + "Vary: Accept-Encoding" header line for uncompressed responses too. + + *) Feature: now the "rewrite" directive does a redirect automatically + if the "https://" protocol is used. + + *) Bugfix: the "proxy_pass" directive did not work with the HTTPS + protocol; the bug had appeared in 0.6.9. + + Changes with nginx 0.7.2 16 Jun 2008 *) Feature: now nginx supports EDH key exchange ciphers. @@ -9,11 +24,11 @@ Changes with nginx 0.7.2 Thanks to Manlio Perillo. *) Bugfix: after changing URI via a "rewrite" directive nginx did not - search a new location; bug appeared in 0.7.1. + search a new location; the bug had appeared in 0.7.1. Thanks to Maxim Dounin. - *) Bugfix: nginx could not be built without PCRE library; bug appeared - in 0.7.1. + *) Bugfix: nginx could not be built without PCRE library; the bug had + appeared in 0.7.1. *) Bugfix: when a request to a directory was redirected with the slash added, nginx dropped a query string from the original request. @@ -65,7 +80,7 @@ Changes with nginx 0.7.0 Changes with nginx 0.6.31 12 May 2008 *) Bugfix: nginx did not process FastCGI response if header was at the - end of FastCGI record; bug appeared in 0.6.2. + end of FastCGI record; the bug had appeared in 0.6.2. Thanks to Sergey Serov. *) Bugfix: a segmentation fault might occur in worker process if a file @@ -91,7 +106,8 @@ Changes with nginx 0.6.30 *) Bugfix: now nginx always opens files in binary mode under Cygwin. - *) Bugfix: nginx could not be built on OpenBSD; bug appeared in 0.6.15. + *) Bugfix: nginx could not be built on OpenBSD; the bug had appeared in + 0.6.15. Changes with nginx 0.6.29 18 Mar 2008 @@ -99,12 +115,13 @@ Changes with nginx 0.6.29 *) Feature: the ngx_google_perftools_module. *) Bugfix: the ngx_http_perl_module could not be built on 64-bit - platforms; bug appeared in 0.6.27. + platforms; the bug had appeared in 0.6.27. Changes with nginx 0.6.28 13 Mar 2008 - *) Bugfix: the rtsig method could not be built; bug appeared in 0.6.27. + *) Bugfix: the rtsig method could not be built; the bug had appeared in + 0.6.27. Changes with nginx 0.6.27 12 Mar 2008 @@ -176,10 +193,10 @@ Changes with nginx 0.6.26 Thanks to Ben Maurer. *) Bugfix: nginx issued the bogus error message "SSL_shutdown() failed - (SSL: )"; bug appeared in 0.6.23. + (SSL: )"; the bug had appeared in 0.6.23. *) Bugfix: in HTTPS mode requests might fail with the "bad write retry" - error; bug appeared in 0.6.23. + error; the bug had appeared in 0.6.23. Changes with nginx 0.6.25 08 Jan 2008 @@ -201,19 +218,19 @@ Changes with nginx 0.6.25 *) Bugfix: the COPY and MOVE methods did not work with single files. *) Bugfix: the ngx_http_gzip_static_module did not allow the - ngx_http_dav_module to work; bug appeared in 0.6.23. + ngx_http_dav_module to work; the bug had appeared in 0.6.23. *) Bugfix: socket leak in HTTPS mode if deferred accept was used. Thanks to Ben Maurer. - *) Bugfix: nginx could not be built without PCRE library; bug appeared - in 0.6.23. + *) Bugfix: nginx could not be built without PCRE library; the bug had + appeared in 0.6.23. Changes with nginx 0.6.24 27 Dec 2007 *) Bugfix: a segmentation fault might occur in worker process if HTTPS - was used; bug appeared in 0.6.23. + was used; the bug had appeared in 0.6.23. Changes with nginx 0.6.23 27 Dec 2007 @@ -253,7 +270,7 @@ Changes with nginx 0.6.23 Thanks to Oleg Motienko. *) Bugfix: in HTTPS mode requests might fail with the "bad write retry" - error; bug appeared in 0.5.13. + error; the bug had appeared in 0.5.13. Changes with nginx 0.6.22 19 Dec 2007 @@ -263,7 +280,7 @@ Changes with nginx 0.6.22 *) Bugfix: if nginx was built with ngx_http_perl_module, the perl before 5.8.6 was used, and perl supported threads, then during - reconfiguration the master process aborted; bug appeared in + reconfiguration the master process aborted; the bug had appeared in 0.5.9. Thanks to Boris Zhmurov. @@ -279,14 +296,14 @@ Changes with nginx 0.6.22 Thanks to Olexander Shtepa. *) Bugfix: the last address was missed in the $upstream_addr variable; - bug appeared in 0.6.18. + the bug had appeared in 0.6.18. *) Bugfix: the "fastcgi_catch_stderr" directive did return error code; now it returns 502 code, that can be rerouted to a next server using the "fastcgi_next_upstream invalid_header" directive. *) Bugfix: a segmentation fault occurred in master process if the - "fastcgi_catch_stderr" directive was used; bug appeared in + "fastcgi_catch_stderr" directive was used; the bug had appeared in 0.6.10. Thanks to Manlio Perillo. @@ -298,8 +315,8 @@ Changes with nginx 0.6.21 resolver *) Bugfix: a segmentation fault might occur in worker process if a - "proxy_pass" directive with URI-part was used; bug appeared in - 0.6.19. + "proxy_pass" directive with URI-part was used; the bug had appeared + in 0.6.19. *) Bugfix: if resolver was used on platform that does not support kqueue, then nginx issued an alert "name is out of response". @@ -317,8 +334,8 @@ Changes with nginx 0.6.21 Changes with nginx 0.6.20 28 Nov 2007 *) Bugfix: a segmentation fault might occur in worker process if a - "proxy_pass" directive with URI-part was used; bug appeared in - 0.6.19. + "proxy_pass" directive with URI-part was used; the bug had appeared + in 0.6.19. Changes with nginx 0.6.19 27 Nov 2007 @@ -351,7 +368,7 @@ Changes with nginx 0.6.17 Thanks to Alexander V. Inyukhin. *) Bugfix: URL double escaping in a redirect of the "msie_refresh" - directive; bug appeared in 0.6.4. + directive; the bug had appeared in 0.6.4. *) Bugfix: the "autoindex" directive did not work with the "alias /" directive. @@ -372,7 +389,7 @@ Changes with nginx 0.6.16 Thanks to Ilya Novikov. *) Bugfix: if the "?" character was in a "error_page" directive, then - it was escaped in a proxied request; bug appeared in 0.6.11. + it was escaped in a proxied request; the bug had appeared in 0.6.11. *) Bugfix: compatibility with mget. @@ -400,11 +417,11 @@ Changes with nginx 0.6.15 *) Bugfix: if request with request body was redirected using the "error_page" directive, then nginx tried to read the request body - again; bug appeared in 0.6.7. + again; the bug had appeared in 0.6.7. *) Bugfix: a segmentation fault occurred in worker process if no server_name was explicitly defined for server processing request; - bug appeared in 0.6.7. + the bug had appeared in 0.6.7. Changes with nginx 0.6.14 15 Oct 2007 @@ -417,7 +434,7 @@ Changes with nginx 0.6.14 "limit_except" block. *) Bugfix: if all upstream servers were failed, then all servers had - got weight the was equal one until servers became alive; bug + got weight the was equal one until servers became alive; the bug had appeared in 0.6.6. *) Bugfix: a segmentation fault occurred in worker process if @@ -436,8 +453,8 @@ Changes with nginx 0.6.14 memcached was used. *) Bugfix: nginx supported low case only "close" and "keep-alive" - values in the "Connection" request header line; bug appeared in - 0.6.11. + values in the "Connection" request header line; the bug had appeared + in 0.6.11. *) Bugfix: sub_filter did not work with empty substitution. @@ -461,7 +478,8 @@ Changes with nginx 0.6.12 *) Feature: the "smtp_greeting_delay" and "smtp_client_buffer" directives of the ngx_mail_smtp_module. - *) Bugfix: the trailing wildcards did not work; bug appeared in 0.6.9. + *) Bugfix: the trailing wildcards did not work; the bug had appeared in + 0.6.9. *) Bugfix: nginx could not start on Solaris if the shared PCRE library located in non-standard place was used. @@ -484,7 +502,8 @@ Changes with nginx 0.6.11 lines. *) Bugfix: if the "max_fails" was set for upstream server, then after - first failure server weight was always one; bug appeared in 0.6.6. + first failure server weight was always one; the bug had appeared in + 0.6.6. Changes with nginx 0.6.10 03 Sep 2007 @@ -492,7 +511,7 @@ Changes with nginx 0.6.10 *) Feature: the "open_file_cache", "open_file_cache_retest", and "open_file_cache_errors" directives. - *) Bugfix: socket leak; bug appeared in 0.6.7. + *) Bugfix: socket leak; the bug had appeared in 0.6.7. *) Bugfix: a charset set by the "charset" directive was not appended to the "Content-Type" header set by $r->send_http_header(). @@ -504,7 +523,7 @@ Changes with nginx 0.6.10 Changes with nginx 0.6.9 28 Aug 2007 *) Bugfix: a worker process may got caught in an endless loop, if the - HTTPS protocol was used; bug appeared in 0.6.7. + HTTPS protocol was used; the bug had appeared in 0.6.7. *) Bugfix: if server listened on two addresses or ports and trailing wildcard was used, then nginx did not run. @@ -512,7 +531,8 @@ Changes with nginx 0.6.9 *) Bugfix: the "ip_hash" directive might incorrectly mark servers as down. - *) Bugfix: nginx could not be built on amd64; bug appeared in 0.6.8. + *) Bugfix: nginx could not be built on amd64; the bug had appeared in + 0.6.8. Changes with nginx 0.6.8 20 Aug 2007 @@ -527,8 +547,8 @@ Changes with nginx 0.6.8 *) Change: now nginx escapes "%" in $memcached_key variable. *) Bugfix: nginx used path relative to configuration prefix for - non-absolute configuration file path specified in the "-c" key; bug - appeared in 0.6.6. + non-absolute configuration file path specified in the "-c" key; the + bug had appeared in 0.6.6. *) Bugfix: nginx did not work on FreeBSD/sparc64. @@ -570,8 +590,8 @@ Changes with nginx 0.6.7 Thanks to Jiang Hong. *) Bugfix: a worker process may got caught in an endless loop, if a - "server" inside "upstream" block was marked as "down"; bug appeared - in 0.6.6. + "server" inside "upstream" block was marked as "down"; the bug had + appeared in 0.6.6. *) Bugfix: now Solaris sendfilev() is not used to transfer the client request body to FastCGI-server via the unix domain socket. @@ -596,7 +616,7 @@ Changes with nginx 0.6.6 for HTTP and HTTPS, then nginx used only one port - 80 or 443. *) Bugfix: fix building on Solaris/amd64 by Sun Studio 11 and early - versions; bug appeared in 0.6.4. + versions; the bug had appeared in 0.6.4. Changes with nginx 0.6.5 23 Jul 2007 @@ -657,8 +677,8 @@ Changes with nginx 0.6.3 eventport method was used. *) Bugfix: the "proxy_ignore_client_abort" and - "fastcgi_ignore_client_abort" directives did not work; bug appeared - in 0.5.13. + "fastcgi_ignore_client_abort" directives did not work; the bug had + appeared in 0.5.13. Changes with nginx 0.6.2 09 Jul 2007 @@ -690,7 +710,8 @@ Changes with nginx 0.6.0 Changes with nginx 0.5.25 11 Jun 2007 *) Bugfix: nginx could not be built with the - --without-http_rewrite_module parameter; bug appeared in 0.5.24. + --without-http_rewrite_module parameter; the bug had appeared in + 0.5.24. Changes with nginx 0.5.24 06 Jun 2007 @@ -699,7 +720,7 @@ Changes with nginx 0.5.24 was made using HTTP/0.9. *) Bugfix: a part of response body might be passed uncompressed if gzip - was used; bug appeared in 0.5.23. + was used; the bug had appeared in 0.5.23. Changes with nginx 0.5.23 04 Jun 2007 @@ -722,8 +743,8 @@ Changes with nginx 0.5.23 Changes with nginx 0.5.22 29 May 2007 - *) Bugfix: a big request body might not be passed to backend; bug - appeared in 0.5.21. + *) Bugfix: a big request body might not be passed to backend; the bug + had appeared in 0.5.21. Changes with nginx 0.5.21 28 May 2007 @@ -796,11 +817,12 @@ Changes with nginx 0.5.18 *) Bugfix: a segmentation fault occurred in master process after first reconfiguration and receiving any signal if nginx was built with - ngx_http_perl_module and perl did not support multiplicity; bug - appeared in 0.5.9. + ngx_http_perl_module and perl did not support multiplicity; the bug + had appeared in 0.5.9. *) Bugfix: if perl did not support multiplicity, then after - reconfiguration perl code did not work; bug appeared in 0.3.38. + reconfiguration perl code did not work; the bug had appeared in + 0.3.38. Changes with nginx 0.5.17 02 Apr 2007 @@ -827,14 +849,14 @@ Changes with nginx 0.5.16 *) Bugfix: a segmentation fault might occur in worker process if a charset was set in the "Content-Type" header line and the line has - trailing ";"; bug appeared in 0.3.50. + trailing ";"; the bug had appeared in 0.3.50. *) Bugfix: the "[alert] zero size buf" error when FastCGI server was used and a request body written in a temporary file was multiple of 32K. *) Bugfix: nginx could not be built on Solaris without the --with-debug - option; bug appeared in 0.5.15. + option; the bug had appeared in 0.5.15. Changes with nginx 0.5.15 19 Mar 2007 @@ -890,17 +912,17 @@ Changes with nginx 0.5.13 send timeout only. *) Bugfix: nginx could not be built on platforms different from i386, - amd64, sparc and ppc; bug appeared in 0.5.8. + amd64, sparc and ppc; the bug had appeared in 0.5.8. Changes with nginx 0.5.12 12 Feb 2007 *) Bugfix: nginx could not be built on platforms different from i386, - amd64, sparc и ppc; bug appeared in 0.5.8. + amd64, sparc и ppc; the bug had appeared in 0.5.8. *) Bugfix: a segmentation fault might occur in worker process if the - temporarily files were used while working with FastCGI server; bug - appeared in 0.5.8. + temporarily files were used while working with FastCGI server; the + bug had appeared in 0.5.8. *) Bugfix: a segmentation fault might occur in worker process if the $fastcgi_script_name variable was logged. @@ -914,7 +936,7 @@ Changes with nginx 0.5.11 Thanks to Chris McGrath. *) Bugfix: the response was incorrect if several ranges were requested; - bug appeared in 0.5.6. + the bug had appeared in 0.5.6. *) Bugfix: the "create_full_put_path" directive could not create the intermediate directories if no "dav_access" directive was set. @@ -930,10 +952,10 @@ Changes with nginx 0.5.11 Changes with nginx 0.5.10 26 Jan 2007 *) Bugfix: while online executable file upgrade the new master process - did not inherit the listening sockets; bug appeared in 0.5.9. + did not inherit the listening sockets; the bug had appeared in 0.5.9. *) Bugfix: a segmentation fault might occur in worker process if nginx - was built with -O2 optimization; bug appeared in 0.5.1. + was built with -O2 optimization; the bug had appeared in 0.5.1. Changes with nginx 0.5.9 25 Jan 2007 @@ -969,7 +991,7 @@ Changes with nginx 0.5.8 *) Bugfix: if the "proxy_buffering off" directive was used and a client connection was non-active, then the connection was closed after send - timeout; bug appeared in 0.4.7. + timeout; the bug had appeared in 0.4.7. *) Bugfix: if the "epoll" method was used and a client closed a connection prematurely, then nginx closed the connection after a @@ -1050,7 +1072,7 @@ Changes with nginx 0.5.4 directive, then nginx might report about configuration error. *) Bugfix: a segmentation fault might occur if the $host variable was - used; bug appeared in 0.4.14. + used; the bug had appeared in 0.4.14. Changes with nginx 0.5.3 13 Dec 2006 @@ -1067,8 +1089,8 @@ Changes with nginx 0.5.3 Changes with nginx 0.5.2 11 Dec 2006 *) Bugfix: if the "proxy_pass" directive used the name of the - "upstream" block, then nginx tried to resolve the name; bug appeared - in 0.5.1. + "upstream" block, then nginx tried to resolve the name; the bug had + appeared in 0.5.1. Changes with nginx 0.5.1 11 Dec 2006 @@ -1076,19 +1098,20 @@ Changes with nginx 0.5.1 *) Bugfix: the "post_action" directive might not run after a unsuccessful completion of a request. - *) Workaround: for Eudora for Mac; bug appeared in 0.4.11. + *) Workaround: for Eudora for Mac; the bug had appeared in 0.4.11. Thanks to Bron Gondwana. *) Bugfix: if the "upstream" name was used in the "fastcgi_pass", then - the message "no port in upstream" was issued; bug appeared in 0.5.0. + the message "no port in upstream" was issued; the bug had appeared + in 0.5.0. *) Bugfix: if the "proxy_pass" and "fastcgi_pass" directives used the same servers but different ports, then these directives uses the - first described port; bug appeared in 0.5.0. + first described port; the bug had appeared in 0.5.0. *) Bugfix: if the "proxy_pass" and "fastcgi_pass" directives used the unix domain sockets, then these directives used first described - socket; bug appeared in 0.5.0. + socket; the bug had appeared in 0.5.0. *) Bugfix: ngx_http_auth_basic_module ignored the user if it was in the last line in the password file and there was no the carriage return, @@ -1117,8 +1140,8 @@ Changes with nginx 0.5.0 *) Feature: the WAIT status in the "Auth-Status" header line of the IMAP/POP3 proxy authentication server response. - *) Bugfix: nginx could not be built on 64-bit platforms; bug appeared - in 0.4.14. + *) Bugfix: nginx could not be built on 64-bit platforms; the bug had + appeared in 0.4.14. Changes with nginx 0.4.14 27 Nov 2006 @@ -1129,7 +1152,7 @@ Changes with nginx 0.4.14 Linux, and NetBSD. *) Bugfix: ngx_http_perl_module did not work with perl built with the - threads support; bug appeared in 0.3.38. + threads support; the bug had appeared in 0.3.38. *) Bugfix: ngx_http_perl_module did not work if perl was called recursively. @@ -1164,7 +1187,7 @@ Changes with nginx 0.4.13 the deferred accept() were used. *) Bugfix: a charset could not be set for ngx_http_autoindex_module - responses; bug appeared in 0.3.50. + responses; the bug had appeared in 0.3.50. *) Bugfix: the "[alert] zero size buf" error when FastCGI server was used; @@ -1172,8 +1195,8 @@ Changes with nginx 0.4.13 *) Bugfix: the --group= configuration parameter was ignored. Thanks to Thomas Moschny. - *) Bugfix: the 50th subrequest in SSI response did not work; bug - appeared in 0.3.50. + *) Bugfix: the 50th subrequest in SSI response did not work; the bug + had appeared in 0.3.50. Changes with nginx 0.4.12 31 Oct 2006 @@ -1194,7 +1217,7 @@ Changes with nginx 0.4.11 method. *) Bugfix: if the APOP was enabled in the POP3 proxy, then the - USER/PASS commands might not work; bug appeared in 0.4.10. + USER/PASS commands might not work; the bug had appeared in 0.4.10. Changes with nginx 0.4.10 23 Oct 2006 @@ -1209,10 +1232,10 @@ Changes with nginx 0.4.10 variable was used in the "map" directive. *) Bugfix: the ngx_http_flv_module did not support the byte ranges for - full responses; bug appeared in 0.4.7. - - *) Bugfix: nginx could not be built on Debian amd64; bug appeared in - 0.4.9. + full responses; the bug had appeared in 0.4.7. + + *) Bugfix: nginx could not be built on Debian amd64; the bug had + appeared in 0.4.9. Changes with nginx 0.4.9 13 Oct 2006 @@ -1265,14 +1288,14 @@ Changes with nginx 0.4.6 $r->headers_out("Content-Length", ...) method. *) Bugfix: after redirecting error by an "error_page" directive any - ngx_http_rewrite_module directive returned this error code; bug - appeared in 0.4.4. + ngx_http_rewrite_module directive returned this error code; the bug + had appeared in 0.4.4. Changes with nginx 0.4.5 02 Oct 2006 - *) Bugfix: nginx could not be built on Linux and Solaris; bug appeared - in 0.4.4. + *) Bugfix: nginx could not be built on Linux and Solaris; the bug had + appeared in 0.4.4. Changes with nginx 0.4.4 02 Oct 2006 @@ -1307,7 +1330,7 @@ Changes with nginx 0.4.3 error to the proxied server using a "proxy_pass" directive. *) Bugfix: a segmentation fault occurred if an unix domain socket was - used in a "proxy_pass" directive; bug appeared in 0.3.47. + used in a "proxy_pass" directive; the bug had appeared in 0.3.47. *) Bugfix: SSI did work with memcached and nonbuffered responses. @@ -1316,8 +1339,8 @@ Changes with nginx 0.4.3 Changes with nginx 0.4.2 14 Sep 2006 - *) Bugfix: the O_NOATIME flag support on Linux was canceled; bug - appeared in 0.4.1. + *) Bugfix: the O_NOATIME flag support on Linux was canceled; the bug + had appeared in 0.4.1. Changes with nginx 0.4.1 14 Sep 2006 @@ -1351,7 +1374,7 @@ Changes with nginx 0.4.0 *) Bugfix: a segmentation fault occurred if there was an "index" directive with variables and the first index name was without - variables; bug appeared in 0.1.29. + variables; the bug had appeared in 0.1.29. Changes with nginx 0.3.61 28 Aug 2006 @@ -1369,7 +1392,7 @@ Changes with nginx 0.3.61 Changes with nginx 0.3.60 18 Aug 2006 *) Bugfix: a worker process may got caught in an endless loop while an - error redirection; bug appeared in 0.3.59. + error redirection; the bug had appeared in 0.3.59. Changes with nginx 0.3.59 16 Aug 2006 @@ -1381,7 +1404,7 @@ Changes with nginx 0.3.59 *) Bugfix: the "error_page" directive did not changes the "Content-Type" header line after the "X-Accel-Redirect" was used; - bug appeared in 0.3.58. + the bug had appeared in 0.3.58. Changes with nginx 0.3.58 14 Aug 2006 @@ -1449,8 +1472,8 @@ Changes with nginx 0.3.55 upstream. *) Bugfix: on some condition while reconfiguration character codes - inside the "charset_map" may be treated invalid; bug appeared in - 0.3.50. + inside the "charset_map" may be treated invalid; the bug had + appeared in 0.3.50. Changes with nginx 0.3.54 11 Jul 2006 @@ -1469,8 +1492,8 @@ Changes with nginx 0.3.54 *) Bugfix: the $upstream_response_time variable had the time of the first request to a backend only. - *) Bugfix: nginx could not be built on amd64 platform; bug appeared in - 0.3.53. + *) Bugfix: nginx could not be built on amd64 platform; the bug had + appeared in 0.3.53. Changes with nginx 0.3.53 07 Jul 2006 @@ -1503,10 +1526,10 @@ Changes with nginx 0.3.52 return the 405 error. *) Bugfix: the worker process may got caught in an endless loop if the - limit rate was used; bug appeared in 0.3.37. + limit rate was used; the bug had appeared in 0.3.37. *) Bugfix: ngx_http_charset_module logged "unknown charset" alert, even - if the recoding was not needed; bug appeared in 0.3.50. + if the recoding was not needed; the bug had appeared in 0.3.50. *) Bugfix: if a code response of the PUT request was 409, then a temporary file was not removed. @@ -1515,7 +1538,7 @@ Changes with nginx 0.3.52 Changes with nginx 0.3.51 30 Jun 2006 *) Bugfix: the "<" symbols might disappeared some conditions in the - SSI; bug appeared in 0.3.50. + SSI; the bug had appeared in 0.3.50. Changes with nginx 0.3.50 28 Jun 2006 @@ -1560,10 +1583,11 @@ Changes with nginx 0.3.48 *) Bugfix: the internal redirect always transform client's HTTP method to GET, now the transformation is made for the "X-Accel-Redirect" - redirects only and if the method is not HEAD; bug appeared in 0.3.42. + redirects only and if the method is not HEAD; the bug had appeared + in 0.3.42. *) Bugfix: the ngx_http_perl_module could not be built, if the perl was - built with the threads support; bug appeared in 0.3.46. + built with the threads support; the bug had appeared in 0.3.46. Changes with nginx 0.3.47 23 May 2006 @@ -1677,9 +1701,9 @@ Changes with nginx 0.3.39 *) Bugfix: the active connection counter increased on the exceeding of the connection limit specified by the "worker_connections" - directive; bug appeared in 0.2.0. - - *) Bugfix: the limit rate might not work on some condition; bug + directive; the bug had appeared in 0.2.0. + + *) Bugfix: the limit rate might not work on some condition; the bug had appeared in 0.3.38. @@ -1753,7 +1777,7 @@ Changes with nginx 0.3.36 Changes with nginx 0.3.35 22 Mar 2006 *) Bugfix: the accept-filter and the TCP_DEFER_ACCEPT option were set - for first "listen" directive only; bug appeared in 0.3.31. + for first "listen" directive only; the bug had appeared in 0.3.31. *) Bugfix: in the "proxy_pass" directive without the URI part in a subrequest. @@ -1778,7 +1802,7 @@ Changes with nginx 0.3.33 Changes with nginx 0.3.32 11 Mar 2006 *) Bugfix: the debug logging on startup and reconfiguration time was - removed; bug appeared in 0.3.31. + removed; the bug had appeared in 0.3.31. Changes with nginx 0.3.31 10 Mar 2006 @@ -1796,7 +1820,8 @@ Changes with nginx 0.3.31 *) Bugfix: if there were several "listen" directives listening one various addresses inside one server, then server names like - "*.domain.tld" worked for first address only; bug appeared in 0.3.18. + "*.domain.tld" worked for first address only; the bug had appeared + in 0.3.18. *) Bugfix: if the HTTPS protocol was used in the "proxy_pass" directive and the request body was in temporarily file then the request was @@ -1814,7 +1839,7 @@ Changes with nginx 0.3.30 ngx_http_ssi_filter_module. *) Bugfix: nginx could not be built on i386 platform, if the PIC was - used; bug appeared in 0.3.27. + used; the bug had appeared in 0.3.27. Changes with nginx 0.3.29 20 Feb 2006 @@ -1890,8 +1915,8 @@ Changes with nginx 0.3.26 Changes with nginx 0.3.25 01 Feb 2006 *) Bugfix: the segmentation fault was occurred on start or while - reconfiguration if there was invalid configuration; bug appeared in - 0.3.24. + reconfiguration if there was invalid configuration; the bug had + appeared in 0.3.24. Changes with nginx 0.3.24 01 Feb 2006 @@ -1907,8 +1932,8 @@ Changes with nginx 0.3.24 location. *) Bugfix: on 64-bit platforms segmentation fault may occurred on start - if the many names were used in the "server_name" directives; bug - appeared in 0.3.18. + if the many names were used in the "server_name" directives; the bug + had appeared in 0.3.18. Changes with nginx 0.3.23 24 Jan 2006 @@ -1931,8 +1956,8 @@ Changes with nginx 0.3.22 canceled. *) Bugfix: segmentation fault was occurred if the "none" or "blocked" - values was specified in the "valid_referers" directive; bug appeared - in 0.3.18. + values was specified in the "valid_referers" directive; the bug had + appeared in 0.3.18. Changes with nginx 0.3.21 16 Jan 2006 @@ -1983,10 +2008,10 @@ Changes with nginx 0.3.18 ngx_http_map_module. *) Bugfix: segmentation fault was occurred if configuration file did - not exist; bug appeared in 0.3.12. + not exist; the bug had appeared in 0.3.12. *) Bugfix: on 64-bit platforms segmentation fault may occurred on - start; bug appeared in 0.3.16. + start; the bug had appeared in 0.3.16. Changes with nginx 0.3.17 18 Dec 2005 @@ -1997,8 +2022,8 @@ Changes with nginx 0.3.17 *) Feature: the "map" directive supports domain names in the ".domain.tld" form. - *) Bugfix: the timeouts were not used in SSL handshake; bug appeared in - 0.2.4. + *) Bugfix: the timeouts were not used in SSL handshake; the bug had + appeared in 0.2.4. *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive. @@ -2024,11 +2049,11 @@ Changes with nginx 0.3.16 *) Bugfix: the "config timefmt" SSI command set incorrect time format. *) Bugfix: nginx did not close connection to IMAP/POP3 backend for the - SSL connections; bug appeared in 0.3.13. + SSL connections; the bug had appeared in 0.3.13. Thanks to Rob Mueller. - *) Bugfix: segmentation fault may occurred in at SSL shutdown; bug - appeared in 0.3.13. + *) Bugfix: segmentation fault may occurred in at SSL shutdown; the bug + had appeared in 0.3.13. Changes with nginx 0.3.15 07 Dec 2005 @@ -2044,8 +2069,8 @@ Changes with nginx 0.3.15 Changes with nginx 0.3.14 05 Dec 2005 - *) Bugfix: in the 304 response the body was transferred; bug appeared - in 0.3.13. + *) Bugfix: in the 304 response the body was transferred; the bug had + appeared in 0.3.13. Changes with nginx 0.3.13 05 Dec 2005 @@ -2061,7 +2086,7 @@ Changes with nginx 0.3.13 request body to FastCGI-server via the unix domain socket. *) Bugfix: the "auth_basic" directive did not disable the - authorization; bug appeared in 0.3.11. + authorization; the bug had appeared in 0.3.11. Changes with nginx 0.3.12 26 Nov 2005 @@ -2082,7 +2107,7 @@ Changes with nginx 0.3.12 *) Feature: the "proxy_buffering" directive. *) Bugfix: the changes in accept mutex handling when the "rtsig" method - was used; bug appeared in 0.3.0. + was used; the bug had appeared in 0.3.0. *) Bugfix: if the client sent the "Transfer-Encoding: chunked" header line, then nginx returns the 411 error. @@ -2093,7 +2118,7 @@ Changes with nginx 0.3.12 *) Bugfix: if the "combined" format was explicitly specified in the "access_log" directive, then the empty lines was written to the log; - bug appeared in 0.3.8. + the bug had appeared in 0.3.8. *) Bugfix: nginx did not run on the sparc platform under any OS except Solaris. @@ -2105,7 +2130,7 @@ Changes with nginx 0.3.12 Changes with nginx 0.3.11 15 Nov 2005 *) Bugfix: nginx did not pass the client request headers and body while - proxying; bug appeared in 0.3.10. + proxying; the bug had appeared in 0.3.10. Changes with nginx 0.3.10 15 Nov 2005 @@ -2144,7 +2169,7 @@ Changes with nginx 0.3.10 Changes with nginx 0.3.9 10 Nov 2005 *) Bugfix: nginx considered URI as unsafe if two any symbols was - between two slashes; bug appeared in 0.3.8. + between two slashes; the bug had appeared in 0.3.8. Changes with nginx 0.3.8 09 Nov 2005 @@ -2184,8 +2209,8 @@ Changes with nginx 0.3.8 *) Bugfix: if the request URI was changes by the "rewrite" directive and the request was proxied in location given by regular expression, - then the incorrect request was transferred to backend; bug appeared - in 0.2.6. + then the incorrect request was transferred to backend; the bug had + appeared in 0.2.6. *) Bugfix: the "expires" directive did not remove the previous "Expires" header. @@ -2206,7 +2231,7 @@ Changes with nginx 0.3.7 *) Feature: the "access_log" supports the "buffer=" parameter. *) Bugfix: nginx could not be built on platforms different from i386, - amd64, sparc и ppc; bug appeared in 0.3.2. + amd64, sparc и ppc; the bug had appeared in 0.3.2. Changes with nginx 0.3.6 24 Oct 2005 @@ -2217,7 +2242,8 @@ Changes with nginx 0.3.6 *) Feature: the "log_format" supports the variables in the $name form. *) Bugfix: if at least in one server was no the "listen" directive, - then nginx did not listen on the 80 port; bug appeared in 0.3.3. + then nginx did not listen on the 80 port; the bug had appeared in + 0.3.3. *) Bugfix: if the URI part is omitted in "proxy_pass" directive, the the 80 port was always used. @@ -2226,10 +2252,10 @@ Changes with nginx 0.3.6 Changes with nginx 0.3.5 21 Oct 2005 *) Bugfix: the segmentation fault may occurred if the IMAP/POP3 login - was changed by authorization server; bug appeared in 0.2.2. + was changed by authorization server; the bug had appeared in 0.2.2. *) Bugfix: the accept mutex did not work and all connections were - handled by one process; bug appeared in 0.3.3. + handled by one process; the bug had appeared in 0.3.3. *) Bugfix: the timeout did not work if the "rtsig" method and the "timer_resolution" directive were used. @@ -2237,8 +2263,8 @@ Changes with nginx 0.3.5 Changes with nginx 0.3.4 19 Oct 2005 - *) Bugfix: nginx could not be built on Linux 2.4+ and MacOS X; bug - appeared in 0.3.3. + *) Bugfix: nginx could not be built on Linux 2.4+ and MacOS X; the bug + had appeared in 0.3.3. Changes with nginx 0.3.3 19 Oct 2005 @@ -2259,7 +2285,7 @@ Changes with nginx 0.3.3 the CLOSED state. *) Bugfix: the mime type may be incorrectly set to default value for - index file with variable in the name; bug appeared in 0.3.0. + index file with variable in the name; the bug had appeared in 0.3.0. *) Feature: the "timer_resolution" directive. @@ -2291,7 +2317,8 @@ Changes with nginx 0.3.2 Changes with nginx 0.3.1 10 Oct 2005 *) Bugfix: the segmentation fault occurred when the signal queue - overflowed if the "rtsig" method was used; bug appeared in 0.2.0. + overflowed if the "rtsig" method was used; the bug had appeared in + 0.2.0. *) Change: correct handling of the "\\", "\"", "\'", and "\$" pairs in SSI. @@ -2325,7 +2352,7 @@ Changes with nginx 0.2.6 *) Bugfix: if the "set" directive set the ngx_http_geo_module variable in some configuration part, the this variable was not available in other configuration parts and the "using uninitialized variable" - error was occurred; bug appeared in 0.2.2. + error was occurred; the bug had appeared in 0.2.2. Changes with nginx 0.2.5 04 Oct 2005 @@ -2347,17 +2374,17 @@ Changes with nginx 0.2.4 *) Feature: the ngx_http_ssi_module supports "$var=text", "$var!=text", "$var=/text/", and "$var!=/text/" expressions in the "if" command. - *) Bugfix: in proxying location without trailing slash; bug appeared in - 0.1.44. + *) Bugfix: in proxying location without trailing slash; the bug had + appeared in 0.1.44. *) Bugfix: the segmentation fault may occurred if the "rtsig" method - was used; bug appeared in 0.2.0. + was used; the bug had appeared in 0.2.0. Changes with nginx 0.2.3 30 Sep 2005 *) Bugfix: nginx could not be built without the --with-debug option; - bug appeared in 0.2.2. + the bug had appeared in 0.2.2. Changes with nginx 0.2.2 30 Sep 2005 @@ -2386,8 +2413,8 @@ Changes with nginx 0.2.2 Changes with nginx 0.2.1 23 Sep 2005 *) Bugfix: if all backend using in load-balancing failed after one - error, then nginx may got caught in an endless loop; bug appeared in - 0.2.0. + error, then nginx may got caught in an endless loop; the bug had + appeared in 0.2.0. Changes with nginx 0.2.0 23 Sep 2005 @@ -2465,7 +2492,7 @@ Changes with nginx 0.1.43 *) Bugfix: the segmentation fault occurred or the worker process may got caught in an endless loop if the proxied or FastCGI server sent the "Cache-Control" header line and the "expires" directive was - used; in the proxied mode the bug appeared in 0.1.29. + used; in the proxied mode the the bug had appeared in 0.1.29. Changes with nginx 0.1.42 23 Aug 2005 @@ -2475,7 +2502,7 @@ Changes with nginx 0.1.42 occurred in the ngx_http_proxy_module. *) Bugfix: the "limit_rate" directive did not work inside the "if" - block; bug appeared in 0.1.38. + block; the bug had appeared in 0.1.38. Changes with nginx 0.1.41 25 Jul 2005 @@ -2490,7 +2517,7 @@ Changes with nginx 0.1.40 information did not logged in the error log. *) Bugfix: the "Set-Cookie" header line was not transferred when the - "X-Accel-Redirect" was used; bug appeared in 0.1.39. + "X-Accel-Redirect" was used; the bug had appeared in 0.1.39. *) Bugfix: the "Content-Disposition" header line was not transferred when the "X-Accel-Redirect" was used. @@ -2512,8 +2539,8 @@ Changes with nginx 0.1.39 transferred while the 401 response code redirecting. *) Bugfix: the ngx_http_proxy_module and ngx_http_fastcgi_module may - close a connection before anything was transferred to a client; bug - appeared in 0.1.38. + close a connection before anything was transferred to a client; the + bug had appeared in 0.1.38. *) Workaround: the Linux glibc crypt_r() initialization bug. @@ -2522,17 +2549,17 @@ Changes with nginx 0.1.39 *) Bugfix: if the backend response had the "Location" header line and nginx should not rewrite this line, then the 500 code response body - was transferred; bug appeared in 0.1.29. + was transferred; the bug had appeared in 0.1.29. *) Bugfix: some directives of the ngx_http_proxy_module and ngx_http_fastcgi_module were not inherited from the server to the - location level; bug appeared in 0.1.29. + location level; the bug had appeared in 0.1.29. *) Bugfix: the ngx_http_ssl_module did not support the certificate chain. *) Bugfix: the ngx_http_autoindex_module did not show correctly the - long file names; bug appeared in 0.1.38. + long file names; the bug had appeared in 0.1.38. *) Bugfixes in IMAP/POP3 proxy in interaction with a backend at the login state. @@ -2560,8 +2587,8 @@ Changes with nginx 0.1.38 than one remote subrequest. *) Bugfix: nginx treated the backend response as invalid if the status - line in the header was transferred in two packets; bug appeared in - 0.1.29. + line in the header was transferred in two packets; the bug had + appeared in 0.1.29. *) Feature: the "ssi_types" directive. @@ -2615,7 +2642,7 @@ Changes with nginx 0.1.35 *) Feature: the "port_in_redirect" directive. *) Bugfix: the segmentation fault was occurred if the backend response - header was in several packets; bug appeared in 0.1.29. + header was in several packets; the bug had appeared in 0.1.29. *) Bugfix: if more than 10 servers were configured or some server did not use the "listen" directive, then the segmentation fault was @@ -2625,7 +2652,8 @@ Changes with nginx 0.1.35 bigger than the temporary file. *) Bugfix: nginx returned the 400 response on requests like - "GET http://www.domain.com/uri HTTP/1.0"; bug appeared in 0.1.28. + "GET http://www.domain.com/uri HTTP/1.0"; the bug had appeared in + 0.1.28. Changes with nginx 0.1.34 26 May 2005 @@ -2645,7 +2673,7 @@ Changes with nginx 0.1.34 Changes with nginx 0.1.33 23 May 2005 *) Bugfix: nginx could not be built with the --without-pcre parameter; - bug appeared in 0.1.29. + the bug had appeared in 0.1.29. *) Bugfix: 3, 4, 7, and 8 the "proxy_set_header" directives in one level cause the bus fault on start up. @@ -2659,7 +2687,7 @@ Changes with nginx 0.1.33 Changes with nginx 0.1.32 19 May 2005 *) Bugfix: the arguments were omitted in the redirects, issued by the - "rewrite" directive; bug appeared in 0.1.29. + "rewrite" directive; the bug had appeared in 0.1.29. *) Feature: the "if" directive supports the captures in regular expressions. @@ -2680,7 +2708,7 @@ Changes with nginx 0.1.31 *) Bugfix: errors while using SSI and gzipping. *) Bugfix: the redirect with the 301 code was transferred without - response body; bug appeared in 0.1.30. + response body; the bug had appeared in 0.1.30. Changes with nginx 0.1.30 14 May 2005 @@ -2692,7 +2720,8 @@ Changes with nginx 0.1.30 *) Bugfix: if the length of the response part received at once from proxied or FastCGI server was equal to 500, then nginx returns the - 500 response code; in proxy mode the bug appeared in 0.1.29 only. + 500 response code; in proxy mode the the bug had appeared in 0.1.29 + only. *) Bugfix: nginx did not consider the directives with 8 or 9 parameters as invalid. @@ -2771,7 +2800,7 @@ Changes with nginx 0.1.29 returned the 408 response. *) Bugfix: the segmentation fault was occurred if the backend sent an - invalid line in response header; bug appeared in 0.1.26. + invalid line in response header; the bug had appeared in 0.1.26. *) Bugfix: the segmentation fault may occurred in FastCGI fault tolerance configuration. @@ -2891,7 +2920,7 @@ Changes with nginx 0.1.23 server name of the "server_name" directive. *) Bugfix: nginx could not be built on platforms different from i386, - amd64, sparc и ppc; bug appeared in 0.1.22. + amd64, sparc и ppc; the bug had appeared in 0.1.22. *) Bugfix: the ngx_http_autoindex_module now shows the information not about the symlink, but about file or directory it points to. @@ -2906,7 +2935,7 @@ Changes with nginx 0.1.22 connections statistics if the proxying or FastCGI server were used. *) Bugfix: the installation paths were incorrectly quoted on Linux and - Solaris; bug appeared in 0.1.21. + Solaris; the bug had appeared in 0.1.21. Changes with nginx 0.1.21 22 Feb 2005 @@ -2991,7 +3020,8 @@ Changes with nginx 0.1.17 static page, then the segmentation fault occurred. *) Bugfix: if in a proxied "Location" header was a relative URL, then a - host name and a slash were added to them; bug appeared in 0.1.14. + host name and a slash were added to them; the bug had appeared in + 0.1.14. *) Bugfix: the system error message was not logged on Linux. @@ -3016,7 +3046,7 @@ Changes with nginx 0.1.16 *) Feature: the rewrite directive supports the arguments rewriting. *) Bugfix: the response code 400 was returned for the POST request with - the "Content-Length: 0" header; bug appeared in 0.1.14. + the "Content-Length: 0" header; the bug had appeared in 0.1.14. Changes with nginx 0.1.15 19 Jan 2005 @@ -3037,8 +3067,8 @@ Changes with nginx 0.1.15 to use the regular expressions in locations. *) Bugfix: the directive "proxy_preserve_host on" adds port 80 to the - "Host" headers, if upstream listen on port 80; bug appeared in - 0.1.14. + "Host" headers, if upstream listen on port 80; the bug had appeared + in 0.1.14. *) Bugfix: the same paths in autoconfiguration parameters --http-client-body-temp-path=PATH and --http-proxy-temp-path=PATH, @@ -3064,7 +3094,8 @@ Changes with nginx 0.1.14 fastcgi_max_temp_file_size, fastcgi_temp_file_write_size, fastcgi_next_upstream, and fastcgi_x_powered_by. - *) Bugfix: the "[alert] zero size buf" error; bug appeared in 0.1.3. + *) Bugfix: the "[alert] zero size buf" error; the bug had appeared in + 0.1.3. *) Change: the URI must be specified after the host name in the proxy_pass directive. @@ -3149,7 +3180,7 @@ Changes with nginx 0.1.10 *) Bugfix: if the request without arguments contains "//", "/./", "/../" or "%XX" then the lost character in the request line was - lost; bug appeared in 0.1.9. + lost; the bug had appeared in 0.1.9. *) Bugfix: the fix in 0.1.9 for the files bigger than 2G on Linux did not work. @@ -3167,7 +3198,8 @@ Changes with nginx 0.1.9 does not support sendfile64(). *) Bugfix: while the build configuration on Linux the - --with-poll_module parameter was required; bug appeared in 0.1.8. + --with-poll_module parameter was required; the bug had appeared in + 0.1.8. Changes with nginx 0.1.8 20 Nov 2004 @@ -3183,7 +3215,7 @@ Changes with nginx 0.1.8 Changes with nginx 0.1.7 12 Nov 2004 *) Bugfix: on FreeBSD the segmentation fault may occur if the size of - the transferred file was changed; bug appeared in 0.1.5. + the transferred file was changed; the bug had appeared in 0.1.5. Changes with nginx 0.1.6 11 Nov 2004 @@ -3242,13 +3274,13 @@ Changes with nginx 0.1.2 *) Bugfix: the portability improvements. *) Bugfix: if configuration file was set in command line, the - reconfiguration was impossible; bug appeared in 0.1.1. + reconfiguration was impossible; the bug had appeared in 0.1.1. *) Bugfix: proxy module may get caught in an endless loop when sendfile is not used. *) Bugfix: with sendfile the response was not recoded according to the - charset module directives; bug appeared in 0.1.1. + charset module directives; the bug had appeared in 0.1.1. *) Bugfix: very seldom bug in the kqueue processing. diff --git a/CHANGES.ru b/CHANGES.ru --- a/CHANGES.ru +++ b/CHANGES.ru @@ -1,4 +1,19 @@ +Изменения в nginx 0.7.3 23.06.2008 + + *) Изменение: MIME-тип для расширения rss изменён на + "application/rss+xml". + + *) Изменение: теперь директива "gzip_vary on" выдаёт строку + "Vary: Accept-Encoding" в заголовке ответа и для несжатых ответов. + + *) Добавление: теперь при использовании протокола "https://" в + директиве rewrite автоматически делается редирект. + + *) Исправление: директива proxy_pass не работала с протоколом HTTPS; + ошибка появилась в 0.6.9. + + Изменения в nginx 0.7.2 16.06.2008 *) Добавление: теперь nginx поддерживает шифры с обменом EDH-ключами. diff --git a/conf/mime.types b/conf/mime.types --- a/conf/mime.types +++ b/conf/mime.types @@ -2,11 +2,12 @@ types { text/html html htm shtml; text/css css; - text/xml xml rss; + text/xml xml; image/gif gif; image/jpeg jpeg jpg; application/x-javascript js; application/atom+xml atom; + application/rss+xml rss; text/mathml mml; text/plain txt; diff --git a/src/core/nginx.c b/src/core/nginx.c --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -826,7 +826,7 @@ ngx_core_module_init_conf(ngx_cycle_t *c ccf->oldpid.len = ccf->pid.len + sizeof(NGX_OLDPID_EXT); - ccf->oldpid.data = ngx_palloc(cycle->pool, ccf->oldpid.len); + ccf->oldpid.data = ngx_pnalloc(cycle->pool, ccf->oldpid.len); if (ccf->oldpid.data == NULL) { return NGX_CONF_ERROR; } @@ -870,7 +870,7 @@ ngx_core_module_init_conf(ngx_cycle_t *c } else { cycle->lock_file.len = ccf->lock_file.len + 1; - cycle->lock_file.data = ngx_palloc(cycle->pool, + cycle->lock_file.data = ngx_pnalloc(cycle->pool, ccf->lock_file.len + sizeof(".accept")); if (cycle->lock_file.data == NULL) { return NGX_CONF_ERROR; diff --git a/src/core/nginx.h b/src/core/nginx.h --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -8,7 +8,7 @@ #define _NGINX_H_INCLUDED_ -#define NGINX_VERSION "0.7.2" +#define NGINX_VERSION "0.7.3" #define NGINX_VER "nginx/" NGINX_VERSION #define NGINX_VAR "NGINX" diff --git a/src/core/ngx_array.c b/src/core/ngx_array.c --- a/src/core/ngx_array.c +++ b/src/core/ngx_array.c @@ -39,12 +39,12 @@ ngx_array_destroy(ngx_array_t *a) p = a->pool; - if ((u_char *) a->elts + a->size * a->nalloc == p->last) { - p->last -= a->size * a->nalloc; + if ((u_char *) a->elts + a->size * a->nalloc == p->d.last) { + p->d.last -= a->size * a->nalloc; } - if ((u_char *) a + sizeof(ngx_array_t) == p->last) { - p->last = (u_char *) a; + if ((u_char *) a + sizeof(ngx_array_t) == p->d.last) { + p->d.last = (u_char *) a; } } @@ -64,14 +64,15 @@ ngx_array_push(ngx_array_t *a) p = a->pool; - if ((u_char *) a->elts + size == p->last && p->last + a->size <= p->end) + if ((u_char *) a->elts + size == p->d.last + && p->d.last + a->size <= p->d.end) { /* * the array allocation is the last in the pool * and there is space for new allocation */ - p->last += a->size; + p->d.last += a->size; a->nalloc++; } else { @@ -111,15 +112,15 @@ ngx_array_push_n(ngx_array_t *a, ngx_uin p = a->pool; - if ((u_char *) a->elts + a->size * a->nalloc == p->last - && p->last + size <= p->end) + if ((u_char *) a->elts + a->size * a->nalloc == p->d.last + && p->d.last + size <= p->d.end) { /* * the array allocation is the last in the pool * and there is space for new allocation */ - p->last += size; + p->d.last += size; a->nalloc += n; } else { diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -574,7 +574,7 @@ ngx_conf_read_token(ngx_conf_t *cf) return NGX_ERROR; } - word->data = ngx_palloc(cf->pool, b->pos - start + 1); + word->data = ngx_pnalloc(cf->pool, b->pos - start + 1); if (word->data == NULL) { return NGX_ERROR; } @@ -726,7 +726,7 @@ ngx_conf_full_name(ngx_cycle_t *cycle, n } name->len = len + old.len; - name->data = ngx_palloc(cycle->pool, name->len + 1); + name->data = ngx_pnalloc(cycle->pool, name->len + 1); if (name->data == NULL) { return NGX_ERROR; } diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c --- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -36,7 +36,7 @@ ngx_listening_inet_stream_socket(ngx_con sin->sin_port = htons(port); - ls->addr_text.data = ngx_palloc(cf->pool, + ls->addr_text.data = ngx_pnalloc(cf->pool, INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1); if (ls->addr_text.data == NULL) { return NULL; @@ -106,8 +106,8 @@ ngx_set_inherited_sockets(ngx_cycle_t *c ls[i].addr_text_max_len = INET_ADDRSTRLEN; - ls[i].addr_text.data = ngx_palloc(cycle->pool, INET_ADDRSTRLEN - 1 - + sizeof(":65535") - 1); + ls[i].addr_text.data = ngx_pnalloc(cycle->pool, + INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1); if (ls[i].addr_text.data == NULL) { return NGX_ERROR; } diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -81,7 +81,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle) cycle->conf_file.len = old_cycle->conf_file.len; - cycle->conf_file.data = ngx_palloc(pool, old_cycle->conf_file.len + 1); + cycle->conf_file.data = ngx_pnalloc(pool, old_cycle->conf_file.len + 1); if (cycle->conf_file.data == NULL) { ngx_destroy_pool(pool); return NULL; @@ -182,7 +182,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle) hostname[NGX_MAXHOSTNAMELEN - 1] = '\0'; cycle->hostname.len = ngx_strlen(hostname); - cycle->hostname.data = ngx_palloc(pool, cycle->hostname.len); + cycle->hostname.data = ngx_pnalloc(pool, cycle->hostname.len); if (cycle->hostname.data == NULL) { ngx_destroy_pool(pool); return NULL; @@ -460,8 +460,8 @@ ngx_init_cycle(ngx_cycle_t *old_cycle) #else - lock_file = ngx_palloc(cycle->pool, - cycle->lock_file.len + shm_zone[i].name.len); + lock_file = ngx_pnalloc(cycle->pool, + cycle->lock_file.len + shm_zone[i].name.len); if (lock_file == NULL) { goto failed; diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c --- a/src/core/ngx_file.c +++ b/src/core/ngx_file.c @@ -46,7 +46,7 @@ ngx_create_temp_file(ngx_file_t *file, n file->name.len = path->name.len + 1 + path->len + 10; - file->name.data = ngx_palloc(pool, file->name.len + 1); + file->name.data = ngx_pnalloc(pool, file->name.len + 1); if (file->name.data == NULL) { return NGX_ERROR; } diff --git a/src/core/ngx_hash.c b/src/core/ngx_hash.c --- a/src/core/ngx_hash.c +++ b/src/core/ngx_hash.c @@ -839,7 +839,7 @@ wildcard: } name->len = last - 1; - name->data = ngx_palloc(ha->temp_pool, name->len); + name->data = ngx_pnalloc(ha->temp_pool, name->len); if (name->data == NULL) { return NGX_ERROR; } @@ -855,7 +855,7 @@ wildcard: * and ".example.com" to "com.example\0" */ - p = ngx_palloc(ha->temp_pool, last); + p = ngx_pnalloc(ha->temp_pool, last); if (p == NULL) { return NGX_ERROR; } @@ -891,7 +891,7 @@ wildcard: last++; - p = ngx_palloc(ha->temp_pool, last); + p = ngx_pnalloc(ha->temp_pool, last); if (p == NULL) { return NGX_ERROR; } @@ -944,7 +944,7 @@ wildcard: } name->len = last - skip; - name->data = ngx_palloc(ha->temp_pool, name->len); + name->data = ngx_pnalloc(ha->temp_pool, name->len); if (name->data == NULL) { return NGX_ERROR; } diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -578,7 +578,7 @@ ngx_inet_resolve_host(ngx_pool_t *pool, len = INET_ADDRSTRLEN - 1 + 1 + sizeof(":65536") - 1; - p = ngx_palloc(pool, len); + p = ngx_pnalloc(pool, len); if (p == NULL) { return NGX_ERROR; } @@ -614,7 +614,7 @@ ngx_inet_resolve_host(ngx_pool_t *pool, u->addrs[0].sockaddr = (struct sockaddr *) sin; u->addrs[0].socklen = sizeof(struct sockaddr_in); - p = ngx_palloc(pool, u->host.len + sizeof(":65536") - 1); + p = ngx_pnalloc(pool, u->host.len + sizeof(":65536") - 1); if (p == NULL) { return NGX_ERROR; } diff --git a/src/core/ngx_palloc.c b/src/core/ngx_palloc.c --- a/src/core/ngx_palloc.c +++ b/src/core/ngx_palloc.c @@ -8,6 +8,10 @@ #include +static void *ngx_palloc_block(ngx_pool_t *pool, size_t size); +static void *ngx_palloc_large(ngx_pool_t *pool, size_t size); + + ngx_pool_t * ngx_create_pool(size_t size, ngx_log_t *log) { @@ -18,11 +22,15 @@ ngx_create_pool(size_t size, ngx_log_t * return NULL; } - p->last = (u_char *) p + sizeof(ngx_pool_t); - p->end = (u_char *) p + size; + p->d.last = (u_char *) p + sizeof(ngx_pool_t); + p->d.end = (u_char *) p + size; + p->d.next = NULL; + + size = size - sizeof(ngx_pool_t); + p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size : NGX_MAX_ALLOC_FROM_POOL; + p->current = p; p->chain = NULL; - p->next = NULL; p->large = NULL; p->cleanup = NULL; p->log = log; @@ -62,9 +70,9 @@ ngx_destroy_pool(ngx_pool_t *pool) * so we can not use this log while the free()ing the pool */ - for (p = pool, n = pool->next; /* void */; p = n, n = n->next) { + for (p = pool, n = pool->d.next; /* void */; p = n, n = n->d.next) { ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, pool->log, 0, - "free: %p, unused: %uz", p, p->end - p->last); + "free: %p, unused: %uz", p, p->d.end - p->d.last); if (n == NULL) { break; @@ -73,7 +81,7 @@ ngx_destroy_pool(ngx_pool_t *pool) #endif - for (p = pool, n = pool->next; /* void */; p = n, n = n->next) { + for (p = pool, n = pool->d.next; /* void */; p = n, n = n->d.next) { ngx_free(p); if (n == NULL) { @@ -86,65 +94,106 @@ ngx_destroy_pool(ngx_pool_t *pool) void * ngx_palloc(ngx_pool_t *pool, size_t size) { - u_char *m; - ngx_pool_t *p, *n, *current; - ngx_pool_large_t *large; + u_char *m; + ngx_pool_t *p; - if (size <= (size_t) NGX_MAX_ALLOC_FROM_POOL - && size <= (size_t) (pool->end - (u_char *) pool) - - (size_t) ngx_align_ptr(sizeof(ngx_pool_t), NGX_ALIGNMENT)) - { + if (size <= pool->max) { + p = pool->current; - current = p; - for ( ;; ) { + do { + m = ngx_align_ptr(p->d.last, NGX_ALIGNMENT); - /* - * allow non-aligned memory blocks for small allocations (1, 2, - * or 3 bytes) and for odd length strings (struct's have aligned - * size) - */ + if ((size_t) (p->d.end - m) >= size) { + p->d.last = m + size; - if (size < sizeof(int) || (size & 1)) { - m = p->last; - - } else { - m = ngx_align_ptr(p->last, NGX_ALIGNMENT); + return m; } - if ((size_t) (p->end - m) >= size) { - p->last = m + size; + p = p->d.next; + + } while (p); + + return ngx_palloc_block(pool, size); + } + + return ngx_palloc_large(pool, size); +} + + +void * +ngx_pnalloc(ngx_pool_t *pool, size_t size) +{ + u_char *m; + ngx_pool_t *p; + + if (size <= pool->max) { + + p = pool->current; + + do { + m = p->d.last; + + if ((size_t) (p->d.end - m) >= size) { + p->d.last = m + size; return m; } - if ((size_t) (p->end - m) < NGX_ALIGNMENT) { - current = p->next; - } + p = p->d.next; + + } while (p); + + return ngx_palloc_block(pool, size); + } + + return ngx_palloc_large(pool, size); +} + - if (p->next == NULL) { - break; - } +static void * +ngx_palloc_block(ngx_pool_t *pool, size_t size) +{ + u_char *m; + size_t psize; + ngx_pool_t *p, *new, *current; - p = p->next; - pool->current = current; - } + psize = (size_t) (pool->d.end - (u_char *) pool); - /* allocate a new pool block */ + m = ngx_alloc(psize, pool->log); + if (m == NULL) { + return NULL; + } + + new = (ngx_pool_t *) m; - n = ngx_create_pool((size_t) (p->end - (u_char *) p), p->log); - if (n == NULL) { - return NULL; + new->d.end = m + psize; + new->d.next = NULL; + + m += sizeof(ngx_pool_data_t); + new->d.last = m + size; + + current = pool->current; + + for (p = current; p->d.next; p = p->d.next) { + if ((size_t) (p->d.end - p->d.last) < NGX_ALIGNMENT) { + current = p->d.next; } - - pool->current = current ? current : n; + } - p->next = n; - m = ngx_align_ptr(n->last, NGX_ALIGNMENT); - n->last = m + size; + p->d.next = new; + + pool->current = current ? current : new; + + return m; +} - return m; - } + +static void * +ngx_palloc_large(ngx_pool_t *pool, size_t size) +{ + void *p; + ngx_pool_large_t *large; #if 0 p = ngx_memalign(ngx_pagesize, size, pool->log); @@ -172,17 +221,6 @@ ngx_palloc(ngx_pool_t *pool, size_t size } -void * -ngx_palloc_aligned(ngx_pool_t *pool, size_t size) -{ - if (size & 1) { - size++; - } - - return ngx_palloc(pool, size); -} - - ngx_int_t ngx_pfree(ngx_pool_t *pool, void *p) { diff --git a/src/core/ngx_palloc.h b/src/core/ngx_palloc.h --- a/src/core/ngx_palloc.h +++ b/src/core/ngx_palloc.h @@ -43,12 +43,18 @@ struct ngx_pool_large_s { }; -struct ngx_pool_s { +typedef struct { u_char *last; u_char *end; + ngx_pool_t *next; +} ngx_pool_data_t; + + +struct ngx_pool_s { + ngx_pool_data_t d; + size_t max; ngx_pool_t *current; ngx_chain_t *chain; - ngx_pool_t *next; ngx_pool_large_t *large; ngx_pool_cleanup_t *cleanup; ngx_log_t *log; @@ -69,7 +75,7 @@ ngx_pool_t *ngx_create_pool(size_t size, void ngx_destroy_pool(ngx_pool_t *pool); void *ngx_palloc(ngx_pool_t *pool, size_t size); -void *ngx_palloc_aligned(ngx_pool_t *pool, size_t size); +void *ngx_pnalloc(ngx_pool_t *pool, size_t size); void *ngx_pcalloc(ngx_pool_t *pool, size_t size); ngx_int_t ngx_pfree(ngx_pool_t *pool, void *p); diff --git a/src/core/ngx_regex.c b/src/core/ngx_regex.c --- a/src/core/ngx_regex.c +++ b/src/core/ngx_regex.c @@ -165,7 +165,7 @@ ngx_regex_malloc(size_t size) #endif if (pool) { - return ngx_palloc_aligned(pool, size); + return ngx_palloc(pool, size); } return NULL; diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c --- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c @@ -34,7 +34,7 @@ ngx_pstrdup(ngx_pool_t *pool, ngx_str_t { u_char *dst; - dst = ngx_palloc(pool, src->len); + dst = ngx_pnalloc(pool, src->len); if (dst == NULL) { return NULL; } diff --git a/src/event/ngx_event_accept.c b/src/event/ngx_event_accept.c --- a/src/event/ngx_event_accept.c +++ b/src/event/ngx_event_accept.c @@ -201,7 +201,7 @@ ngx_event_accept(ngx_event_t *ev) #endif if (ls->addr_ntop) { - c->addr_text.data = ngx_palloc(c->pool, ls->addr_text_max_len); + c->addr_text.data = ngx_pnalloc(c->pool, ls->addr_text_max_len); if (c->addr_text.data == NULL) { ngx_close_accepted_connection(c); return; diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c --- a/src/event/ngx_event_openssl.c +++ b/src/event/ngx_event_openssl.c @@ -674,6 +674,11 @@ ngx_ssl_recv_chain(ngx_connection_t *c, } if (bytes) { + + if (n == 0 || n == NGX_ERROR) { + c->read->ready = 1; + } + return bytes; } @@ -1907,7 +1912,7 @@ ngx_ssl_get_certificate(ngx_connection_t len = BIO_pending(bio); s->len = len; - s->data = ngx_palloc(pool, len); + s->data = ngx_pnalloc(pool, len); if (s->data == NULL) { goto failed; } @@ -1954,7 +1959,7 @@ ngx_ssl_get_subject_dn(ngx_connection_t for (len = 0; p[len]; len++) { /* void */ } s->len = len; - s->data = ngx_palloc(pool, len); + s->data = ngx_pnalloc(pool, len); if (s->data == NULL) { OPENSSL_free(p); X509_free(cert); @@ -1996,7 +2001,7 @@ ngx_ssl_get_issuer_dn(ngx_connection_t * for (len = 0; p[len]; len++) { /* void */ } s->len = len; - s->data = ngx_palloc(pool, len); + s->data = ngx_pnalloc(pool, len); if (s->data == NULL) { OPENSSL_free(p); X509_free(cert); @@ -2036,7 +2041,7 @@ ngx_ssl_get_serial_number(ngx_connection len = BIO_pending(bio); s->len = len; - s->data = ngx_palloc(pool, len); + s->data = ngx_pnalloc(pool, len); if (s->data == NULL) { BIO_free(bio); X509_free(cert); diff --git a/src/http/modules/ngx_http_auth_basic_module.c b/src/http/modules/ngx_http_auth_basic_module.c --- a/src/http/modules/ngx_http_auth_basic_module.c +++ b/src/http/modules/ngx_http_auth_basic_module.c @@ -232,7 +232,7 @@ ngx_http_auth_basic_handler(ngx_http_req if (state == sw_passwd) { pwd.len = i - passwd; - pwd.data = ngx_palloc(r->pool, pwd.len + 1); + pwd.data = ngx_pnalloc(r->pool, pwd.len + 1); if (pwd.data == NULL) { return NGX_HTTP_INTERNAL_SERVER_ERROR; } @@ -400,7 +400,7 @@ ngx_http_auth_basic(ngx_conf_t *cf, void len = sizeof("Basic realm=\"") - 1 + realm->len + 1; - basic = ngx_palloc(cf->pool, len); + basic = ngx_pnalloc(cf->pool, len); if (basic == NULL) { return NGX_CONF_ERROR; } diff --git a/src/http/modules/ngx_http_autoindex_module.c b/src/http/modules/ngx_http_autoindex_module.c --- a/src/http/modules/ngx_http_autoindex_module.c +++ b/src/http/modules/ngx_http_autoindex_module.c @@ -282,7 +282,7 @@ ngx_http_autoindex_handler(ngx_http_requ allocated = path.len + 1 + len + 1 + NGX_HTTP_AUTOINDEX_PREALLOCATE; - filename = ngx_palloc(pool, allocated); + filename = ngx_pnalloc(pool, allocated); if (filename == NULL) { return ngx_http_autoindex_error(r, &dir, &path); } @@ -318,7 +318,7 @@ ngx_http_autoindex_handler(ngx_http_requ entry->name.len = len; - entry->name.data = ngx_palloc(pool, len + 1); + entry->name.data = ngx_pnalloc(pool, len + 1); if (entry->name.data == NULL) { return ngx_http_autoindex_error(r, &dir, &path); } diff --git a/src/http/modules/ngx_http_charset_filter_module.c b/src/http/modules/ngx_http_charset_filter_module.c --- a/src/http/modules/ngx_http_charset_filter_module.c +++ b/src/http/modules/ngx_http_charset_filter_module.c @@ -204,6 +204,12 @@ ngx_http_charset_header_filter(ngx_http_ if (r == r->main) { + if (r->headers_out.content_encoding + && r->headers_out.content_encoding->value.len) + { + return ngx_http_next_header_filter(r); + } + if (r->headers_out.content_type.len == 0) { return ngx_http_next_header_filter(r); } diff --git a/src/http/modules/ngx_http_dav_module.c b/src/http/modules/ngx_http_dav_module.c --- a/src/http/modules/ngx_http_dav_module.c +++ b/src/http/modules/ngx_http_dav_module.c @@ -1102,7 +1102,7 @@ ngx_http_dav_location(ngx_http_request_t location = path + clcf->root.len; } else { - location = ngx_palloc(r->pool, r->uri.len); + location = ngx_pnalloc(r->pool, r->uri.len); if (location == NULL) { return NGX_ERROR; } diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c --- a/src/http/modules/ngx_http_fastcgi_module.c +++ b/src/http/modules/ngx_http_fastcgi_module.c @@ -1059,7 +1059,7 @@ ngx_http_fastcgi_process_header(ngx_http size += part[i].end - part[i].start; } - p = ngx_palloc(r->pool, size); + p = ngx_pnalloc(r->pool, size); if (p == NULL) { return NGX_ERROR; } @@ -1087,7 +1087,7 @@ ngx_http_fastcgi_process_header(ngx_http h->value.data = r->header_start; h->value.data[h->value.len] = '\0'; - h->lowcase_key = ngx_palloc(r->pool, h->key.len); + h->lowcase_key = ngx_pnalloc(r->pool, h->key.len); if (h->lowcase_key == NULL) { return NGX_ERROR; } @@ -1097,9 +1097,9 @@ ngx_http_fastcgi_process_header(ngx_http h->key.len = r->header_name_end - r->header_name_start; h->value.len = r->header_end - r->header_start; - h->key.data = ngx_palloc(r->pool, - h->key.len + 1 + h->value.len + 1 - + h->key.len); + h->key.data = ngx_pnalloc(r->pool, + h->key.len + 1 + h->value.len + 1 + + h->key.len); if (h->key.data == NULL) { return NGX_ERROR; } @@ -2015,7 +2015,7 @@ ngx_http_fastcgi_script_name_variable(ng v->len = r->uri.len + flcf->index.len; - v->data = ngx_palloc(r->pool, v->len); + v->data = ngx_pnalloc(r->pool, v->len); if (v->data == NULL) { return NGX_ERROR; } diff --git a/src/http/modules/ngx_http_gzip_filter_module.c b/src/http/modules/ngx_http_gzip_filter_module.c --- a/src/http/modules/ngx_http_gzip_filter_module.c +++ b/src/http/modules/ngx_http_gzip_filter_module.c @@ -204,12 +204,11 @@ static ngx_http_output_body_filter_pt static ngx_int_t ngx_http_gzip_header_filter(ngx_http_request_t *r) { - ngx_str_t *type; - ngx_uint_t i; - ngx_table_elt_t *h; - ngx_http_gzip_ctx_t *ctx; - ngx_http_gzip_conf_t *conf; - ngx_http_core_loc_conf_t *clcf; + ngx_str_t *type; + ngx_uint_t i; + ngx_table_elt_t *h; + ngx_http_gzip_ctx_t *ctx; + ngx_http_gzip_conf_t *conf; conf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_filter_module); @@ -264,21 +263,6 @@ found: r->headers_out.content_encoding = h; - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - - if (clcf->gzip_vary) { - h = ngx_list_push(&r->headers_out.headers); - if (h == NULL) { - return NGX_ERROR; - } - - h->hash = 1; - h->key.len = sizeof("Vary") - 1; - h->key.data = (u_char *) "Vary"; - h->value.len = sizeof("Accept-Encoding") - 1; - h->value.data = (u_char *) "Accept-Encoding"; - } - ctx->length = r->headers_out.content_length_n; r->main_filter_need_in_memory = 1; @@ -802,7 +786,7 @@ ngx_http_gzip_ratio_variable(ngx_http_re return NGX_OK; } - v->data = ngx_palloc(r->pool, NGX_INT32_LEN + 3); + v->data = ngx_pnalloc(r->pool, NGX_INT32_LEN + 3); if (v->data == NULL) { return NGX_ERROR; } @@ -951,7 +935,7 @@ ngx_http_gzip_types(ngx_conf_t *cf, ngx_ type->len = value[i].len; - type->data = ngx_palloc(cf->pool, type->len + 1); + type->data = ngx_pnalloc(cf->pool, type->len + 1); if (type->data == NULL) { return NGX_CONF_ERROR; } diff --git a/src/http/modules/ngx_http_gzip_static_module.c b/src/http/modules/ngx_http_gzip_static_module.c --- a/src/http/modules/ngx_http_gzip_static_module.c +++ b/src/http/modules/ngx_http_gzip_static_module.c @@ -203,19 +203,6 @@ ngx_http_gzip_static_handler(ngx_http_re r->headers_out.content_encoding = h; - if (clcf->gzip_vary) { - h = ngx_list_push(&r->headers_out.headers); - if (h == NULL) { - return NGX_ERROR; - } - - h->hash = 1; - h->key.len = sizeof("Vary") - 1; - h->key.data = (u_char *) "Vary"; - h->value.len = sizeof("Accept-Encoding") - 1; - h->value.data = (u_char *) "Accept-Encoding"; - } - /* we need to allocate all before the header would be sent */ b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)); diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c --- a/src/http/modules/ngx_http_headers_filter_module.c +++ b/src/http/modules/ngx_http_headers_filter_module.c @@ -264,7 +264,7 @@ ngx_http_set_expires(ngx_http_request_t return NGX_OK; } - expires->value.data = ngx_palloc(r->pool, len); + expires->value.data = ngx_pnalloc(r->pool, len); if (expires->value.data == NULL) { return NGX_ERROR; } @@ -297,8 +297,8 @@ ngx_http_set_expires(ngx_http_request_t return NGX_OK; } - cc->value.data = ngx_palloc(r->pool, - sizeof("max-age=") + NGX_TIME_T_LEN + 1); + cc->value.data = ngx_pnalloc(r->pool, + sizeof("max-age=") + NGX_TIME_T_LEN + 1); if (cc->value.data == NULL) { return NGX_ERROR; } diff --git a/src/http/modules/ngx_http_index_module.c b/src/http/modules/ngx_http_index_module.c --- a/src/http/modules/ngx_http_index_module.c +++ b/src/http/modules/ngx_http_index_module.c @@ -254,7 +254,7 @@ ngx_http_index_handler(ngx_http_request_ uri.data = path.data + root; } else { - uri.data = ngx_palloc(r->pool, uri.len); + uri.data = ngx_pnalloc(r->pool, uri.len); if (uri.data == NULL) { return NGX_HTTP_INTERNAL_SERVER_ERROR; } diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c --- a/src/http/modules/ngx_http_log_module.c +++ b/src/http/modules/ngx_http_log_module.c @@ -261,7 +261,7 @@ ngx_http_log_handler(ngx_http_request_t } } - line = ngx_palloc(r->pool, len); + line = ngx_pnalloc(r->pool, len); if (line == NULL) { return NGX_ERROR; } @@ -970,7 +970,7 @@ ngx_http_log_compile_format(ngx_conf_t * } else { op->run = ngx_http_log_copy_long; - p = ngx_palloc(cf->pool, len); + p = ngx_pnalloc(cf->pool, len); if (p == NULL) { return NGX_CONF_ERROR; } diff --git a/src/http/modules/ngx_http_map_module.c b/src/http/modules/ngx_http_map_module.c --- a/src/http/modules/ngx_http_map_module.c +++ b/src/http/modules/ngx_http_map_module.c @@ -130,7 +130,7 @@ ngx_http_map_variable(ngx_http_request_t return NGX_OK; } - name = ngx_palloc(r->pool, len); + name = ngx_pnalloc(r->pool, len); if (name == NULL) { return NGX_ERROR; } diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -964,8 +964,8 @@ ngx_http_proxy_process_status_line(ngx_h u->state->status = ctx->status; u->headers_in.status_line.len = ctx->status_end - ctx->status_start; - u->headers_in.status_line.data = ngx_palloc(r->pool, - u->headers_in.status_line.len); + u->headers_in.status_line.data = ngx_pnalloc(r->pool, + u->headers_in.status_line.len); if (u->headers_in.status_line.data == NULL) { return NGX_ERROR; } @@ -1220,7 +1220,7 @@ ngx_http_proxy_process_header(ngx_http_r h->key.len = r->header_name_end - r->header_name_start; h->value.len = r->header_end - r->header_start; - h->key.data = ngx_palloc(r->pool, + h->key.data = ngx_pnalloc(r->pool, h->key.len + 1 + h->value.len + 1 + h->key.len); if (h->key.data == NULL) { return NGX_ERROR; @@ -1400,7 +1400,7 @@ ngx_http_proxy_add_x_forwarded_for_varia v->len = r->headers_in.x_forwarded_for->value.len + sizeof(", ") - 1 + r->connection->addr_text.len; - p = ngx_palloc(r->pool, v->len); + p = ngx_pnalloc(r->pool, v->len); if (p == NULL) { return NGX_ERROR; } @@ -1435,7 +1435,7 @@ ngx_http_proxy_internal_body_length_vari v->no_cacheable = 0; v->not_found = 0; - v->data = ngx_palloc(r->connection->pool, NGX_SIZE_T_LEN); + v->data = ngx_pnalloc(r->connection->pool, NGX_SIZE_T_LEN); if (v->data == NULL) { return NGX_ERROR; @@ -1492,7 +1492,7 @@ ngx_http_proxy_rewrite_redirect_text(ngx len = prefix + pr->replacement.text.len + h->value.len - pr->redirect.len; - data = ngx_palloc(r->pool, len); + data = ngx_pnalloc(r->pool, len); if (data == NULL) { return NGX_ERROR; } @@ -1544,7 +1544,7 @@ ngx_http_proxy_rewrite_redirect_vars(ngx len += lcode(&e); } - data = ngx_palloc(r->pool, len); + data = ngx_pnalloc(r->pool, len); if (data == NULL) { return NGX_ERROR; } diff --git a/src/http/modules/ngx_http_range_filter_module.c b/src/http/modules/ngx_http_range_filter_module.c --- a/src/http/modules/ngx_http_range_filter_module.c +++ b/src/http/modules/ngx_http_range_filter_module.c @@ -307,7 +307,7 @@ ngx_http_range_header_filter(ngx_http_re content_range->key.len = sizeof("Content-Range") - 1; content_range->key.data = (u_char *) "Content-Range"; - content_range->value.data = ngx_palloc(r->pool, + content_range->value.data = ngx_pnalloc(r->pool, sizeof("bytes */") - 1 + NGX_OFF_T_LEN); if (content_range->value.data == NULL) { return NGX_ERROR; @@ -341,7 +341,7 @@ ngx_http_range_header_filter(ngx_http_re content_range->key.data = (u_char *) "Content-Range"; content_range->value.data = - ngx_palloc(r->pool, sizeof("bytes -/") - 1 + 3 * NGX_OFF_T_LEN); + ngx_pnalloc(r->pool, sizeof("bytes -/") - 1 + 3 * NGX_OFF_T_LEN); if (content_range->value.data == NULL) { return NGX_ERROR; } @@ -376,7 +376,7 @@ ngx_http_range_header_filter(ngx_http_re len += sizeof("; charset=") - 1 + r->headers_out.charset.len; } - ctx->boundary_header.data = ngx_palloc(r->pool, len); + ctx->boundary_header.data = ngx_pnalloc(r->pool, len); if (ctx->boundary_header.data == NULL) { return NGX_ERROR; } @@ -414,9 +414,9 @@ ngx_http_range_header_filter(ngx_http_re } r->headers_out.content_type.data = - ngx_palloc(r->pool, - sizeof("Content-Type: multipart/byteranges; boundary=") - 1 - + NGX_ATOMIC_T_LEN); + ngx_pnalloc(r->pool, + sizeof("Content-Type: multipart/byteranges; boundary=") - 1 + + NGX_ATOMIC_T_LEN); if (r->headers_out.content_type.data == NULL) { return NGX_ERROR; @@ -441,7 +441,7 @@ ngx_http_range_header_filter(ngx_http_re /* the size of the range: "SSSS-EEEE/TTTT" CRLF CRLF */ range[i].content_range.data = - ngx_palloc(r->pool, 3 * NGX_OFF_T_LEN + 2 + 4); + ngx_pnalloc(r->pool, 3 * NGX_OFF_T_LEN + 2 + 4); if (range[i].content_range.data == NULL) { return NGX_ERROR; @@ -649,8 +649,8 @@ ngx_http_range_body_filter(ngx_http_requ b->temporary = 1; b->last_buf = 1; - b->pos = ngx_palloc(r->pool, sizeof(CRLF "--") - 1 + NGX_ATOMIC_T_LEN - + sizeof("--" CRLF) - 1); + b->pos = ngx_pnalloc(r->pool, sizeof(CRLF "--") - 1 + NGX_ATOMIC_T_LEN + + sizeof("--" CRLF) - 1); if (b->pos == NULL) { return NGX_ERROR; } diff --git a/src/http/modules/ngx_http_realip_module.c b/src/http/modules/ngx_http_realip_module.c --- a/src/http/modules/ngx_http_realip_module.c +++ b/src/http/modules/ngx_http_realip_module.c @@ -163,7 +163,7 @@ ngx_http_realip_handler(ngx_http_request return NGX_DECLINED; } - p = ngx_palloc(r->connection->pool, len); + p = ngx_pnalloc(r->connection->pool, len); if (p == NULL) { return NGX_HTTP_INTERNAL_SERVER_ERROR; } diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c --- a/src/http/modules/ngx_http_rewrite_module.c +++ b/src/http/modules/ngx_http_rewrite_module.c @@ -357,6 +357,12 @@ ngx_http_rewrite(ngx_conf_t *cf, ngx_com last = 1; } + if (ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0) { + regex->status = NGX_HTTP_MOVED_TEMPORARILY; + regex->redirect = 1; + last = 1; + } + if (cf->args->nelts == 4) { if (ngx_strcmp(value[3].data, "last") == 0) { last = 1; diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c --- a/src/http/modules/ngx_http_ssi_filter_module.c +++ b/src/http/modules/ngx_http_ssi_filter_module.c @@ -1151,8 +1151,8 @@ ngx_http_ssi_parse(ngx_http_request_t *r default: ctx->command.len = 1; - ctx->command.data = ngx_palloc(r->pool, - NGX_HTTP_SSI_COMMAND_LEN); + ctx->command.data = ngx_pnalloc(r->pool, + NGX_HTTP_SSI_COMMAND_LEN); if (ctx->command.data == NULL) { return NGX_ERROR; } @@ -1218,8 +1218,8 @@ ngx_http_ssi_parse(ngx_http_request_t *r } ctx->param->key.len = 1; - ctx->param->key.data = ngx_palloc(r->pool, - NGX_HTTP_SSI_PARAM_LEN); + ctx->param->key.data = ngx_pnalloc(r->pool, + NGX_HTTP_SSI_PARAM_LEN); if (ctx->param->key.data == NULL) { return NGX_ERROR; } @@ -1229,8 +1229,8 @@ ngx_http_ssi_parse(ngx_http_request_t *r ctx->param->value.len = 0; if (ctx->value_buf == NULL) { - ctx->param->value.data = ngx_palloc(r->pool, - ctx->value_len); + ctx->param->value.data = ngx_pnalloc(r->pool, + ctx->value_len); if (ctx->param->value.data == NULL) { return NGX_ERROR; } @@ -1408,7 +1408,7 @@ ngx_http_ssi_parse(ngx_http_request_t *r case ssi_postparam_state: if (ctx->param->value.len + 1 < ctx->value_len / 2) { - value = ngx_palloc(r->pool, ctx->param->value.len + 1); + value = ngx_pnalloc(r->pool, ctx->param->value.len + 1); if (value == NULL) { return NGX_ERROR; } @@ -1626,7 +1626,7 @@ ngx_http_ssi_evaluate_string(ngx_http_re if (prefix) { len = prefix + text->len; - data = ngx_palloc(r->pool, len); + data = ngx_pnalloc(r->pool, len); if (data == NULL) { return NGX_ERROR; } @@ -1829,7 +1829,7 @@ ngx_http_ssi_evaluate_string(ngx_http_re } } - p = ngx_palloc(r->pool, len + ((flags & NGX_HTTP_SSI_ADD_ZERO) ? 1 : 0)); + p = ngx_pnalloc(r->pool, len + ((flags & NGX_HTTP_SSI_ADD_ZERO) ? 1 : 0)); if (p == NULL) { return NGX_ERROR; } @@ -2222,7 +2222,7 @@ ngx_http_ssi_echo(ngx_http_request_t *r, NGX_ESCAPE_HTML); if (len) { - p = ngx_palloc(r->pool, value->len + len); + p = ngx_pnalloc(r->pool, value->len + len); if (p == NULL) { return NGX_HTTP_SSI_ERROR; } @@ -2239,7 +2239,7 @@ ngx_http_ssi_echo(ngx_http_request_t *r, len = ngx_escape_html(NULL, value->data, value->len); if (len) { - p = ngx_palloc(r->pool, value->len + len); + p = ngx_pnalloc(r->pool, value->len + len); if (p == NULL) { return NGX_HTTP_SSI_ERROR; } @@ -2286,7 +2286,7 @@ ngx_http_ssi_config(ngx_http_request_t * if (value) { ctx->timefmt.len = value->len; - ctx->timefmt.data = ngx_palloc(r->pool, value->len + 1); + ctx->timefmt.data = ngx_pnalloc(r->pool, value->len + 1); if (ctx->timefmt.data == NULL) { return NGX_HTTP_SSI_ERROR; } @@ -2666,7 +2666,7 @@ ngx_http_ssi_date_gmt_local_variable(ngx || (ctx->timefmt.len == sizeof("%s") - 1 && ctx->timefmt.data[0] == '%' && ctx->timefmt.data[1] == 's')) { - v->data = ngx_palloc(r->pool, NGX_TIME_T_LEN); + v->data = ngx_pnalloc(r->pool, NGX_TIME_T_LEN); if (v->data == NULL) { return NGX_ERROR; } @@ -2689,7 +2689,7 @@ ngx_http_ssi_date_gmt_local_variable(ngx return NGX_ERROR; } - v->data = ngx_palloc(r->pool, v->len); + v->data = ngx_pnalloc(r->pool, v->len); if (v->data == NULL) { return NGX_ERROR; } @@ -2738,7 +2738,7 @@ ngx_http_ssi_types(ngx_conf_t *cf, ngx_c type->len = value[i].len; - type->data = ngx_palloc(cf->pool, type->len + 1); + type->data = ngx_pnalloc(cf->pool, type->len + 1); if (type->data == NULL) { return NGX_CONF_ERROR; } diff --git a/src/http/modules/ngx_http_static_module.c b/src/http/modules/ngx_http_static_module.c --- a/src/http/modules/ngx_http_static_module.c +++ b/src/http/modules/ngx_http_static_module.c @@ -162,7 +162,7 @@ ngx_http_static_handler(ngx_http_request len += r->args.len + 1; } - location = ngx_palloc(r->pool, len); + location = ngx_pnalloc(r->pool, len); if (location == NULL) { return NGX_HTTP_INTERNAL_SERVER_ERROR; } diff --git a/src/http/modules/ngx_http_sub_filter_module.c b/src/http/modules/ngx_http_sub_filter_module.c --- a/src/http/modules/ngx_http_sub_filter_module.c +++ b/src/http/modules/ngx_http_sub_filter_module.c @@ -710,7 +710,7 @@ ngx_http_sub_types(ngx_conf_t *cf, ngx_c type->len = value[i].len; - type->data = ngx_palloc(cf->pool, type->len + 1); + type->data = ngx_pnalloc(cf->pool, type->len + 1); if (type->data == NULL) { return NGX_CONF_ERROR; } diff --git a/src/http/modules/ngx_http_userid_filter_module.c b/src/http/modules/ngx_http_userid_filter_module.c --- a/src/http/modules/ngx_http_userid_filter_module.c +++ b/src/http/modules/ngx_http_userid_filter_module.c @@ -420,7 +420,7 @@ ngx_http_userid_set_uid(ngx_http_request len += conf->domain.len; } - cookie = ngx_palloc(r->pool, len); + cookie = ngx_pnalloc(r->pool, len); if (cookie == NULL) { return NGX_ERROR; } @@ -496,7 +496,7 @@ ngx_http_userid_variable(ngx_http_reques ngx_str_t *name, uint32_t *uid) { v->len = name->len + sizeof("=00001111222233334444555566667777") - 1; - v->data = ngx_palloc(r->pool, v->len); + v->data = ngx_pnalloc(r->pool, v->len); if (v->data == NULL) { return NGX_ERROR; } @@ -620,7 +620,7 @@ ngx_http_userid_domain(ngx_conf_t *cf, v return NGX_CONF_OK; } - new = ngx_palloc(cf->pool, sizeof("; domain=") - 1 + domain->len); + new = ngx_pnalloc(cf->pool, sizeof("; domain=") - 1 + domain->len); if (new == NULL) { return NGX_CONF_ERROR; } @@ -642,7 +642,7 @@ ngx_http_userid_path(ngx_conf_t *cf, voi u_char *p, *new; - new = ngx_palloc(cf->pool, sizeof("; path=") - 1 + path->len); + new = ngx_pnalloc(cf->pool, sizeof("; path=") - 1 + path->len); if (new == NULL) { return NGX_CONF_ERROR; } diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm --- a/src/http/modules/perl/nginx.pm +++ b/src/http/modules/perl/nginx.pm @@ -47,7 +47,7 @@ our @EXPORT = qw( HTTP_INSUFFICIENT_STORAGE ); -our $VERSION = '0.7.2'; +our $VERSION = '0.7.3'; require XSLoader; XSLoader::load('nginx', $VERSION); diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs --- a/src/http/modules/perl/nginx.xs +++ b/src/http/modules/perl/nginx.xs @@ -48,7 +48,7 @@ ngx_http_perl_sv2str(pTHX_ ngx_http_requ return NGX_OK; } - s->data = ngx_palloc(r->pool, len); + s->data = ngx_pnalloc(r->pool, len); if (s->data == NULL) { return NGX_ERROR; } @@ -242,7 +242,7 @@ header_in(r, key) /* look up hashed headers */ - lowcase_key = ngx_palloc(r->pool, len); + lowcase_key = ngx_pnalloc(r->pool, len); if (lowcase_key == NULL) { XSRETURN_UNDEF; } @@ -293,7 +293,7 @@ header_in(r, key) size += ph[i]->value.len + sizeof("; ") - 1; } - cookie = ngx_palloc(r->pool, size); + cookie = ngx_pnalloc(r->pool, size); if (cookie == NULL) { XSRETURN_UNDEF; } @@ -769,7 +769,7 @@ unescape(r, text, type = 0) src = (u_char *) SvPV(text, len); - p = ngx_palloc(r->pool, len + 1); + p = ngx_pnalloc(r->pool, len + 1); if (p == NULL) { XSRETURN_UNDEF; } @@ -826,7 +826,7 @@ variable(r, name, value = NULL) p = (u_char *) SvPV(name, len); - lowcase = ngx_palloc(r->pool, len); + lowcase = ngx_pnalloc(r->pool, len); if (lowcase == NULL) { XSRETURN_UNDEF; } diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c --- a/src/http/modules/perl/ngx_http_perl_module.c +++ b/src/http/modules/perl/ngx_http_perl_module.c @@ -703,7 +703,7 @@ ngx_http_perl_call_handler(pTHX_ ngx_htt line = SvPVx(POPs, n_a); rv->len = n_a; - rv->data = ngx_palloc(r->pool, n_a); + rv->data = ngx_pnalloc(r->pool, n_a); if (rv->data == NULL) { return NGX_ERROR; } diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -1024,8 +1024,8 @@ ngx_http_create_locations_tree(ngx_conf_ lq = (ngx_http_location_queue_t *) q; len = lq->name->len - prefix; - node = ngx_palloc_aligned(cf->pool, - offsetof(ngx_http_location_tree_node_t, name) + len); + node = ngx_palloc(cf->pool, + offsetof(ngx_http_location_tree_node_t, name) + len); if (node == NULL) { return NULL; } @@ -1615,7 +1615,7 @@ ngx_http_init_listening(ngx_conf_t *cf, hip->port = in_port->port; - hip->port_text.data = ngx_palloc(cf->pool, 7); + hip->port_text.data = ngx_pnalloc(cf->pool, 7); if (hip->port_text.data == NULL) { return NGX_ERROR; } diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -832,7 +832,7 @@ ngx_http_core_find_config_phase(ngx_http } else { len = clcf->name.len + 1 + r->args.len; - p = ngx_palloc(r->pool, len); + p = ngx_pnalloc(r->pool, len); if (p == NULL) { ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); @@ -1267,7 +1267,7 @@ ngx_http_set_content_type(ngx_http_reque if (c >= 'A' && c <= 'Z') { - p = ngx_palloc(r->pool, r->exten.len); + p = ngx_pnalloc(r->pool, r->exten.len); if (p == NULL) { return NGX_HTTP_INTERNAL_SERVER_ERROR; } @@ -1390,7 +1390,7 @@ ngx_http_map_uri_to_path(ngx_http_reques path->len = clcf->root.len + reserved; - path->data = ngx_palloc(r->pool, path->len); + path->data = ngx_pnalloc(r->pool, path->len); if (path->data == NULL) { return NULL; } @@ -1460,7 +1460,7 @@ ngx_http_auth_basic_user(ngx_http_reques } auth.len = ngx_base64_decoded_length(encoded.len); - auth.data = ngx_palloc(r->pool, auth.len + 1); + auth.data = ngx_pnalloc(r->pool, auth.len + 1); if (auth.data == NULL) { return NGX_ERROR; } diff --git a/src/http/ngx_http_header_filter_module.c b/src/http/ngx_http_header_filter_module.c --- a/src/http/ngx_http_header_filter_module.c +++ b/src/http/ngx_http_header_filter_module.c @@ -347,6 +347,10 @@ ngx_http_header_filter(ngx_http_request_ len += sizeof("Connection: closed" CRLF) - 1; } + if (r->gzip && clcf->gzip_vary) { + len += sizeof("Vary: Accept-Encoding" CRLF) - 1; + } + part = &r->headers_out.headers.part; header = part->elts; @@ -516,6 +520,11 @@ ngx_http_header_filter(ngx_http_request_ sizeof("Connection: close" CRLF) - 1); } + if (r->gzip && clcf->gzip_vary) { + b->last = ngx_cpymem(b->last, "Vary: Accept-Encoding" CRLF, + sizeof("Vary: Accept-Encoding" CRLF) - 1); + } + part = &r->headers_out.headers.part; header = part->elts; diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -654,7 +654,7 @@ ngx_http_process_request_line(ngx_event_ if (r->complex_uri || r->quoted_uri) { - r->uri.data = ngx_palloc(r->pool, r->uri.len + 1); + r->uri.data = ngx_pnalloc(r->pool, r->uri.len + 1); if (r->uri.data == NULL) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); return; @@ -914,7 +914,7 @@ ngx_http_process_request_headers(ngx_eve h->value.data = r->header_start; h->value.data[h->value.len] = '\0'; - h->lowcase_key = ngx_palloc(r->pool, h->key.len); + h->lowcase_key = ngx_pnalloc(r->pool, h->key.len); if (h->lowcase_key == NULL) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); return; @@ -1562,7 +1562,7 @@ ngx_http_find_virtual_server(ngx_http_re server = buf; } else { - server = ngx_palloc(r->pool, len); + server = ngx_pnalloc(r->pool, len); if (server == NULL) { return NGX_ERROR; } diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c --- a/src/http/ngx_http_script.c +++ b/src/http/ngx_http_script.c @@ -341,7 +341,7 @@ ngx_http_script_run(ngx_http_request_t * value->len = len; - value->data = ngx_palloc(r->pool, len); + value->data = ngx_pnalloc(r->pool, len); if (value->data == NULL) { return NULL; } @@ -733,7 +733,7 @@ ngx_http_script_regex_start_code(ngx_htt e->buf.len += r->args.len + 1; } - e->buf.data = ngx_palloc(r->pool, e->buf.len); + e->buf.data = ngx_pnalloc(r->pool, e->buf.len); if (e->buf.data == NULL) { e->ip = ngx_http_script_exit; e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; @@ -1120,7 +1120,7 @@ ngx_http_script_complex_value_code(ngx_h } e->buf.len = len; - e->buf.data = ngx_palloc(e->request->pool, len); + e->buf.data = ngx_pnalloc(e->request->pool, len); if (e->buf.data == NULL) { e->ip = ngx_http_script_exit; e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -2817,7 +2817,7 @@ ngx_http_upstream_addr_variable(ngx_http } } - p = ngx_palloc(r->pool, len); + p = ngx_pnalloc(r->pool, len); if (p == NULL) { return NGX_ERROR; } @@ -2878,7 +2878,7 @@ ngx_http_upstream_status_variable(ngx_ht len = r->upstream_states->nelts * (3 + 2); - p = ngx_palloc(r->pool, len); + p = ngx_pnalloc(r->pool, len); if (p == NULL) { return NGX_ERROR; } @@ -2944,7 +2944,7 @@ ngx_http_upstream_response_time_variable len = r->upstream_states->nelts * (NGX_TIME_T_LEN + 4 + 2); - p = ngx_palloc(r->pool, len); + p = ngx_pnalloc(r->pool, len); if (p == NULL) { return NGX_ERROR; } diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c --- a/src/http/ngx_http_upstream_round_robin.c +++ b/src/http/ngx_http_upstream_round_robin.c @@ -283,7 +283,7 @@ ngx_http_upstream_create_round_robin_pee len = INET_ADDRSTRLEN - 1 + 1 + sizeof(":65536") - 1; - p = ngx_palloc(r->pool, len); + p = ngx_pnalloc(r->pool, len); if (p == NULL) { return NGX_ERROR; } diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c --- a/src/http/ngx_http_variables.c +++ b/src/http/ngx_http_variables.c @@ -272,7 +272,7 @@ ngx_http_add_variable(ngx_conf_t *cf, ng } v->name.len = name->len; - v->name.data = ngx_palloc(cf->pool, name->len); + v->name.data = ngx_pnalloc(cf->pool, name->len); if (v->name.data == NULL) { return NULL; } @@ -339,7 +339,7 @@ ngx_http_get_variable_index(ngx_conf_t * } v->name.len = name->len; - v->name.data = ngx_palloc(cf->pool, name->len); + v->name.data = ngx_pnalloc(cf->pool, name->len); if (v->name.data == NULL) { return NGX_ERROR; } @@ -615,7 +615,7 @@ ngx_http_variable_headers(ngx_http_reque len += h[i]->value.len + sizeof("; ") - 1; } - p = ngx_palloc(r->pool, len); + p = ngx_pnalloc(r->pool, len); if (p == NULL) { return NGX_ERROR; } @@ -782,7 +782,7 @@ ngx_http_variable_remote_port(ngx_http_r v->no_cacheable = 0; v->not_found = 0; - v->data = ngx_palloc(r->pool, sizeof("65535") - 1); + v->data = ngx_pnalloc(r->pool, sizeof("65535") - 1); if (v->data == NULL) { return NGX_ERROR; } @@ -809,7 +809,7 @@ ngx_http_variable_server_addr(ngx_http_r { ngx_str_t s; - s.data = ngx_palloc(r->pool, INET_ADDRSTRLEN); + s.data = ngx_pnalloc(r->pool, INET_ADDRSTRLEN); if (s.data == NULL) { return NGX_ERROR; } @@ -1032,7 +1032,7 @@ ngx_http_variable_body_bytes_sent(ngx_ht sent = 0; } - p = ngx_palloc(r->pool, NGX_OFF_T_LEN); + p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN); if (p == NULL) { return NGX_ERROR; } @@ -1083,7 +1083,7 @@ ngx_http_variable_sent_content_length(ng } if (r->headers_out.content_length_n >= 0) { - p = ngx_palloc(r->pool, NGX_OFF_T_LEN); + p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN); if (p == NULL) { return NGX_ERROR; } @@ -1120,7 +1120,7 @@ ngx_http_variable_sent_last_modified(ngx } if (r->headers_out.last_modified_time >= 0) { - p = ngx_palloc(r->pool, + p = ngx_pnalloc(r->pool, sizeof("Last-Modified: Mon, 28 Sep 1970 06:00:00 GMT") - 1); if (p == NULL) { return NGX_ERROR; @@ -1179,7 +1179,7 @@ ngx_http_variable_sent_keep_alive(ngx_ht if (clcf->keepalive_header) { - p = ngx_palloc(r->pool, sizeof("timeout=") - 1 + NGX_TIME_T_LEN); + p = ngx_pnalloc(r->pool, sizeof("timeout=") - 1 + NGX_TIME_T_LEN); if (p == NULL) { return NGX_ERROR; } diff --git a/src/mail/ngx_mail.c b/src/mail/ngx_mail.c --- a/src/mail/ngx_mail.c +++ b/src/mail/ngx_mail.c @@ -357,8 +357,8 @@ ngx_mail_block(ngx_conf_t *cf, ngx_comma imip->addrs[i].addr = in_addr[i].addr; imip->addrs[i].ctx = in_addr[i].ctx; - text = ngx_palloc(cf->pool, - INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1); + text = ngx_pnalloc(cf->pool, + INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1); if (text == NULL) { return NGX_CONF_ERROR; } diff --git a/src/mail/ngx_mail_auth_http_module.c b/src/mail/ngx_mail_auth_http_module.c --- a/src/mail/ngx_mail_auth_http_module.c +++ b/src/mail/ngx_mail_auth_http_module.c @@ -593,7 +593,7 @@ ngx_mail_auth_http_process_headers(ngx_m { s->login.len = ctx->header_end - ctx->header_start; - s->login.data = ngx_palloc(s->connection->pool, s->login.len); + s->login.data = ngx_pnalloc(s->connection->pool, s->login.len); if (s->login.data == NULL) { ngx_close_connection(ctx->peer.connection); ngx_destroy_pool(ctx->pool); @@ -614,7 +614,8 @@ ngx_mail_auth_http_process_headers(ngx_m { s->passwd.len = ctx->header_end - ctx->header_start; - s->passwd.data = ngx_palloc(s->connection->pool, s->passwd.len); + s->passwd.data = ngx_pnalloc(s->connection->pool, + s->passwd.len); if (s->passwd.data == NULL) { ngx_close_connection(ctx->peer.connection); ngx_destroy_pool(ctx->pool); @@ -651,8 +652,8 @@ ngx_mail_auth_http_process_headers(ngx_m { ctx->errcode.len = ctx->header_end - ctx->header_start; - ctx->errcode.data = ngx_palloc(s->connection->pool, - ctx->errcode.len); + ctx->errcode.data = ngx_pnalloc(s->connection->pool, + ctx->errcode.len); if (ctx->errcode.data == NULL) { ngx_close_connection(ctx->peer.connection); ngx_destroy_pool(ctx->pool); @@ -691,7 +692,7 @@ ngx_mail_auth_http_process_headers(ngx_m ctx->err.len = ctx->errcode.len + ctx->errmsg.len + sizeof(" " CRLF) - 1; - p = ngx_palloc(s->connection->pool, ctx->err.len); + p = ngx_pnalloc(s->connection->pool, ctx->err.len); if (p == NULL) { ngx_close_connection(ctx->peer.connection); ngx_destroy_pool(ctx->pool); @@ -810,7 +811,7 @@ ngx_mail_auth_http_process_headers(ngx_m peer->name.len = len; - peer->name.data = ngx_palloc(s->connection->pool, len); + peer->name.data = ngx_pnalloc(s->connection->pool, len); if (peer->name.data == NULL) { ngx_destroy_pool(ctx->pool); ngx_mail_session_internal_server_error(s); @@ -1255,7 +1256,7 @@ ngx_mail_auth_http_escape(ngx_pool_t *po escaped->len = text->len + n * 2; - p = ngx_palloc(pool, escaped->len); + p = ngx_pnalloc(pool, escaped->len); if (p == NULL) { return NGX_ERROR; } @@ -1326,7 +1327,7 @@ ngx_mail_auth_http_merge_conf(ngx_conf_t len += header[i].key.len + 2 + header[i].value.len + 2; } - p = ngx_palloc(cf->pool, len); + p = ngx_pnalloc(cf->pool, len); if (p == NULL) { return NGX_CONF_ERROR; } diff --git a/src/mail/ngx_mail_handler.c b/src/mail/ngx_mail_handler.c --- a/src/mail/ngx_mail_handler.c +++ b/src/mail/ngx_mail_handler.c @@ -236,10 +236,10 @@ ngx_int_t ngx_mail_salt(ngx_mail_session_t *s, ngx_connection_t *c, ngx_mail_core_srv_conf_t *cscf) { - s->salt.data = ngx_palloc(c->pool, - sizeof(" <18446744073709551616.@>" CRLF) - 1 - + NGX_TIME_T_LEN - + cscf->server_name.len); + s->salt.data = ngx_pnalloc(c->pool, + sizeof(" <18446744073709551616.@>" CRLF) - 1 + + NGX_TIME_T_LEN + + cscf->server_name.len); if (s->salt.data == NULL) { return NGX_ERROR; } @@ -288,7 +288,7 @@ ngx_mail_auth_plain(ngx_mail_session_t * "mail auth plain: \"%V\"", &arg[n]); #endif - plain.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[n].len)); + plain.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[n].len)); if (plain.data == NULL){ return NGX_ERROR; } @@ -344,7 +344,7 @@ ngx_mail_auth_login_username(ngx_mail_se ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0, "mail auth login username: \"%V\"", &arg[0]); - s->login.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[0].len)); + s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len)); if (s->login.data == NULL){ return NGX_ERROR; } @@ -374,7 +374,8 @@ ngx_mail_auth_login_password(ngx_mail_se "mail auth login password: \"%V\"", &arg[0]); #endif - s->passwd.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[0].len)); + s->passwd.data = ngx_pnalloc(c->pool, + ngx_base64_decoded_length(arg[0].len)); if (s->passwd.data == NULL){ return NGX_ERROR; } @@ -402,7 +403,7 @@ ngx_mail_auth_cram_md5_salt(ngx_mail_ses ngx_str_t salt; ngx_uint_t n; - p = ngx_palloc(c->pool, len + ngx_base64_encoded_length(s->salt.len) + 2); + p = ngx_pnalloc(c->pool, len + ngx_base64_encoded_length(s->salt.len) + 2); if (p == NULL) { return NGX_ERROR; } @@ -434,7 +435,7 @@ ngx_mail_auth_cram_md5(ngx_mail_session_ ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0, "mail auth cram-md5: \"%V\"", &arg[0]); - s->login.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[0].len)); + s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len)); if (s->login.data == NULL){ return NGX_ERROR; } diff --git a/src/mail/ngx_mail_imap_handler.c b/src/mail/ngx_mail_imap_handler.c --- a/src/mail/ngx_mail_imap_handler.c +++ b/src/mail/ngx_mail_imap_handler.c @@ -259,7 +259,7 @@ ngx_mail_imap_auth_state(ngx_event_t *re if (s->tagged_line.len < s->tag.len + s->text.len + s->out.len) { s->tagged_line.len = s->tag.len + s->text.len + s->out.len; - s->tagged_line.data = ngx_palloc(c->pool, s->tagged_line.len); + s->tagged_line.data = ngx_pnalloc(c->pool, s->tagged_line.len); if (s->tagged_line.data == NULL) { ngx_mail_close_connection(c); return; @@ -317,7 +317,7 @@ ngx_mail_imap_login(ngx_mail_session_t * } s->login.len = arg[0].len; - s->login.data = ngx_palloc(c->pool, s->login.len); + s->login.data = ngx_pnalloc(c->pool, s->login.len); if (s->login.data == NULL) { return NGX_ERROR; } @@ -325,7 +325,7 @@ ngx_mail_imap_login(ngx_mail_session_t * ngx_memcpy(s->login.data, arg[0].data, s->login.len); s->passwd.len = arg[1].len; - s->passwd.data = ngx_palloc(c->pool, s->passwd.len); + s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len); if (s->passwd.data == NULL) { return NGX_ERROR; } diff --git a/src/mail/ngx_mail_imap_module.c b/src/mail/ngx_mail_imap_module.c --- a/src/mail/ngx_mail_imap_module.c +++ b/src/mail/ngx_mail_imap_module.c @@ -183,7 +183,7 @@ ngx_mail_imap_merge_srv_conf(ngx_conf_t } } - p = ngx_palloc(cf->pool, size); + p = ngx_pnalloc(cf->pool, size); if (p == NULL) { return NGX_CONF_ERROR; } @@ -216,7 +216,7 @@ ngx_mail_imap_merge_srv_conf(ngx_conf_t size += sizeof(" STARTTLS") - 1; - p = ngx_palloc(cf->pool, size); + p = ngx_pnalloc(cf->pool, size); if (p == NULL) { return NGX_CONF_ERROR; } @@ -233,7 +233,7 @@ ngx_mail_imap_merge_srv_conf(ngx_conf_t size = (auth - conf->capability.data) + sizeof(CRLF) - 1 + sizeof(" STARTTLS LOGINDISABLED") - 1; - p = ngx_palloc(cf->pool, size); + p = ngx_pnalloc(cf->pool, size); if (p == NULL) { return NGX_CONF_ERROR; } diff --git a/src/mail/ngx_mail_pop3_handler.c b/src/mail/ngx_mail_pop3_handler.c --- a/src/mail/ngx_mail_pop3_handler.c +++ b/src/mail/ngx_mail_pop3_handler.c @@ -46,7 +46,7 @@ ngx_mail_pop3_init_session(ngx_mail_sess return; } - s->out.data = ngx_palloc(c->pool, sizeof(pop3_greeting) + s->salt.len); + s->out.data = ngx_pnalloc(c->pool, sizeof(pop3_greeting) + s->salt.len); if (s->out.data == NULL) { ngx_mail_session_internal_server_error(s); return; @@ -297,7 +297,7 @@ ngx_mail_pop3_user(ngx_mail_session_t *s arg = s->args.elts; s->login.len = arg[0].len; - s->login.data = ngx_palloc(c->pool, s->login.len); + s->login.data = ngx_pnalloc(c->pool, s->login.len); if (s->login.data == NULL) { return NGX_ERROR; } @@ -324,7 +324,7 @@ ngx_mail_pop3_pass(ngx_mail_session_t *s arg = s->args.elts; s->passwd.len = arg[0].len; - s->passwd.data = ngx_palloc(c->pool, s->passwd.len); + s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len); if (s->passwd.data == NULL) { return NGX_ERROR; } @@ -417,7 +417,7 @@ ngx_mail_pop3_apop(ngx_mail_session_t *s arg = s->args.elts; s->login.len = arg[0].len; - s->login.data = ngx_palloc(c->pool, s->login.len); + s->login.data = ngx_pnalloc(c->pool, s->login.len); if (s->login.data == NULL) { return NGX_ERROR; } @@ -425,7 +425,7 @@ ngx_mail_pop3_apop(ngx_mail_session_t *s ngx_memcpy(s->login.data, arg[0].data, s->login.len); s->passwd.len = arg[1].len; - s->passwd.data = ngx_palloc(c->pool, s->passwd.len); + s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len); if (s->passwd.data == NULL) { return NGX_ERROR; } diff --git a/src/mail/ngx_mail_pop3_module.c b/src/mail/ngx_mail_pop3_module.c --- a/src/mail/ngx_mail_pop3_module.c +++ b/src/mail/ngx_mail_pop3_module.c @@ -183,7 +183,7 @@ ngx_mail_pop3_merge_srv_conf(ngx_conf_t size += sizeof("SASL LOGIN PLAIN" CRLF) - 1; } - p = ngx_palloc(cf->pool, size); + p = ngx_pnalloc(cf->pool, size); if (p == NULL) { return NGX_CONF_ERROR; } @@ -213,7 +213,7 @@ ngx_mail_pop3_merge_srv_conf(ngx_conf_t size += sizeof("STLS" CRLF) - 1; - p = ngx_palloc(cf->pool, size); + p = ngx_pnalloc(cf->pool, size); if (p == NULL) { return NGX_CONF_ERROR; } @@ -236,7 +236,7 @@ ngx_mail_pop3_merge_srv_conf(ngx_conf_t } - p = ngx_palloc(cf->pool, stls_only_size); + p = ngx_pnalloc(cf->pool, stls_only_size); if (p == NULL) { return NGX_CONF_ERROR; } diff --git a/src/mail/ngx_mail_proxy_module.c b/src/mail/ngx_mail_proxy_module.c --- a/src/mail/ngx_mail_proxy_module.c +++ b/src/mail/ngx_mail_proxy_module.c @@ -253,7 +253,7 @@ ngx_mail_proxy_pop3_handler(ngx_event_t s->connection->log->action = "sending user name to upstream"; line.len = sizeof("USER ") - 1 + s->login.len + 2; - line.data = ngx_palloc(c->pool, line.len); + line.data = ngx_pnalloc(c->pool, line.len); if (line.data == NULL) { ngx_mail_proxy_internal_server_error(s); return; @@ -272,7 +272,7 @@ ngx_mail_proxy_pop3_handler(ngx_event_t s->connection->log->action = "sending password to upstream"; line.len = sizeof("PASS ") - 1 + s->passwd.len + 2; - line.data = ngx_palloc(c->pool, line.len); + line.data = ngx_pnalloc(c->pool, line.len); if (line.data == NULL) { ngx_mail_proxy_internal_server_error(s); return; @@ -369,7 +369,7 @@ ngx_mail_proxy_imap_handler(ngx_event_t line.len = s->tag.len + sizeof("LOGIN ") - 1 + 1 + NGX_SIZE_T_LEN + 1 + 2; - line.data = ngx_palloc(c->pool, line.len); + line.data = ngx_pnalloc(c->pool, line.len); if (line.data == NULL) { ngx_mail_proxy_internal_server_error(s); return; @@ -388,7 +388,7 @@ ngx_mail_proxy_imap_handler(ngx_event_t s->connection->log->action = "sending user name to upstream"; line.len = s->login.len + 1 + 1 + NGX_SIZE_T_LEN + 1 + 2; - line.data = ngx_palloc(c->pool, line.len); + line.data = ngx_pnalloc(c->pool, line.len); if (line.data == NULL) { ngx_mail_proxy_internal_server_error(s); return; @@ -408,7 +408,7 @@ ngx_mail_proxy_imap_handler(ngx_event_t s->connection->log->action = "sending password to upstream"; line.len = s->passwd.len + 2; - line.data = ngx_palloc(c->pool, line.len); + line.data = ngx_pnalloc(c->pool, line.len); if (line.data == NULL) { ngx_mail_proxy_internal_server_error(s); return; @@ -505,7 +505,7 @@ ngx_mail_proxy_smtp_handler(ngx_event_t cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); line.len = sizeof("HELO ") - 1 + cscf->server_name.len + 2; - line.data = ngx_palloc(c->pool, line.len); + line.data = ngx_pnalloc(c->pool, line.len); if (line.data == NULL) { ngx_mail_proxy_internal_server_error(s); return; @@ -535,7 +535,7 @@ ngx_mail_proxy_smtp_handler(ngx_event_t + s->esmtp + s->smtp_helo.len + s->connection->addr_text.len + s->login.len + s->host.len; - line.data = ngx_palloc(c->pool, line.len); + line.data = ngx_pnalloc(c->pool, line.len); if (line.data == NULL) { ngx_mail_proxy_internal_server_error(s); return; diff --git a/src/mail/ngx_mail_smtp_handler.c b/src/mail/ngx_mail_smtp_handler.c --- a/src/mail/ngx_mail_smtp_handler.c +++ b/src/mail/ngx_mail_smtp_handler.c @@ -506,7 +506,7 @@ ngx_mail_smtp_helo(ngx_mail_session_t *s s->smtp_helo.len = arg[0].len; - s->smtp_helo.data = ngx_palloc(c->pool, arg[0].len); + s->smtp_helo.data = ngx_pnalloc(c->pool, arg[0].len); if (s->smtp_helo.data == NULL) { return NGX_ERROR; } diff --git a/src/mail/ngx_mail_smtp_module.c b/src/mail/ngx_mail_smtp_module.c --- a/src/mail/ngx_mail_smtp_module.c +++ b/src/mail/ngx_mail_smtp_module.c @@ -160,7 +160,7 @@ ngx_mail_smtp_merge_srv_conf(ngx_conf_t size = sizeof("220 ESMTP ready" CRLF) - 1 + cscf->server_name.len; - p = ngx_palloc(cf->pool, size); + p = ngx_pnalloc(cf->pool, size); if (p == NULL) { return NGX_CONF_ERROR; } @@ -175,7 +175,7 @@ ngx_mail_smtp_merge_srv_conf(ngx_conf_t size = sizeof("250 " CRLF) - 1 + cscf->server_name.len; - p = ngx_palloc(cf->pool, size); + p = ngx_pnalloc(cf->pool, size); if (p == NULL) { return NGX_CONF_ERROR; } @@ -209,7 +209,7 @@ ngx_mail_smtp_merge_srv_conf(ngx_conf_t } } - p = ngx_palloc(cf->pool, size); + p = ngx_pnalloc(cf->pool, size); if (p == NULL) { return NGX_CONF_ERROR; } @@ -247,7 +247,7 @@ ngx_mail_smtp_merge_srv_conf(ngx_conf_t size += sizeof("250 STARTTLS" CRLF) - 1; - p = ngx_palloc(cf->pool, size); + p = ngx_pnalloc(cf->pool, size); if (p == NULL) { return NGX_CONF_ERROR; } @@ -268,7 +268,7 @@ ngx_mail_smtp_merge_srv_conf(ngx_conf_t size = (auth - conf->capability.data) + sizeof("250 STARTTLS" CRLF) - 1; - p = ngx_palloc(cf->pool, size); + p = ngx_pnalloc(cf->pool, size); if (p == NULL) { return NGX_CONF_ERROR; } diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -108,7 +108,7 @@ ngx_master_process_cycle(ngx_cycle_t *cy size += ngx_strlen(ngx_argv[i]) + 1; } - title = ngx_palloc(cycle->pool, size); + title = ngx_pnalloc(cycle->pool, size); p = ngx_cpymem(title, master_process, sizeof(master_process) - 1); for (i = 0; i < ngx_argc; i++) { diff --git a/src/os/unix/ngx_user.c b/src/os/unix/ngx_user.c --- a/src/os/unix/ngx_user.c +++ b/src/os/unix/ngx_user.c @@ -43,7 +43,7 @@ ngx_crypt(ngx_pool_t *pool, u_char *key, if (err == 0) { len = ngx_strlen(value); - *encrypted = ngx_palloc(pool, len); + *encrypted = ngx_pnalloc(pool, len); if (*encrypted) { ngx_memcpy(*encrypted, value, len + 1); return NGX_OK; @@ -81,7 +81,7 @@ ngx_crypt(ngx_pool_t *pool, u_char *key, if (value) { len = ngx_strlen(value); - *encrypted = ngx_palloc(pool, len); + *encrypted = ngx_pnalloc(pool, len); if (*encrypted) { ngx_memcpy(*encrypted, value, len + 1); }